04-25-2014 03:41 AM
Hello,
I have a while loop with a stop function in it. There is also a wait function of 60 seconds to slow down the while loop.
The problem is that when I press stop in the while loop it has to wait to stop because of the timing function. How can I get around this as I would like to press stop and have the while loop immediately end.
The .vi is attached showing while, stop and timer functions.
Solved! Go to Solution.
04-25-2014 03:50 AM
Use an event structure inside the while loop. Wire the timeout to the 'milliseconds to wait between saves' and put everything else inside the timeout event case
Make another event case for the stop button which sends a 'TRUE' to the 'stop if true'.
Clicking the stop will generate the event and stop the vi. If stop not clicked the timeout case will execute every period you specify in 'milliseconds to wait between saves'
Hope this helps
Ken
04-25-2014 04:11 AM - edited 04-25-2014 04:11 AM
Hi Ken,
Thanks for your reply. I think I know what you mean but if you have the time could you show me some example code!
04-25-2014 06:31 AM
Try this to get you going
Ken