LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programme execution

hi, all
 
i have a question about the programme running.
 
if i want to create a button to run the program, not necessary to use the arrow in the menu.
 
how can i result the function by push the button and run the programme.
 
thanks
0 Kudos
Message 1 of 4
(2,826 Views)

Hiiii,

     I dont think that such kind of buttons are available, so the button we can work is to stop the running vi.

Thanks,

Nishant 

0 Kudos
Message 2 of 4
(2,817 Views)
Hi Paperlian,

What you can do is a vi that starts automatically when you launch it and then wait for the button to be pressed to start executing your code.
VI properties >> execution >> Run when opened.

The easiest way to program this, I think is to use an "event structure", see vi enclosed.

Hope this matches your needs 😉


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 3 of 4
(2,811 Views)

Another variation on the previous solution would be to replace the event structure with a 'dummy' loop. Hitting the 'start' button the the front panel would cause this dummy loop to stop, which will then allow your main loop to run due to data dependancy (ensure that you have a wire running from 'dummy' loop output tunnel and into the main loop). I would also recommend placing some timing function inside the dummy loop so that it doesn't hog the CPU too much.

The method of using the Event structure is far better as no polling is carried out with Event driven programming, but the Event structure isn't available in the Base version of LabVIEW, so this is a possible workaround if you're in this situation.

0 Kudos
Message 4 of 4
(2,764 Views)