LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop button sets everything to default

Hi everybody,

I have a vi with too many switches (ON/OFF) and I would like for them to be set to the default value (OFF in my case) each time the vi stops by pressing the STOP button.

I tried to use local variables in a case structure after the stop button but I have only one while loop running and it seems that the vi does not have any time to write to the local variables before it stops running. Although the local variable or property node solution would require too many of the variables to be in this case structure.

Is there a way to reinitilize everything to default when the vi stops running?

Thanks in advance...
0 Kudos
Message 1 of 4
(2,774 Views)
Yes, with an "invoke node", see this recent thread.

In your case, you would placen it inside the stop event, or outside the main loop. Ensure that it executes as last step, (either with data dependency or a sequence frame or similar).

If you use events, you can make it even happen if the user closes the VI by clicking on the big X.
0 Kudos
Message 2 of 4
(2,767 Views)
Hi!
You problem can be easily solved in reverse way.
Take a sequence outside the while loop. Sequence should appear before while.
Then 1. take property node of all the ON/OFF controls/ indicators, create method reinitialize all to default. OR
2. Give False constant to all property nodes of all indi/controllers.

This will reinitialize all to default conditions.
Refer attachment.

Kaustubh
INDIA
0 Kudos
Message 3 of 4
(2,746 Views)
Hi,
You will have to make use of the proerty node of the VI and set it to reint to default,it shall help yuo to do what all you have asked for,see the example code attached.
cheers
vicky
0 Kudos
Message 4 of 4
(2,740 Views)