LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Global Data

Hi all,
 
I'd like to know if there's some way to save the content of a Global VI (actually I'm using a Global VI to store data needed by some VI to work) into a file (like a config file or whatever) at run time.
 
The Global VI contains a lot of Arrays and Clusters, so it's not a good idea to use Write Key VI to write a config file (.ini).
 
I've also thought to use an Invoke Node calling the Method "Make Current Values Default" on the Global VI, and then copy this file, modified in such a way, into a new location, but it didn't work (I get an error with error code 1000).
 
Thanks for your help,
Dav
 
 
0 Kudos
Message 1 of 2
(2,438 Views)
You got the error because the Global VI was still in memory someplace. The basic answer to your question is that there are ways of settings. To begin with you don't want to use the standard built-in globals. Use what is popularly called a LV-2 style or functional global--really just a VI you write that stores data temporarily in an uninitialized shift register. Personally I call them cache VIs to help distinguish them.
 
You can write them so that they automatically load themselves from an initialization file or a DATABASE. In additon, they could look for the application exit event to automatically save changes, or save changes only when you tell them too. Because you are writing the logic, you can have it work however you want it to.
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 2
(2,432 Views)