LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing default values in .exe

Solved!
Go to solution

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

 

 

0 Kudos
Message 1 of 12
(4,397 Views)

No, you will need to change the code to support saving/loading values from a file or some other external source.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 12
(4,386 Views)

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

0 Kudos
Message 3 of 12
(4,383 Views)
Solution
Accepted by topic author RossM

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 12
(4,380 Views)

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?

0 Kudos
Message 5 of 12
(4,377 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 12
(4,365 Views)

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

0 Kudos
Message 7 of 12
(4,353 Views)

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.

0 Kudos
Message 8 of 12
(4,350 Views)

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).


___________________
Try to take over the world!
0 Kudos
Message 9 of 12
(4,313 Views)

@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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 10 of 12
(4,279 Views)