From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to take action when vi stops running

Solved!
Go to solution

Sorry for the newbie question but I can't seem to find the answer anywhere. How do I go about taking action such as turning off leds or reseting some variables when my vi stops running. Is there some sort of boolean flag that I can read to determine if the vi is running or a flag that gets set when the vi terminates? Thanks in advance.

0 Kudos
Message 1 of 7
(2,871 Views)

Shouldn't your VI know when it has stopped running? If you have a loop around your VI then you know when it has stopped running - it's when the loop stops.

 

Or, are you using the Abort button on the VI? If you are, STOP right now. The Abort button is not supposed to be used for normal operation.

0 Kudos
Message 2 of 7
(2,869 Views)

Thank you for your reply. I am using the abort button, this is just a simple vi that alternately flashes a couple leds and runs until someone stops it. I need all the leds to go off when the vi is stoped. I understand your point though, I suppose if I add a stop button to terminate the vi I can use that to turn off the leds also. Thanks again!

0 Kudos
Message 3 of 7
(2,854 Views)
Solution
Accepted by topic author eNaught

The state of the LEDs should not be important if the VI is not running (edit mode), it is however probably important that they are off next time you run the VI.

 

To make sure that indicators start out at the desired defaults when the VI starts running, go to "VI properties...Execution" and enable "clear indicators when called".

0 Kudos
Message 4 of 7
(2,844 Views)

That is very helpful, thank you again.

0 Kudos
Message 5 of 7
(2,830 Views)

Funny thing, I was wondering how to solve same problem.

 

 

0 Kudos
Message 6 of 7
(2,578 Views)

If your inicator states are something other than the default, you can use property nodes to set them as well during your initialization phase.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 7 of 7
(2,555 Views)