LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I manage initialization files

I've been thinking about creating an initialization file for applications I
write so that whatever instrument settings the user chooses, it will save
those settings and next time automatically start up with those same
settings. I started writing for it and it seemed a little more complicated
than I thought it would be. Can anyone point me to information on the
subject?
0 Kudos
Message 1 of 3
(2,767 Views)
I don't think it's that hard.
The basis is an ASCII file containing the settings.
Create vi's that do read setup and write setup from/to the entire setup-file.
The other input/output of these vi's are a cluster containing all relevant parameters you want to keep.
Translate the parameters to strings using the string vi's. Add headers (that you ignore at read-in) as extra info.
When you quit the application just call the write setup vi. At start, call the read setup vi.
This design is easier to do if you keep all your relevant parameters in a "parameter vi", aspecially if you want to read-in a different set-up during running.
0 Kudos
Message 2 of 3
(2,767 Views)
Hi,
There is a set of VIs for working with *.ini files in LV6i. It is locate in "Functios/File IO/Configuration file VIs/...".
Usually *.ini file consists of sections marked with the name inside square [] brackets. Each section includes the set of keys. They look like

[Section 1]
Key1 = 0
Key2 = abc
[Section 2]
Key3 = 1,2,3
Key4 = smth
.....

The set of VIs described above allows you to easily read/write/remove keys and sections.

Hope it helps.

Oleg Chutko.
0 Kudos
Message 3 of 3
(2,767 Views)