LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change a numeric control value from any sub VI

HI!

Is it possible to change the value of a numeric control (or a boolean) in a VI that is not called by the VI where the value should be taken of.

Usually if I want to change a value on the calling VI by a SubVI I pass a reference of that control to the SubVI.

What I want to do somehow is a reference to a VI and from there to a control and change the value of that control. Is that possible? How?
ANDY
0 Kudos
Message 1 of 6
(3,803 Views)
Yes it's possible and you do it like you said - get a reference to the VI. Then you use the method (an Invoke Node) Set Control Value or Set Control Value [Variant]. With both, you have to specify the control name. With the first method, you have to flatten the data. With the second, you just have to wire the value.
Message 2 of 6
(3,797 Views)
One method is to open the vi using vi server
find the control reference using the vi reference
and wire in the value.

here is an example I created.

Champion CLA

Making senseless computers do
intelligent real world things
is NOT easy. SO MAKE IT FUN!
0 Kudos
Message 3 of 6
(3,791 Views)
Thanks for the answers.
I think the picture is from LV 7.x ?
I only have the version without variant in LV 6.1.
Can you post a picture of how it works with the flatten date thing?
ANDY
0 Kudos
Message 4 of 6
(3,778 Views)
Here's how you do it with the Set Contro Value method. The function used is Flatten to String.
Message 5 of 6
(3,765 Views)
Thanks very much.
It works
ANDY
0 Kudos
Message 6 of 6
(3,755 Views)