Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Using VIs as SubVIs

LabVIEW Web UI Builder Help

Edition Date: October 2010

Part Number: 373286A-01

»View Product Info

After you build a VI, you can use it in another VI. A VI called from the block diagram of another VI is called a subVI. You can reuse a subVI in other VIs.

A subVI node corresponds to a subroutine call in text-based programming languages. The node is not the subVI itself, just as a subroutine call statement in a program is not the subroutine itself. A block diagram that contains several identical subVI nodes calls the same subVI several times.

To create a subVI, you must define the subVI settings using the SubVI Settings tab of the ribbon and the icon editor. You display the icon editor by clicking the SubVI Settings button on the View tab of the ribbon. After you configure the subVI settings, you place a VI as a subVI by dragging the VI from the Project pane to the block diagram of the VI from which you want to call the VI.

Editing the VI Icon

Icons are graphical representations of the VIs you create using LabVIEW Web UI Builder. Each VI has an icon, which you can view by clicking the SubVI Settings button on the View tab of the ribbon. You edit the icon by placing items from the Palette pane and editing the items using the Design tab in the ribbon. You also can edit the items using the options in the Properties pane.

Assigning Controls and Indicators to the SubVI

SubVI controls and indicators receive data from and return data to the block diagram of the calling VI. You define the terminals that receive and return data from the calling VI by assigning front panel controls and indicators to specific terminals of the icon. Complete the following steps to assign front panel controls and indicators to the terminals of a subVI.

  1. On the View tab of the ribbon, click the SubVI Settings button. The Web UI Builder displays the subVI icon in the working area.
    Note  The Web UI Builder docks the front panel controls and indicators of the current VI to the left side of the working area.
  2. Click a front panel control or indicator in the docked list. The Web UI Builder displays blue boxes around the input and output terminals of the VI.
  3. Move the mouse over one of the terminals. The Web UI Builder adds a thicker border to the terminal you hover over.
  4. Click inside the box to assign the front panel control or indicator to the terminal.
  5. Repeat steps 2-4 for each control and indicator you want to assign to a terminal. If you need to change the control or indicator assigned to a terminal, drag the control or indicator to a different terminal of the subVI icon.

 

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