LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save values on front panel without goes to edit mode

When we are editing front panel values ( like normal numeric control ), they are cleared and goes to default values when vi is closed. so i want to save front panel values without go to edit mode ( like data operations > make current value default ).

is there any method for saving previous values after close that vi

 

My Purpose - we are using program for data acquisition in instruments so we are calibrating instruments and changes that scaling values and sometimes, after applying that calibration values it cleared when vi is closing, sometimes some other users using this program and the '' data operations > make current value default '' and changing through edit mode isn't works for us. Any solutions guys ?

 

 

0 Kudos
Message 1 of 5
(575 Views)

Use an INI file to store the value on cleanup. Read the INI file to retrieve the value when VI starts running.

-------------------------------------------------------
Applications Engineer | TME Systems
Message 2 of 5
(567 Views)

Agree. 

Create a vi that reads/write setup as config.ini file. 

In the beginning of the sw, it reads the ini file and updates the configuration stored on the INI file. 

At any given time when setup changes, store the data on INI file. 

 

RKO
0 Kudos
Message 3 of 5
(546 Views)

As small addon to this topic I would like to recommend to take a look into OpenG Variant Configuration File Library by OpenG, which can be installed via VIPM separately or as part of OpenG Toolkit.

Then, if you need to save everything from Front Panel into INI file, you can use "Read Panel from INI" and "Write Panel to INI" pair and your code can be as simple as

snippet.png

Use carefully (as you can see, the Stop Button also dropped here, which not a problem as long as you have default behaviour), but can this can save huge amount of time if you need to save many keys. There are also other useful tools in this palette:

Screenshot 2024-03-24 06.55.52.png

 

Message 4 of 5
(484 Views)

@Nasi13 wrote:

When we are editing front panel values ( like normal numeric control ), they are cleared and goes to default values when vi is closed. so i want to save front panel values without go to edit mode ( like data operations > make current value default ).

is there any method for saving previous values after close that vi


Changing the default values of controls IS an editing operation, because it requires changes to the VI followed by saving the changed VI to disk. This will also never scale to e.g. a built standalone application because the runtime engine does not even have an editor.

 

As other have already said, you need to save your configurations to an external file and there are plenty of good tools for that. In addition, you also need to add some protection and exception handling (rewrite the file with reasonable default if the file is missing, ability to reset if a random user saves with completely crazy values, allow selection of different configuration files based on the current task and have a second configurations file that defines what scenario was used last, maybe even place the configuration file in the user hierarchy so each user has it's own default values, etc. etc.)

0 Kudos
Message 5 of 5
(473 Views)