Read and Write Main VI Control/Indicator Value from a SubVI

Updated Jan 28, 2026

Environment

Software

  • LabVIEW

Programming Language

  • LabVIEW G

In this article, we will guide you on how to update, or read and write the Control and Indicator value in the SubVI via your MainVI. This allows you to update your top-level VI Controls and Indicators with the "live" status of the SubVI Control and Indicator values while the SubVI is executing.

In LabVIEW, each Control or Indicator on the Front Panel has its own reference that can be passed to any part of the project and be used to access any property, including the value. The following steps explain how to create a reference for Control or Indicator, pass it to a SubVI, and read/write the Control/Indicator in the subVI.

 

Note: if you wish to update the value of an NI-IMAQ or NI-IMAQdx Image Control, the process is slightly different. Refer to Updating an Main VI Image Display From a SubVI in LabVIEW for instructions.
 

In the Main VI

  1. Open the Block Diagram and right-click the Control/Indicator that you want to update via the SubVI.
  2. Click Create >> Reference to create the reference node of this Control/Indicator, then drop it on the Block Diagram.

In the Sub-VI

  1. Open the Front Panel and add a Control Refnum. There are several ways to do that:
    1. Copy a constant of this control type from the main VI and paste it onto the SubVI's Front Panel:
      1. Right-click the reference node you created in main VI, and select Create >> Constant.
      2. Select the constant node and press <Ctrl+X> to cut it.
      3. Open the SubVI's Front Panel and press <Ctrl+V>. The constant node will be pasted and automatically changed to a Control of the same type.
    2. Create a Control Refnum directly to the SubVI's Front Panel:
      1. Right-click the SubVI's Front Panel, and select Controls Palette >> Modern >> Refnum >> Control Refnum.
      2. Select the appropriate VI Server Class based on the type of Control in the main VI. Right-click the Control Refnum and select Select VI Server Class >> Generic >> GObject >> Control.
  2. In the SubVI's Block Diagram (see Figure 1), create an implicit Property Node for the refnum. It can be found at Functions Palette >> Programming >> Application Control >> Property Node.
  3. Wire the Control Refnum to the reference input of the implicit Property Node.
  4. Click Property in the Property Node to open a drop-down list and select Value as the input parameter.
  5. Right-click the parameter and select Change to Write to allow for inputs into the parameter.
  6. Wire the varying data to the Value input of the implicit Property Node (see Figure 1 where the varying data is Number of Iterations for the While Loop.)

 

Figure 1: SubVI DigNum Refnum Passed to a Property Node 
 

  1. Link the Control Refnum to a terminal on the Connector Pane of the SubVI, so that the reference can be passed from the main VI to the SubVI. You should have one input terminal for the Control Refnum and one output terminal for the Control/Indicator you want to monitor in the Connector Pane.

In the Main VI

  1. Open the Block Diagram (see Figure 2) and wire the reference node to the newly created terminal of the SubVI.

 


Figure 2: Numeric Control Reference Passed to the SubVI

Additional Information

When running the main VI, any changes made to the Control in SubVI will be updated in the main VI as well because they are linked through the Control reference. 

The Property Node used can be utilized to access not only the value, but also a variety of other Control/Indicator properties. Refer to LabVIEW Help for more information.