LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update a string value located on the main VI

Hello
I would like, from a subVI, to update a string value located in the main VI (using References). I was trying to find examples on NI web page but it´s impossible to download them (for more than one month : Error, File Not Found), do everyone has got the same problem?
Thanks for your answer
Nicolas
0 Kudos
Message 1 of 7
(3,208 Views)
Have you looked at the examples that ship with LabView?
From any LabView window, goto Help >> Find Examples >> Search. In the box labeled Type a keyword to find: enter control references. There is an example program called Property Nodes.vi which passes a control reference to a sub-VI.
Another way to update a control (or indicator) on a calling VI from a sub-VI is to use a global. You'll need a loop in your calling VI to write the local to the control as often as you want it updated.
0 Kudos
Message 2 of 7
(3,208 Views)
Hi,
this is from LV help file:


Complete the following steps to create a subVI that includes a control reference directly from a Property Node.

1.On the block diagram, right-click the front panel object terminal for which you want a control reference and select Create»Property Node from the shortcut menu to create a Property Node implicitly linked to the object. You can have multiple Property Nodes for multiple front panel objects.

2.Use the Positioning tool to select the new Property Node and select Edit»Create SubVI from menu. LabVIEW automatically creates a control reference to the control on the block diagram of the main VI, creates a subVI that contains a control refnum wired to a Property Node, and wires the control reference on the main VI to the
control refnum input terminal of the new subVI.

Note: Select several Property Nodes at once to create a subVI with multiple control refnums and Property Nodes.

3.Double-click the subVI to open it. Modify the Property Node and other elements of the subVI as you do in any other VI.

4. If you want to change values of control then select "Value" property in Property node.

I've attached the examples.

Good luck.

Oleg Chutko.
0 Kudos
Message 3 of 7
(3,208 Views)
Here's a simple VI with a string control reference. Also, I haven't had any problems downloading any files from NI. Maybe you could attach a link to a specific location that someone could check. There is also a link to report problems on NI.com at the Contact NI web page.
0 Kudos
Message 4 of 7
(3,208 Views)
Thanks to everyone for your answer
That´s exactly what I was looking to realise, but the thing is I´m using a sub VI deep away from the main VI (4 times sub VI, sometimes more), so it´s difficult to use input parameters. The questions is : can I change its value and its properties, whithout using any input parameter, but just knowing the VI name and the name of this control (or Indicator).
Thanks
Nicolas
0 Kudos
Message 5 of 7
(3,208 Views)
If you don't want to change the structure of all subvis then the easiest way is to use global variables.

Good luck.
Oleg Chutko.
0 Kudos
Message 6 of 7
(3,208 Views)
Use VI Server. Open a reference to the main VI and use the Set Control Value Method. You specify the control name and a flatten to String function. Wire the new string to the input and the outputs wire to Type Descriptor and Flattened Data inputs of the method.
0 Kudos
Message 7 of 7
(3,208 Views)