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

Updated Jun 20, 2023

Environment

Software

  • LabVIEW Full
  • LabVIEW Base
  • LabVIEW Professional

This article shows you how to save the default values of the front panel objects to the file so that each user can load their values at the beginning of the test. These methods are useful when the users are running the same VI with their own set of default values.

There are three different methods to save the default values of the controls into file:  

Save to a Configuration File

There is a shipping example that statically saves your front panel objects' value to configuration 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 


Save to a Text File

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.
 

Save Specific Default Control Values only

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.