08-22-2012 07:09 AM
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
08-22-2012 07:16 AM
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.
08-22-2012 10:38 AM
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.
08-23-2012 03:26 PM
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.