Save and Load Variables from File in LabVIEW

Updated Aug 17, 2023

Reported In

Software

  • LabVIEW

Issue Details

I would like my code to allow the user to be able to enter ten variables and save them to a file, so that they may recall/load them back into the application the next time it runs.
I am building my VI's into executables, so the method needs to work as part of an exe.

Solution

One way in which this can be achieved is by using .ini files. 
The code below shows how to write to and read from INI files. 
 

Additional Information

For information about the structure of INI files and how they store information (sections, keys and values), see the tutorial: Implementing Configuration Files for Computer Based Data Acquisition Systems.

The above code can be integrated into your application with 2 button, 1 for reading data and 1 for writing data. Use a Case structure or Event structure to trigger the code when the button is selected.

There are many possible ways to read and/or write to files in LabVIEW. INI files is just 1 solution. Many different file formats can be used.