LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop a while loop which is outside another while loop?

I have a state machine which is inside a big while loop cover the whole VI, that is 2 while loops outside a case structure.  After start running the program, it will initialize some GPIB communication, then the user will press a start button to run a test in the state machine.  After the test is done, the user can either press the start button again to run the test or exit the program.  This program is called by another program.  I tried to wire the conditional terminal to a stop button inside any loop, it does not terminate the outside while loop.  Is there any way besides using Stop/Abort, because I don't want to abort my other program. 
 
Thank you!
0 Kudos
Message 1 of 6
(4,452 Views)
Hi J2005,
 
Can you post your code or a picture of it?  I've got an idea of what you're trying to do, but i need to see it 🙂

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 2 of 6
(4,433 Views)
0 Kudos
Message 3 of 6
(4,415 Views)
Here is an example on how to stop an outer loop with a button in an inner loop.  There are two buttons.  The continue button will stop the inner loop but not the outer loop, so that the inner loop repeats.  The stop button stops the inner loop, then the outer loop.
- tbob

Inventor of the WORM Global
Message 4 of 6
(4,406 Views)
Your stop button needs to be in the inner loop. Now wire it again to the termination terminal of the outer loop, across the inner loop boundary.. In addition, insert a logical OR in the boolean wire leading to the termination terminal of the inner loop and also wire it to the stop button.
 
(Get rid of the STOP node and the "Stop?(T)" button).
Message 5 of 6
(4,399 Views)

Thank you both very much!  It works now!

 

0 Kudos
Message 6 of 6
(4,381 Views)