LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to programmatically change the default values in ring indicator?

When my vi is loaded, I would like the ring controls to reflect the values last set by the operator. Is there a way to do this?
 
Thanks
John 
0 Kudos
Message 1 of 6
(4,765 Views)
You can store the state of some or all of your controls in a VI into a configuration file when you programmatically stop the VI.  When you run the VI again, you can have it read the configuration file and restore the state of the controls to what was last used.  I would peruse the examples to figure out how they work.
 
>>Functions>>File I/O>>Configuration File VIs
0 Kudos
Message 2 of 6
(4,750 Views)
John,

To save and retrieve the user entered values I think you will need to save the information to a configuration file and then read that file and restore the values when the VI is run again. The Strings and Values [] property returns or writes an array of clusters of strings and numerical values from/to the ring control.

Lynn
0 Kudos
Message 3 of 6
(4,748 Views)

O.K. Thanks for the feedback. I was hoping I could create a property node and just write a new value to the default property.

John

0 Kudos
Message 4 of 6
(4,732 Views)
Hi John,

Well, it would be nice if a VI could save itself, but unfortunately, that's a limitation in LabVIEW since you can only programmatically save a VI that is not running. However, using VI Server you can get around this limitation by using a "Launcher" VI that makes the current values default and then saves the VI.  Here's an example of such a caller:



Notice that it is not possible to only make certain values default while keeping others - you can only choose to make ALL values default using this method.

Of course, you can also use the method discussed earlier, to save your values in a file. I have created a small VI called "GetSetCtrls.vi" that you can drop different places in your VI to load and save control/indicator values. Here's the diagram of "GetSetCtrls.vi":



Currently "GetSetCtrls.vi" handles ALL existing controls and indicators, so if you only want to control a few, please make the necessary changes to the code yourself, thanks.

Have Fun!

Message Edited by Philip C. on 09-01-2005 01:05 AM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Download All
Message 5 of 6
(4,707 Views)
Thanks Phillip! It looks like your vi will do nwhat I need.
 
John
0 Kudos
Message 6 of 6
(4,685 Views)