LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop Button in dynamic data type

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. Capture.PNG

0 Kudos
Message 1 of 16
(1,354 Views)

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. 

0 Kudos
Message 2 of 16
(1,282 Views)

@Karnarjun2495 wrote:

I am attaching my vi here.


No, you attached an image of the VI...

magritte

0 Kudos
Message 3 of 16
(1,243 Views)

Yeah! My apologies, I have attached an image of the vi. 

0 Kudos
Message 4 of 16
(1,214 Views)

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. 

0 Kudos
Message 5 of 16
(1,194 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 16
(1,183 Views)

Hello, I am attaching my vi here.

Message 7 of 16
(1,177 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 16
(1,159 Views)

Yeah! I am attaching the vi of 2019 version here.

0 Kudos
Message 9 of 16
(1,140 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 16
(1,118 Views)