LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

changing default value of Numeric box permanently

i want to change default value of my numeric control permanently when changed by the user , for example my numeric control is displaying 44.555 when my  user interface starts. As 44.555 is default value for the numeric control but if i change the value to 45.444 then i want the default value to be 45.444 so that when i load my user interface again then numeric control displays 45.444. in short i want to update the default value of my control when loaded.

i have already studied

http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/uiref/cvinumeric_attributes/

http://zone.ni.com/reference/en-XX/help/370051AC-01/cvi/uiref/cvisetctrlattribute/

0 Kudos
Message 1 of 4
(4,247 Views)

So let me provide a link to an answer of Roberto on this issue Smiley Happy I have not tried this approach myself because I prefer using ini files for saving/reading panel settings and values.

0 Kudos
Message 2 of 4
(4,244 Views)

 have read the answer so in short solution not possible as uri is unchangeable in cvi at runtime.

0 Kudos
Message 3 of 4
(4,234 Views)

You could call SavePanelState each time that you change the control's value at runtime and then also call RecallPanelState immediately after loading your .uir. The main problem with this approach is that it's going to affect all the controls in your panel, not just the one control for which you want to change the default value. If that is a problem for you, you could save the control's value yourself to some arbitrary file and then load it and restore it each time you load the panel from the .uir.

 

Luis

0 Kudos
Message 4 of 4
(4,107 Views)