09-25-2009 01:31 PM
09-25-2009 02:32 PM
That's because the value of the switch is read immediately upon starting the loop. So you have to wait almost 60 seconds for that loop iteration to end. Then the loop will begin its next iteration at which time the now False state of the button will be read (logic seems kind of backwards). But then you have to wait another 60 seconds because that iteraiton of the loop needs to complete.
What you need to do is put a while loop inside of there that continually reads the state of the Kill button with a small wait statement to keep from eating up CPU cycles. Use the Elapsed Time express VI. Now have that inner while loop stop when either the Elapsed Time Timer goes true, OR the Kill button goes to its False Kill state. Now the Kill button will be read very frequently and will seem to respond immediately.
09-25-2009 02:36 PM
The wait time won't prematurely expire on its own. You need to code up a time-monitoring loop with maybe a 10ms internal wait time (depending on your timing requirements). Something like the following without the reference stuff (that got thrown in because of the way the new code snippet feature works, just replace it with a local variable pointed to the kill switch).