Summary:
Like many people, I often want to save the values of specific controls to file when I exit a dialog and then load them back again, even if I closed the application.
There are any number of ways of doing this (from using local variable and explicitly saving the values to using VIs like the one OpenG has which saves the entire panel), but this is the one I usually use, mainly because it makes it extremely easy to save the values of specific controls.
Function:
To make it easy to save the values of specific controls to a file and load them back into the controls later.
There are two main VIs - the first accepts a reference to a configuration file and does the actual saving and loading and the second is a wrapper which picks a file automatically, making it extremely simple for the user (see the video for an example).
Steps to execute code:
Open the LLB and run the top level example VI.
- When you press the OK button, all the values will be saved to a file, so that if you run the VI again, the values will now be loaded from the file.
- If you place these VIs in your user.lib folder, you should be able to use them for all your projects. Perhaps I'll make a VIPM package which installs them.
Screenshots:
This video shows an example of how the VI is used, as well as where the automatic file is created and what it looks like. For some reason I can't embed it, so here's the link:
http://www.screencast.com/t/9G90X8jIx
This shows how the wrapper VI is used to very easily save and load:
This shows the BD of the actual VI which saves and loads the values:
VI Snippet:
None.
VI attached below (LabVIEW 2009)