LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to set the current value as default while VI is running?

I have one numeric control in frontpanel. I am dynamically changing the value of that control. Once if i quit the program and if i opened again what ever value i entered before quitting the VI, it should appear as a default value. Is it possible to set the current value as default while VI is running? Note: I don't want use another VI to make this value as default.
0 Kudos
Message 1 of 4
(3,190 Views)
You cannot set a controls default value wihle the VI is running. Doing this requires the VI to be recompiled, and that cannot be done while the VI is running.

The easiest way to do what you want would be to read the controls value as the VI shuts down and write it to a config file. Then when the VI starts up again, read the config file to get the last value and write it to the control.

Check out the 'Config File' VIs in the File IO palette. These are made just for reading and writing to config files.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 4
(3,188 Views)
Thanks Ed"

Here i want to add something.
Rightnow i am doing the same thing what you said in your mail. I agree with your statement.
But i am seeing some properties in property node which talks about make current value default. From this how will i do that?
Is it possible to do with VI server?
0 Kudos
Message 3 of 4
(3,188 Views)
You can use the 'Make Current Values Default' invoke node, but as the name implies (note �Values�), it will set the current values to default for all controls on the front panel. There is no way to use this on just a single control.

There are other problems when using this property. The VI that you want to use it on cannot be running. So you must stop the VI, and then from a different VI, get a reference to the other one and run the 'Make Current Values Default' node.

You also cannot use it in a built executable because it requires the code to be recompiled which cannot be done on an executable.

Your only real choice to operate on a single or just few controls is to use a config file, or if you�re in the development system, r
ight click on the control and set it to default that way.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 4
(3,190 Views)