10-03-2023 12:13 AM - edited 10-03-2023 01:04 AM
I am attaching my vi here. I am plotting a dynamic data type with a waveform graph which can be seen in my vi. I have also added the start and stop buttons to the vi and the start button is working as I want but I am facing an issue with the stop button. When I press the stop button when I am acquiring (Capturing the data) the data is not captured and it stops, whereas if I press the abort execution button I am able to capture the data and it stops. Why is that? Why doesn't the same thing happen if I use a stop button?
Kindly, help me out ASAP to stop and capture my data for further analysis by use of a stop button. Thank you.
10-03-2023 08:30 AM
You need to wire the stop button to the stop condition of the while loop.
THe event structure (of the start button) should be inside the loop as well.
10-04-2023 06:23 AM
10-04-2023 11:13 PM
Yeah! My apologies, I have attached an image of the vi.
10-05-2023 01:33 AM
The event structure (of the start button) I kept it outside because, If I press the start button the loop must start (Run). I did wire the stop button to the stop condition of the while loop and still the problem is same.
10-05-2023 01:46 AM
Hi Danandu/Karnarjun,
@Danandu wrote:
The event structure (of the start button) I kept it outside because, If I press the start button the loop must start (Run). I did wire the stop button to the stop condition of the while loop and still the problem is same.
An event structure placed NOT inside a loop will be problematic, especially with default settings!
When I press the stop button when I am acquiring (Capturing the data) the data is not captured and it stops, whereas if I press the abort execution button I am able to capture the data and it stops. Why is that? Why doesn't the same thing happen if I use a stop button?
When you use the abort button then the VI should stop immediately instead of capturing data…
When you use the stop button in your VI then the DAQAssistent should stop with the next iteration.
As you didn't attach your VI until now we cannot verify your observations and you need to debug your VI on your own!
10-05-2023 01:51 AM
Hello, I am attaching my vi here.
10-05-2023 02:50 AM
Hi Danandu,
@Danandu wrote:
Hello, I am attaching my vi here.
Many of us still use older LabVIEW versions, so you reach a broader audience by downconverting your VI (File->Save for previous).
I prefer LV2019…
10-05-2023 04:03 AM
Yeah! I am attaching the vi of 2019 version here.
10-05-2023 05:12 AM - edited 10-05-2023 05:12 AM
Hi Danandu,
now we got the full picture:
There are two "stop" buttons in your VI!
And an event structure blocking the outer loop.
And another loop hidden inside a case structure, also (possibly) blocking the outer loop!
Recommendation: Please rethink the whole VI design!
All you need is a simple state machine…