LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you use the "run when open" function?

I have finished my VI. I would like to the VI to run as soon as I open by simply cliking a "start button" instead of the arrow on the toolbar.  Then, when the program stop, I want it to go back to where I started (wait until I pushe the start button again). 
How could I do that?  Should I use a while AND a case statement? Any Ideas?
 
Thank you for your time,
Noel
0 Kudos
Message 1 of 6
(2,902 Views)
No code required. Just go to "VI properties...execution" and select "run when opened".
 
You cannot create a start button on the front panel, because the VI would need to be running to read its state. Catch 22! Correct would be a big while loop and an idle state for pausing. The VI should always be runing, even if it is not doing much. 😉
0 Kudos
Message 2 of 6
(2,891 Views)

How about I create a while loop and inside I include a case structure and one of the case would be while keeps running until I push the "stop button" which I could rename "start button".Smiley Happy hope it will work

0 Kudos
Message 3 of 6
(2,888 Views)
Nope.. it didnt work.  When it's running, my VI is too slow and I can't even push the button =(
0 Kudos
Message 4 of 6
(2,876 Views)
Here is a simple example using events. It should give you some ideas.
0 Kudos
Message 5 of 6
(2,874 Views)
very nice, thank you!
0 Kudos
Message 6 of 6
(2,869 Views)