From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop two timed loops with for loops inside them using one stop button

Hi all!

I am having trouble stopping two timed loops with one stop button.

I have two for loops running inside two different timed loops. I would like to stop the program whenever the total time elapsed is 15min or when the user himself presses the stop button. How do I do this....how do I stop the inside for loop with one stop button and then the outside timed loops?

When I create a local variable for the stop button it gives me error stating "Boolean latch option is incompatible with local variables".

Thanks!
0 Kudos
Message 1 of 2
(2,540 Views)
Hi jugheadtheegghead,

You cannot use a Local Variable for a Boolean Control that has its mechanical action set to any "Latch" mode. The solution is to change the Boolean control to one of the "Switch" modes (I prefer the "Switch Until Released" mode).

Another solution is to set the value of a Boolean indicator when the first loop exits. Then use a Local variable of this indicator to stop the second loop. This solution will enable you to use a "Latching" button for the first loop. Please see the attached ParallelLoops.JPG for an example.

Have fun!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 2 of 2
(2,528 Views)