LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving variables

I want to save variables in a executable VI, so the next time the VI is loaded they are present.
I want to use this to specify some configurations.
0 Kudos
Message 1 of 11
(4,371 Views)
I think the best way to do this is with .ini files. You can create a different one for each configuration you want to save. Read one back and set a control using a local variable or property node. The functions for this on the File I/O>configuration file VIs palette. Also, OpenG has some great tools for making reading and writing ini files easier.
Message 2 of 11
(4,372 Views)
Thanks,
i'm going to try this, i've never done this before so it can take some time.
0 Kudos
Message 3 of 11
(4,369 Views)
Perfect,it works....

thanks again.
0 Kudos
Message 4 of 11
(4,370 Views)
There's a way to load the variables from .ini automatically when I open the VI?
0 Kudos
Message 5 of 11
(4,341 Views)
I'd suggest using the nive XML functions. In my experience they're more flexible than using the INI functions (even with the OpenG extensions). It's very easy to save any arbitrary data structure using the XML functins (and it's easier if you want to change this data structer later on).

Carsten
Message 6 of 11
(4,332 Views)


@cs42 wrote:
I'd suggest using the nive XML functions. In my experience they're more flexible than using the INI functions (even with the OpenG extensions). It's very easy to save any arbitrary data structure using the XML functins (and it's easier if you want to change this data structer later on).

Carsten



Could you give me a little VI for example? Thanks.
0 Kudos
Message 7 of 11
(4,323 Views)
OK, here you have. It's just a crude example... If you want to save/load the data of a complete front panel, there's a better solution from OpenG based on the INI functionality. But I often find it more satisfactory to save an arbitrary data structure, because this _may_ not change as often, while the GUI may get some adjustments here and there.

I hope this helps a bit,
Carsten
0 Kudos
Message 8 of 11
(4,317 Views)
Ooops, the VI wasn't attached... Maybe the forum did forget about it, becaus I did a "Preview Post"?

So, next try:
0 Kudos
Message 9 of 11
(4,315 Views)
Casten,

I loved to use the xml way to store configuration data in the past. However with LV6.1 I run into problems that the same .exe running on one (W2k)PC could not read the xml file created by another (W2k)PC.

Anybody seen that too?
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 10 of 11
(4,285 Views)