LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reinitialize all to default from within VI

Hi,

I would like to be able to select the "Reinitialize all to default" menu item from the "Operate" menu from within the vi. I am working on a vi that checks over a line of data and indicates if the data is good or bad through the used of LEDs. The program is in a While loop which pauses the program for 15 minutes before it runs again. What I would like to be able to do is have the vi select that menu item about 30 seconds before the program is set to run to clear the values in the text indicators and turn off all the LEDs. Is there any way to do this.

Tim
0 Kudos
Message 1 of 9
(4,068 Views)
Tim,

It should be possible using a reference to the VI and an invoke node.

If I recall correctly it had some quirky behavior.  I believe in earlier versions, it was not possible to invoke the reinit to default method in executables.  The documentation in LV7.1 says that the method is valid in executables at that revision level.

Good luck,

Joe Z.
0 Kudos
Message 2 of 9
(4,060 Views)
Once you set up the invoke method, you do not need to keep the reference wired, you can just use the method.  Under LabVIEW 7.1 (have not tried in 8), the executable builder will not automatically include the front panel, so make sure that the panel gets loaded or it will error....ie using it in a subVI.  Also, if you are passing in data on front panel controls, it will reset those, so make sure you 'read' the data out before you initialize.  It is easy from there to include it as a menu selection, since that is what it sounded like you wanted to do anyway.
Good Luck

Paul
0 Kudos
Message 3 of 9
(4,052 Views)
And if you want to skip the invoke node, just create a local variable for each of the indicators and write to that. If there's not that many, that might be the simplest method.
0 Kudos
Message 4 of 9
(4,047 Views)
Hi again,

I believe that the invoke node method will work for me but I am still having issue with the timing. Any idea on how I may be able to get the invoke node to operate at a set time. Appreciate any help on this.

Tim
0 Kudos
Message 5 of 9
(4,039 Views)
Syncronize it in your diagram using the error cluster in and out to 'fire' it where you want.

Paul
0 Kudos
Message 6 of 9
(4,032 Views)
Hi again,

I not sure I follow how to do your timing suggestion. Can you show me an example.

Tim
0 Kudos
Message 7 of 9
(4,019 Views)
If your while loop is calculating how long to wait before running, then you should be able to use that value to determine when to run the re-init. If all you have is a Wait (ms) statement or Time Delay function, replace it with an Elapsed Time function. It outputs a time has elapsed Boolean that you can use to start the main again and an Elapsed Time output that you can use to do something else.
0 Kudos
Message 8 of 9
(4,014 Views)
Thanks for the help guys. Although I was not able to get it to work with any of the suggestions, it did help me work through the problem. I ended up using a flat sequence to seperate the main block of programming from the invoke node which reset everything. By splitting my total waiting time between the two frames, I was able to get the first part to execute, wait, and then the invoke node to execute and then wait again till the final waiting time had elapsed. Once again, thanks for the help.

Tim
0 Kudos
Message 9 of 9
(4,003 Views)