LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i make is so that the program is running already and then have a start button to execute?

I created a program to control a function generator.  I want it so that the program is already running when i load it up, and then when i actually want it to run press a start button.   I think you can just do a case structure for the start button... but how do i get it so that the program is running when you load it.  so when you press the start button it starts. instead of having to press the start button, then press the run program button. thanks!
0 Kudos
Message 1 of 4
(2,751 Views)
That's easy. Go to VI Properties>Execution and check the Run When Opened box. And, as you said, you can have a case structure inside a while loop or you can use an event structure to actually start the function generator
0 Kudos
Message 2 of 4
(2,748 Views)
A few things about Run When Opened.  Once this is set, if you need to edit the vi, it will start running when you open it.  You then have to abort the vi to edit it.  Some people like to make a backup copy that is not set to run when opened so they can edit it without the hassle of aborting.  In your case, it is probably not worth it since your vi does nothing until the start button is pressed.  But this is for future instances of run when opened.  Also, if you want to edit, I think if you press and hold the shift key (or is it the control key) while opening the vi, it will not run when opened.  Another method to get around the run when opened is to create a blank vi.  In the block diagram, put your vi that is set to run when opened.  Then you can double click on the vi and edit it without having it run when opened.
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 4
(2,741 Views)
ahhh ic, great!
 
thanks for the help guys.
0 Kudos
Message 4 of 4
(2,726 Views)