LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Control Value

Hi, all
I'm trying to create general VI that get control values of another VI and save them to XML file. Later i use this file to update control values.
I used "Get All Control Values" for saving to XML file and "Set Control Value" for updating.
The problem is when VI has number of controls with same name.
 
The VI server method "Set Control Value" searches the front panel tabbing order for the name of the object and changes the value of the first object whose name matches the input name. But if front panel has many objects with the same name, you can change value only of first object.
If there is method that let me to change value of any object on FP?
I tried to use references: FP->Controls[], but them changed all time you get VI refnum, so i can't save them to file and to use later.
 
Thanks, Nadav
0 Kudos
Message 1 of 2
(2,912 Views)

The only real method would probably be to give each of them a different name and to use the caption to display the text to the user, in the same way you wouldn't give 2 variables in a text based language the same name.

I suggest that you write a VI that goes over all the controls in your VI, hides the labels, displays the captions and renames the duplicate ones.

The other option (which I don't consider to be very good) is to use the tabbing order you mentioned. I assume that the VI I posted earlier in your other thread will also be consistent as long as you don't add or remove any controls, so if you get an array of references, you can use it to get an array of control values, and you can later get the new array of references (which will have the same order) and use it to set the values back. This will only hold as long as you don't change the tabbing order or add controls to the tabs\clusters, which is why I suggest you go with the first method.


___________________
Try to take over the world!
Message 2 of 2
(2,909 Views)