LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically "Make Current Values Default" of a Global Variable

I wish to be able to modify and save programmatically some values stored on a global variable.
When trying to do that by using "Make Current Values Default" with VI Server, I got an 1073 "Invoke Node in Store_config.vi". The vi works fine when used with a vi and not a global variable or when the global variable is not called in the executing vi's. What could I do? Any ideas?
One possibility would be to store & retrieve the config values of the global variable on a file, but when there are many variables it is annoying to define the reading and saving vi's.

Thanks for your help.


PS. I use Labview 7.0 under win 2k
0 Kudos
Message 1 of 8
(6,777 Views)
The problem with the "Make Current Values Default" is that it cannot be used on a VI or Global that is currently running or in use. Using that method requires a re-compile, and that cannot be done while the VI is running.

Reading and writing from a file is going to be your best option. Take a look at the Openg.org toolkit. Part of this package is a set of VIs that use Variants to read an entire front panel and write the values to a file. It can also read from the file and write back to the panel. You can get the download here. This makes it very easy to save panel setups without having to define everything each time.

You may want
to do some reading on the site on how to install and use the toolkits. There is also a forum to ask questions about the various tools available.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 8
(6,777 Views)

Would someone please take a look at this?

These vi's are used to close a Main vi that has finished updating the application's Global.vi by a shared to global variables. Further they attempt to "Make as Default" and Save the global.vi .

I dont need to update the global.vi during runtime as I can simply closeout the Main.vi and update the global.vi. Then I restart the Main and continue to make updates to global.vi.

The problem is that the Main.vi executes normally on first reboot, but will not reopen and execute Save_Global_Defaults.vi afterwards.  Thanks. -jeff

0 Kudos
Message 3 of 8
(6,425 Views)

Would someone please take a look at this?

These vi's are used to close a Main vi that has finished updating the application's Global.vi by a shared to global variables. Further they attempt to "Make as Default" and Save the global.vi .

I dont need to update the global.vi during runtime as I can simply closeout the Main.vi and update the global.vi. Then I restart the Main and continue to make updates to global.vi.

The problem is that the Main.vi executes normally on first reboot, but will not reopen and execute Save_Global_Defaults.vi afterwards.  Thanks. -jeff

0 Kudos
Message 4 of 8
(6,419 Views)
Hi Jeff,

what should we look at? No need to post twice without attachments (or don't use preview as it forgets about attachments...)!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(6,401 Views)
Ok. Thanks for the tip.  Here are the attachments. -jeff
Download All
0 Kudos
Message 6 of 8
(6,371 Views)

This is too complicated, to do a simple thing (and i don't know if it works). This is bad programming.

Use Ed's advice. Just write-read a file.

0 Kudos
Message 7 of 8
(6,358 Views)

I thought about simply writting an ini file, but my goal is to keep all global vars in one place (for user simplicity).

0 Kudos
Message 8 of 8
(6,338 Views)