LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I reboot a VI in execution ?

Hi everybody,

My question is very simple : I'd like to reboot a VI in execution (for example, the user clicks on "new" in a menu, or clicks on a "reboot soft" button, and the program is reloaded).
How can I make this ?
Thx for your help
0 Kudos
Message 1 of 5
(2,920 Views)
You can use the Reinitialize All to Default method.
Create an invoke node, change its class to VI and select that method.
I think that if you're loading a VI dynamically this should also work, so you can close it and reopen, but I'm not sure.

___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(2,913 Views)
"Reinitialize All to Default" method works with all VIs, SubVIs or dynamically loaded, even when they are running. If you need to reinitialize an algorithm which uses more than one VI (consists of a VI and subVIs) you have to use that method for each VI. This means you have to walk through the tree of all subVIs. You get a list of the next lower level in hierarchy with the property node "Callees Names".
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 3 of 5
(2,891 Views)
you can use system_exec.vi to excute another small application, the loader. The loader can be written in any language, but if you use labview, then the loader waits for a couple of seconds (wait for the main app completely exits), then use system_exec.vi to excute the main application again. Assume the main application and loader application are executables.

-Joe
0 Kudos
Message 4 of 5
(2,878 Views)
"Reinitialize to defaults" is not the same as "rebooting" (for lack of a better term) a VI. While the controls will get reset, data contained in uninitialized shift registers will remain.

Maybe you can explain to us what you are trying to achieve with this. (e.g.: Free up accumulated memory storage because your arrays grow without bounds?)

Typically, there is no need to restart a VI. Why don't you just place another giant while loop around the all the code in your toplevel VI. Once your main code finishes by ending the main inner loop using the restart button, the outer loop will run everything from the beginning. You can even initialize shift registers to a known state.
0 Kudos
Message 5 of 5
(2,864 Views)