LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you build a *.exe in application builder so the user of the .exe can 'save current values as default'?

I'm creating .exe's from LABView code via application builder for a group of people, but they all want different default values in their controls, and they want to change them periodically.  For some reason I'm having difficulty getting the built application to give them this as a pulldown menu option.  How do I do this without having to (1) build a different .exe for each person or (2) program-in some file i/o that saves the programs current values on the user's computer.
 
Erik
0 Kudos
Message 1 of 5
(2,872 Views)
This question gets asked all of the time and the answer is you can't use the Make Current Values Default with the run-time engine. The help for the method says it's not available in the run-time engine. Using it would require modification to the exe and that's simply not allowed. You need to program some file i/o. You can save the data in an ini file, as xml, or even in the registry.
Message 2 of 5
(2,867 Views)
In my opinion, the best way to do this is to make use of the Labview config file functions.  In LV7.1.1 they are found in File -> Configuration File VIs.  You can write section headings, key names, and values, similar to registry entries.  The vi's are easy to use.  You can include a button on the front panel to "Save values as default".  When the user presses the button, get all the values you want to save, and write them to a config file.  When restarting the exe, the first thing that you should do in your code is to read the config file and write the values to the controls using property nodes or local variables.  By using config file vi's, you don't have to worry about formatting the data and then searching for specific data to restore.  Just simply supply the section name and the key name.  The first time the exe is run, there might not be a config file existing.  You have to code for that instance.  If the config file doesn't exist, just use normal defaults or define a set of your own.
- tbob

Inventor of the WORM Global
Message 3 of 5
(2,861 Views)

Just to add to tbob's very thorough reply, when using the Read Key.vi, you can specify a default value. It will then use this if the key doesn't exist. So it automatically creates the file and then uses default values that you specify. This makes it even easier, since you don't even have to check for the file and add addititional code.

I make great use of these VIs, they've saved me a lot of time when I want to do exactly what you're doing.

Message 4 of 5
(2,849 Views)
Good to know.  Thanks.  I'll give that a try.
0 Kudos
Message 5 of 5
(2,846 Views)