LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I stop a while loop

In the program in attachment I want that when I stop loop 1, sequence 1 or loop 2 also stop. Do you know what I should do? Thanks
0 Kudos
Message 1 of 18
(4,772 Views)

You probably want to write 'TRUE' to a 'Value' property node of the STOP button in loop2 from loop1. To do that you will need to change this STOP button's mechanical action from 'LATCH' to any of the 'SWITCH' options.

Please let me know wether it helps, or whether you need an example

Message 2 of 18
(4,765 Views)
Hi Aurelia,

I modified a bit your VI and added a few comments, to explain how it works.
If you need further help, fell free !


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 3 of 18
(4,752 Views)
Here is a way to do it with just one stop button.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 18
(4,736 Views)
You cannot stop the sequence, it must complete on its own. (One of the reasons sequencees should be used sparingly. They are rearely needed)
 
You can use a single stop button and use a local variable of it in the second loop. Another nice method is the use of event structures. You can capture the stop event on all other loops as shown in the attached example (LabVIEW 7.0).
0 Kudos
Message 5 of 18
(4,735 Views)
Thank you very much. Could you please save the vi in the version 7.0. I do not have 7.1. Thanks again
0 Kudos
Message 6 of 18
(4,724 Views)
Thank you very much. Could you please save the vi in the version 7.0. I do not have 7.1. Thanks again
0 Kudos
Message 7 of 18
(4,724 Views)
My example is in Version 7.0 🙂
Message 8 of 18
(4,721 Views)
Thank you very much. I made some changes to loop MOD. In loop 2 there is a continue if true linked to a true / false. I need loop 2 to stop when I stop loop1. However, I have a message error for event structure and event data node. Do you know what I did wrong? Thanks again
0 Kudos
Message 9 of 18
(4,715 Views)
I forgot to attach the vi
0 Kudos
Message 10 of 18
(4,623 Views)