08-15-2005 08:18 PM
08-15-2005 09:56 PM
There are a bunch of different ways of accomplishing this. The exact method would depend on the structure of the rest of your code. What exactly is it that you are trying to do?
08-15-2005 10:12 PM
08-15-2005 10:25 PM
08-15-2005 10:40 PM
So I can be sure I understand your requirement:
Operator presses button to start test.
At the end of the test the code "pauses" while some further investigation happens.
The start button is presses again to continue execution.
It sounds like all you really need is an event driven interface. Say you have a button called "Start Test". Create a value-change event for the button that includes your test code. Each time you press the button, the code will run the test and then go back to waiting for another event (button press).
If the button has to do something different when it "resumes", combine this basic structure with some simple state-machine techniques, and the code can cycle through a series of process steps each time you press the button. If you do this however, be sure to change the text in the button from "Start" to something like "Next", or "Continue" to keep the operator posted as to what's going on.
Mike...
08-16-2005 06:27 AM
08-16-2005 06:51 AM
08-16-2005 06:54 AM
08-16-2005 08:04 AM
It's not the best method (this is quick and dirty), but you can put a small while loop inside your main execution loop. Inside this new small while loop is a short wait (say 250 mS), and the pause button. The button is wired to the while loop test condition. So when execution enters the while loop and pause is true it is stuck there until the pause button is false. If the pause button is false, it enters and exits the loop in one itteration.
Why it's bad:
1) execution only pauses at this point of execution, not anywhere (not really a bad thing)
2) it's pretty yucky
3) your code waits the delay value even if it's not paused.
Why it's good:
1) you can add a pause to any looping VI in less than 30 seconds. I'm guilty of using this a lot during testing and such.
Sheldon
08-16-2005 11:02 AM