LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview program interrupt

Now I have a simple VI , in while loop ,wait 5000ms,but when the time is to 3000ms ,i want to  jump out of the loop , how can i program it ?
thank you!  
0 Kudos
Message 1 of 3
(2,733 Views)

Hi YuanZhun,

you can use a Queue for it. Use the "Dequeue Element" function and connect 5000 as timeout. If this block receives no message it waits 5s, but if you want to stop your loop you can send a command to it and the loop will stop earlier.

Another solution is to run the loop with a lesser time, check the condition with each loop and count the iterations.

Hope it helps.
Mike

0 Kudos
Message 2 of 3
(2,729 Views)


YuanZhun wrote:
Now I have a simple VI , in while loop ,wait 5000ms,but when the time is to 3000ms ,i want to  jump out of the loop , how can i program it ?

Well, then only wait 3000ms. 🙂
What happens at 3000ms? Do you want to trigger an premature end of the wait it with some front panel action, e.g. the press of a button? In this case use an event structure with a 5000ms timeout, but add other event cases for your controls. Firing an event for a control will break the timeout and spin the loop.
 
Can you be a bit more specific on what you are trying to do?
0 Kudos
Message 3 of 3
(2,712 Views)