LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easy way to save the values of all controls in a VI?

I have a relatively large number of controls (~250) in a VI that is being used as a front end to 40 channels of AI. These controls are used to set ranges, coupling, names, #scans, scan rate, etc. for each of the channels. I would like to be able to compile this VI as a stand-alone application and be able to read and save various control settings other than the defaults.

I have found some references in the Discussion Forum regarding some techniques for accomplishing this but they all involve wiring up local variables for each of the controls.

Is there any function in Labview that stores the values of ALL controls to a single file with a single function call?

Also, what is the benefit to using a
configuration file and reading/writing configuration keys? My approach in the past has been to simply create read locals for all of the controls, collect them into a cluster and write the cluster to a binary file using the regular file I/O functions. To recall the setup, I then read the binary file and unbundle the cluster into write locals for the various controls.

The problem that I'm having now is that with the huge number of read/write locals, I'm getting some strange file i/o behavior in the VI.

Thanks,

RGA
0 Kudos
Message 1 of 4
(3,762 Views)
Look here in OpenG Project:

OpenG Toolkit
http://www.openg.org/projects/project.cgi?ID=37

Especially here:
Read Panel from INI.vi and Write Panel to INI.vi
http://opengtoolkit.sourceforge.net/variantconfig/index.html

Hope it help...
0 Kudos
Message 2 of 4
(3,762 Views)
Hi,
if you want to save such a large number of controls values with little programming is to use the method Get All Controls Values of the vi server class.

I attach a basic example that gets controls values and save them in a support binary file.

When you run the vi the saved values are read and controls are set.

You can use this principle to handle different configuration files.

This method has the advantage to save values in binary format, thus the saved file can not be opened and modified by simple a text editor.

I hope this was helpful,

Alberto
Message 3 of 4
(3,762 Views)
This is what I was looking for. Thanks for the great example!!

KG
Boeing
0 Kudos
Message 4 of 4
(3,762 Views)