Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Controlling Front Panel Objects Programmatically from a SubVI

LabVIEW 8.2 Help
August 2006

NI Part Number:
371361B-01

»View Product Info

Complete the following steps to pass a control reference to a subVI and use it to modify properties or methods of the referenced control or indicator.

  1. On the front panel of the main VI, right-click the control or indicator to which you want to create a reference and select Create»Reference from the shortcut menu. LabVIEW attaches a strictly typed control reference to the mouse cursor. Drop the reference on the block diagram.

    You also can create a control reference by selecting a control refnum on the Controls palette, placing it on the front panel of the subVI, and placing an object of the same type as the referenced object on the control refnum shell on the front panel. This creates a non-strictly typed control reference.
  2. Open the subVI, or create a new VI, to which you are passing the control reference. From the block diagram of the main VI, drag the control reference to the front panel of the subVI to create a control refnum control for the control reference on the subVI front panel and a corresponding control reference terminal on the subVI block diagram.
Note  If you drag the control reference to the block diagram, you only copy the control and control reference rather than create a control refnum control.
  1. Complete the following steps to modify properties or methods of the front panel object associated with the control reference by creating a Property Node or Invoke Node.
    1. Right-click the control reference on the block diagram of the VI.
    2. Select Create»Property for (type name) or Create»Method for (type name) and select a property or method from the shortcut menus.
    3. Click to place the node on the block diagram of the subVI.
    4. Wire the control reference to the reference terminal of the Property Node or Invoke Node. The Property Node or Invoke Node references the control in the main VI.
    You also can select a Property Node or Invoke Node on the Functions palette and place it on the block diagram. Right-click the node and select a property or method from the Properties or Methods shortcut menus.
  2. Set up the terminals on the connector pane of the subVI, including the control reference.
  3. On the main VI, add the subVI to the block diagram and wire the control reference to the control reference terminal of the subVI.

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit