LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to stop while loop when a specified function is terminated?

I want to make a program which has 2 thread, one of which is to control some devices, and the other is to measure outputs of the devices.

 

To do that, I should make a 2 independent loops, but there comes a problem here.

 

I want to terminate 2 loops at the same time, but it's difficult for me to do that, because when I try to notify upper sequence's termination to lower loop by some value change, they have some dependency.

 

That's why I need your help. I want to know how to stop lower loop when the upper sequence's termination keeping their independency.

 

Please let me know. Thank you.

0 Kudos
Message 1 of 4
(2,794 Views)

i missed event timeout.

0 Kudos
Message 2 of 4
(2,792 Views)

Hi tonny,

 

you could use

- a local variable of a boolean flag. Set the flag in the upper sequence and read the local in your event loop...

- a value change-event of a boolean control (with a "value (signalling)"-property node)...

- a user-defined event (of a boolean control)...

- many more possibilities...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(2,771 Views)

Is the upper loop commanding the lower loop at all?  I would think you would have some type of communication between the loops.  Just use that communication to send a stop command.  Or the next best way is to just simply use a notifier.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,750 Views)