LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto update last value as a default value if reopen the VI or EXE

Dear Sir,

 

I want to auto update the default values of controls. That means initially I assigned the default values after that I will change to some other values and closes the VI or EXE and again reopens the VI or EXE, the controls should open with last changed value. Those should not open with initial default values. Kindly let me know the procedure to implement.

 

Thanks & Regards

S Nagaraju

0 Kudos
Message 1 of 5
(4,590 Views)

This is a million times asked question in this forum. Search for the keyword: "configuration file".

http://www.ni.com/tutorial/3478/en/ 

 

So if you run a VI from the Dev environment, you can change the default values easily by right click.

If you use an EXE, there is NO way to change the default values. You must use config files to store and restore for example control values of your application.

0 Kudos
Message 2 of 5
(4,572 Views)

Hello sir,

 

Your telling about configuration file. Shall i use "Make current values default" function in invoke node??

 

Regards,

S Nagaraju

0 Kudos
Message 3 of 5
(4,480 Views)

You should use config file as i said. That invoke node only works in edit mode of a VI. You cannot use it for a running VI or for an EXE.

0 Kudos
Message 4 of 5
(4,476 Views)
Blokk is right about how often this has been discussed. You can't use the invoke node you are talking about because saving a default value changes the code -- and you can't change the code of a VI that is running, or after it has been compiled into an application.

What you can do is save the desired default value in a text file (like the app's INI file) then when the VI starts, read the file and set the control to that value using the Value or Value(Sgnl) property.

Here is something I wrote that goes into more detail.

http://www.notatamelion.com/2015/06/22/helping-a-window-to-remember/

It talks about how a window can save a new default position (another value you can't change in an executable) but the principles are the same. With this same basic technique you can let your GUI remember fonts, default values, positions, user selections -- you name it.

And absolutely check-out the search that Blokk suggested. This is a technique you will want to learn and use -- a lot...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 5
(4,439 Views)