LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can Labwindows CVI read from and write .INI files?

I need to store settings from ring controls and numeric controls in a data file. I would like to use something like an INI file that can be set each time a user exits a panel or function. That way the program can read the setting data and set the panel back up the same way it was the last time the program was used.
I currently use .dat files and just store arrays in them. Is there a better (quicker) way?
0 Kudos
Message 1 of 5
(4,312 Views)
Inside the toolslib\toolbox directory you will find the inifile.fp instrument driver that can read/write .INI files.
You can look at it, but I'm not sure this is the solution you want, since this instrument force you to an item-by-item coding, that is: the coding phase is boring and tedious, but you produce regular .INI files.
I'm not sure that this way your program will be faster: in discarding the IniText object the instruments takes a lot of time in freeing memory.
Hope this helps
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 5
(4,312 Views)
You can try to use the fonction nammed "SavePanelState". I think its better than the ini files for what you want to do.
Message 3 of 5
(4,312 Views)
Thanks a million! I had no idea that this function existed. Saves tons of coding and therefore time.
0 Kudos
Message 4 of 5
(4,312 Views)
In my experience, the INI-file editor provided is difficult and time-consuming to use. However, a little utility "wintools.fp" was posted on this site, which writes to the registry quickly and painlessly. Wintools was incorporated into the 'Programmers Toolbox'in V5.5. Look in cvi/toolslib/toolbox/toolbox.fp.

In fact, wintools doesn't seem to be among the rapidly dwindling resources on this site, so I've zipped my versionup and attached it.

Don't forget, there's nothing wrong with storing data as files - just look what Explorer does to us all 😉
0 Kudos
Message 5 of 5
(4,312 Views)