06-14-2013 04:35 PM
Hello
I have created a test tool control program. This program controls pressure regulators and pressure transducers as well as a bunch of other stuff. I have the program written and it works great. I was able to create an exe and deploy it successfully. Now I realize that the calibration fields in my program need to be updated periodically by the end user due to stuff on the hardware end.
The values in the calibration controls are editable, however when the program is closed and reopened the value returns to default. Is there a way to update the values in a numeric control and have that saved as the new default once the VI has been converted to an exe? The calibrations only need to be updated every three months but I know that the computer system will be shut down at least once a week. When the program is restarted I would like the last values in those fields to be retained without having to create a new exe. Is there another option besides a read from file?
Thanks,
Ross
Solved! Go to Solution.
06-14-2013 05:22 PM
No, you will need to change the code to support saving/loading values from a file or some other external source.
06-14-2013 05:27 PM
So there is no way to save or update a value in a numeric control once the vi has been converted to an exe? Dang, I was really hoping there was some way to access the "Make Current Value Default" function.
Thanks,
Ross
06-14-2013 05:30 PM
No, there isn't. the "Make Current Value Default" is a function of the development environment. If you want you program to be able to save/load values you need to implement that in the program itself.
06-14-2013 05:33 PM
The only way I know how to do this is to have my calibration routine create a spreadsheet file and then have my main program read the spreadsheet file each time the program is started. Is there an easier or better way?
06-14-2013 05:57 PM
That works fine. For configuration stuff I generally use INI file formats. If people will edit the files directly INI tend to work a little easier since they are basic key/value pairs. If you do use a spreadsheet make sure to write the column headers out so it is easy to see what each column represents.
06-14-2013 06:08 PM
Last question here.
Can you point me to a tutorial or discussion on how to create and read from an INI file? I am used to creating and reading regular spreadsheet files but I need to learn about INI file formats.
Thanks again,
~Ross
06-14-2013 06:14 PM
Go to the File I/O palette and drop one of the config file VI's onto the block diagram. Open context help, go to detailed help.
Then open the example it is linked to.
06-15-2013 01:19 PM
Note that it's also relatively easy to write code which won't require you do this manually for every single control. OpenG has a VI which does this for all the controls on the panel, but you can also use something like this to do this for specific controls (or for all the controls, if you get the panel's Controls[] property).
06-17-2013 10:09 AM
@tst wrote:
Note that it's also relatively easy to write code which won't require you do this manually for every single control. OpenG has a VI which does this for all the controls on the panel, but you can also use something like this to do this for specific controls (or for all the controls, if you get the panel's Controls[] property).
The OpenG is handy but if a human needs to edit the file it is not the most human friendly.