LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I would like to create a pause for a while loop until a button is pressed again.

I think this should be possible. I would like to create a pause in a program. I am running a VI and capturing data to an Excel spreadsheet, but I don't need to be constantly capturing this data. I have a set process, and when it is done I want it to pause until I hit a button on the front panel to begin collecting again. I believe an event structure might work best for this, but I just can't get it to work. Any help would be appreciated. Running Labview 6.1
0 Kudos
Message 1 of 4
(3,295 Views)
You could just place at the end of application process a while loop which will stop and make the program continue when you hit your button on the front panel.
Another idea i have is to use the "one button dialog box" with a message like "waiting until CONTINUE button is pressed" (and obvioulsly, the button would be named "CONTINUE")
Best regards,
G Liagre
Message 2 of 4
(3,295 Views)
Thanks, both of these will work and good ideas. I just needed a new perspective. Thinking too hard about it. Thanks again!
0 Kudos
Message 3 of 4
(3,295 Views)
The event structure is ideal for this application. While the workarounds that G Liagre gave you will work, all you really need to do is put everything inside your while loop that is related to the data capture (i.e.,everything except error handling and loop exit controls) inside the event structure to activate with the proper action of the selected button. Be sure that you include a reasonable timeout that will allow the program to continue so that you may make a proper exit from the while loop (no infinite loops). There are good examples of the use of an event structure in the shipping examples. If you're having specific problems with the event structure perhaps you could give a more detailed description of what the problem is and we could help you.
0 Kudos
Message 4 of 4
(3,295 Views)