How to Save, Overwrite, and Read Front Panel Objects' Default Value to a File

Updated Mar 21, 2018

Reported In

Software

  • LabVIEW Full
  • LabVIEW Base
  • LabVIEW Professional

Issue Details

I have a VI which is run by many users. Each user has his/her own set of default values. I need a way to save the default values of front panel objects to file so that each user can load their particular values at the beginning of a test. Is this possible?

Solution

You can create a configuration settings file by statically or dynamically saving your front panel object’s value to a file with one of three methods:
 
1. There is a shipping example that statically saves your front panel objects' value to file. The shipping example can be found here:
 
  1. Select Help»Find Examples… from the pull down menu.
  2. Select Fundamentals»File Input and Output
  3. If you are using LabVIEW 2013 and later, select Configuration (INI) and open the Configuration (INI) File.lvproj project.
  4. Open the Write Configuration Settings File.vi and Read Configuration Settings File.vi 

2. All default values can also be saved by writing them to a .text or .lvm file if you choose not to use the Configuration VIs above. The example program How to Save and Read Control Values Programatically shows how you can use the Read from Measurement File and Write from Measurement File VIs to save the values of the controls. The values of the controls are merged together and saved to a specified file path. You can then choose to read from that file when your VI opens.

3. Specific default control values can also be saved instead of all control values like in method 2. To save individual front panel values to a file, an Invoke Node with a string constant containing the Front Panel control name can be used. Refer to the example below.

WAS THIS ARTICLE HELPFUL?

Not Helpful