ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

【Help!Help!】How to stop the While loop at once?

Solved!
Go to solution
Now I have a While loop,but delay 60 seconds time in it,how to stop or exit the While loop at once when I click the Stop button? the picture bellow.
0 Kudos
Message 1 of 4
(2,645 Views)
the picture can't upload...
0 Kudos
Message 2 of 4
(2,641 Views)
Solution
Accepted by topic author 科学男孩

If there is a 60second wait, it will not react to the button until the next time the button is read. This can take 0..60 seconds.

 

Instead, us an event structure with a 60 second timeout containing your main code and also add an event case for "stop: value changed".

Now the timeout can be broken at any time.

 

See how far you get... 😉

0 Kudos
Message 3 of 4
(2,632 Views)
3Q!You so give power!
0 Kudos
Message 4 of 4
(2,628 Views)