LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving all variables of a global VI in a INI file

Is it a simple way to save all variables of a global file in a .ini file, without coding each variable one by one?

 

Gabriel

0 Kudos
Message 1 of 4
(3,184 Views)

One would normally ask why you need to use global variables. That aside, did you try a search? This question has been asked MANY times.

 

https://decibel.ni.com/content/docs/DOC-15349

0 Kudos
Message 2 of 4
(3,182 Views)

And just to clarify, to use that example with a global variable, you need to open a reference to the global VI (or use a static VI reference), get its Panel property and get the Controls[] property from that.


___________________
Try to take over the world!
0 Kudos
Message 3 of 4
(3,165 Views)

When wanting to save variables or values into an ini file, I prefer using Labview's Configuration File utilities.  These can be found on the block diagram Functin palette under File I/O - Config File VIs. 

 

You can group your variables into sections and then further into keys for each section.  Very similar to the Windows Registry.  The utilities allow you to group common items together and is great for organization.  For instance, you can have a section called "Input" and under this you can have keys called "Channel 1" and "Channel 2" and so on. 

 

Look at the help section for Config FIle VIs.  There are also some examples on how to use these.  The utilities are ready to use, no need to write your own utilities. 

 

Also, the file created can be read with a text editor like Notepad.  Very convenient.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 4
(3,136 Views)