LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control presets

Is it possible to save the settings of front panel conrols to a file,
in order to create several 'presets'

An option is to save the vi under different names with different
default values, but is there a more elegant way.

Thanks,

Erwin.
0 Kudos
Message 1 of 4
(3,048 Views)
erwin wrote:Is it possible to save the settings of front panel conrols to a file,in order to create several 'presets'An option is to save the vi under different names with differentdefault values, but is there a more elegant way.Thanks,Erwin.Yeah..it's possible but you have to code it for yourself. For this way you can use the attribute nodes. So you are able to specify what properties should be loaded or saved.I just realized this in my own application by loading and saving the controls data by using an inifile.RegardsHenrik
0 Kudos
Message 2 of 4
(3,048 Views)
Sure. What I did was use the File I/O -> Configuration File VIs to
create a configuration file which contained the current values of
certain parameters. That way, if the system was taken down and then
brought back up, this file was read, and the parameters returned to
their last values.

To do this, use the configuration files to open a configuration file,
and then write the appropriate types into the file. The file consists
of sections and keys, similar to a windows .ini file. The file will
look like this:

[Initialization] <- section

Start = True <- keys
Done = False
Rate = 1000
Filename = myfile

You can group several keys in the same section. At the start of your
VI, you need to read these values out of the file to initialize your
controls
and/or indicators to these values. The VIs to do this are in
the same location, just read instead of write.

Mark

In article <39a16fbe.175475@news.amc.uva.nl>,
e.huigen@student.tudelft.nl (erwin) wrote:
> Is it possible to save the settings of front panel conrols to a file,
> in order to create several 'presets'
>
> An option is to save the vi under different names with different
> default values, but is there a more elegant way.
>
> Thanks,
>
> Erwin.
>


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 3 of 4
(3,048 Views)
Hi Erwin,
One way is to write your own .ini file where you save all appropriate
values and load it on startup of VI.
This way you can have a .ini file for each of "presets".

Regards,
Igor
0 Kudos
Message 4 of 4
(3,048 Views)