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. To create a subVI, you need to build a connector pane and create an icon.
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.
The subVI controls and indicators receive data from and return data to the block diagram of the calling VI. Click the Select a VI icon or text on the Functions palette, navigate to and double-click a VI, and place the VI on a block diagram to create a subVI call to that VI.
You can edit a subVI by using the Operating or Positioning tool to double-click the subVI on the block diagram. When you save the subVI, the changes affect all calls to the subVI, not just the current instance.
When LabVIEW calls a subVI, ordinarily the subVI runs without displaying its front panel. If you want a single instance of the subVI to display its front panel when called, right-click the subVI icon and select SubVI Node Setup from the shortcut menu. If you want every instance of the subVI to display its front panel when called, select File»VI Properties, select Window Appearance from the Category pull-down menu, and click the Customize button.
As you create VIs, you might find that you perform a certain operation frequently. Consider using subVIs or loops to perform that operation repetitively. For example, the following block diagram contains two identical operations.

You can create a subVI that performs that operation and call the subVI twice, as shown in the following block diagram.

You also can reuse the subVI in other VIs. You can use a loop to combine common operations.
Every VI displays an icon, shown as follows, in the upper right corner of the front panel and block diagram windows.
![]()
A VI icon is a graphical representation of a VI that appears on the block diagram and the Functions palette. It can contain text, images, or a combination of both. If you use a VI as a subVI, the icon identifies the subVI on the block diagram of the VI.
The default icon contains a number that indicates how many new VIs you have opened since launching LabVIEW. Create custom icons to replace the default icon by right-clicking the icon in the upper right corner of the front panel or block diagram and selecting Edit Icon from the shortcut menu or by double-clicking the icon in the upper right corner of the front panel.
You also can drag a graphic from anywhere in your file system and drop it in the upper right corner of the front panel or block diagram. LabVIEW converts the graphic to a 32 × 32 pixel icon.
Refer to the Icon Art Glossary on the National Instruments Web site for standard graphics to use in a VI icon.
Depending on the type of monitor you use, you can design a separate icon for monochrome, 16-color, and 256-color mode. LabVIEW uses the monochrome icon for printing unless you have a color printer.
To use a VI as a subVI, you need to build a connector pane, shown as follows.

The connector pane is a set of terminals that corresponds to the controls and indicators of that VI, similar to the parameter list of a function call in text-based programming languages. The connector pane defines the inputs and outputs you can wire to the VI so you can use it as a subVI. A connector pane receives data at its input terminals and passes the data to the block diagram code through the front panel controls and receives the results at its output terminals from the front panel indicators.
Define connections by assigning a front panel control or indicator to each of the connector pane terminals. To define a connector pane, right-click the icon in the upper right corner of the front panel and select Show Connector from the shortcut menu to display the connector pane. The connector pane appears in place of the icon. When you view the connector pane for the first time, you see a connector pattern. You can select a different pattern by right-clicking the connector pane and selecting Patterns from the shortcut menu.
Each rectangle on the connector pane represents a terminal. Use the rectangles to assign inputs and outputs. The default connector pane pattern is 4 × 2 × 2 × 4. If you anticipate changes to the VI that would require a new input or output, keep the default connector pane pattern to leave extra terminals unassigned.
You can assign up to 28 terminals to a connector pane. If your front panel contains more than 28 controls and indicators that you want to use programmatically, group some of them into a cluster and assign the cluster to a terminal on the connector pane.
![]() |
Note Assigning more than 16 terminals to a VI can reduce readability and usability. |
Select a different terminal pattern for a VI by right-clicking the connector pane and selecting Patterns from the shortcut menu. For example, you can select a connector pane pattern with extra terminals. You can leave the extra terminals unconnected until you need them. This flexibility enables you to make changes with minimal effect on the hierarchy of the VIs.
If you create a group of subVIs that you use together often, give the subVIs a consistent connector pane with common inputs in the same location to help you remember where to locate each input. If you create a subVI that produces an output another subVI uses as the input, align the input and output connections to simplify the wiring patterns. Place the error in clusters on the lower left corner of the front panel and the error out clusters on the lower right corner.
The following illustration shows examples of improperly and properly aligned error clusters.

| 1 | Improper |
| 2 | Proper |
You can designate which inputs and outputs are required, recommended, and optional to prevent users from forgetting to wire subVI terminals.
Right-click a terminal in the connector pane and select This Connection Is from the shortcut menu. A checkmark indicates the terminal setting. Select Required, Recommended, or Optional. You also can select Tools»Options»Front Panel and put a checkmark in the Connector pane terminals default to required checkbox. This option sets terminals on the connector pane to Required instead of Recommended. This applies to connections made using the wiring tool and to subVIs created using Create SubVI.
![]() |
Note You can select Dynamic Dispatch Input (Required) or Dynamic Dispatch Output (Recommended) for dynamic dispatch member VIs. |
For terminal inputs, required means that the block diagram on which you placed the subVI will be broken if you do not wire the required inputs. Required is not available for terminal outputs. For terminal inputs and outputs, recommended or optional means that the block diagram on which you placed the subVI can execute if you do not wire the recommended or optional terminals. If you do not wire the terminals, the VI does not generate any warnings.
Inputs and outputs of VIs in vi.lib are already marked as Required, Recommended, or Optional. LabVIEW sets inputs and outputs of VIs you create to Recommended by default. Set a terminal setting to required only if the VI must have the input or output to run properly.
In the Context Help window, the labels of required terminals appear bold, recommended terminals appear as plain text, and optional terminals appear dimmed. The labels of optional terminals do not appear if you click the Hide Optional Terminals and Full Path button, shown as follows, in the Context Help window.

You can display VIs and Express VIs as icons or as expandable nodes. Expandable nodes appear as icons surrounded by a colored field. SubVIs appear with a yellow field, and Express VIs appear with a blue field. Use icons if you want to conserve space on the block diagram. Use expandable nodes to make wiring easier and to aid in documenting block diagrams. By default, subVIs appear as icons on the block diagram, and Express VIs appear as expandable nodes. To display a subVI or Express VI as an expandable node, right-click the subVI or Express VI and remove the checkmark next to the View As Icon shortcut menu item.
![]() |
Note If you display a subVI or Express VI as an expandable node, you cannot display the terminals for that node and you cannot enable database access for that node. |
When you resize an expandable subVI or Express VI, the input and output terminals of the subVI or Express VI appear below the icon. Optional terminals appear with gray backgrounds. Recommended or required input or output terminals you do not display appear as input or output arrows in the colored field that surrounds the subVI or Express VI icon. If you wire to an optional terminal when the subVI or Express VI is expanded, then resize the subVI or Express VI so the optional terminal no longer appears in the expanded field, the optional terminal appears as an input or output arrow in the colored field. However, if you unwire the optional terminal, the input or output arrow does not appear.
By default, inputs appear above outputs when you expand the subVI or Express VI. Right-click a terminal in the expandable field and select Select Input/Output from the shortcut menu to select an input or output to display. A line divides inputs from outputs in the shortcut menu. Labels for expandable subVIs and Express VIs appear in the colored field that surrounds the icon. To resize the expandable node so it accommodates the name of each terminal on a single line in the expandable field, right-click the subVI or Express VI and select Size to Text from the shortcut menu.
The following illustration shows an expandable subVI that displays four of 10 input and output terminals.

Refer to the Getting Started with LabVIEW manual for more information about Express VIs.
Convert a section of a VI into a subVI by using the Positioning tool to select the section of the block diagram you want to reuse and selecting Edit»Create SubVI. An icon for the new subVI replaces the selected section of the block diagram. LabVIEW creates controls and indicators for the new subVI, automatically configures the connector pane based on the number of control and indicator terminals you selected, and wires the subVI to the existing wires.
Creating a subVI from a selection is convenient but still requires careful planning to create a logical hierarchy of VIs. Consider which objects to include in the selection and avoid changing the functionality of the resulting VI.
If users do not need to view the front panel of a subVI, you can spend less time on its appearance, including colors and fonts. However, front panel organization is still important because you might need to view the front panel while you debug the VI.
Place the controls and indicators on the front panel as they appear in the connector pane. Place the controls on the left of the front panel and the indicators on the right. Place the error in clusters on the lower left of the front panel and the error out clusters on the lower right.
Give controls meaningful labels, including default values and measurement units.
The VI Hierarchy window displays a graphical representation of all open LabVIEW projects and targets, as well as the calling hierarchy for all VIs in memory, including type definitions and global variables. Select View»VI Hierarchy to display the VI Hierarchy window. Use this window to view the subVIs and other nodes that make up the VIs in memory and to search the VI hierarchy.
The VI Hierarchy window displays a top-level icon to represent the main LabVIEW application instance, under which appear all open VIs that are not part of a project or are not part of the application instance for a project. If you add a project, the VI Hierarchy window also displays another top-level icon to represent the project. Each target you add appears under the project.
As you move the cursor over objects in the VI Hierarchy window, LabVIEW displays the name of each VI in a tip strip. You can use the Positioning tool to drag a VI from the VI Hierarchy window to the block diagram to use the VI as a subVI in another VI. You also can select and copy a node or several nodes to the clipboard and paste them on other block diagrams. Double-click a VI in the VI Hierarchy window to display the front panel of that VI. The VI Hierarchy window is a dynamic view of what is in memory. If you rearrange items in the hierarchy, LabVIEW does not save the new position of items. When you close the VI Hierarchy window, the original positions regenerate.
A VI that contains subVIs has an arrow button on its bottom border. Click this arrow button to show or hide subVIs. A red arrow button appears when all subVIs are hidden. A black arrow button appears when all subVIs are displayed.
Polymorphic VIs accept different data types for a single input or output terminal. A polymorphic VI is a collection of VIs with the same connector pane patterns. Each VI in the collection is an instance of the polymorphic VI.
For example, the Read Key VI is polymorphic. Its default value terminal accepts Boolean; double-precision, floating-point numeric; 32-bit signed integer numeric; path; string; or 32-bit unsigned integer numeric data.
For most polymorphic VIs, the data types you wire to the inputs of the polymorphic VI determine the instance to use. If the polymorphic VI does not contain an instance compatible with that data type, a broken wire appears. If the data types you wire to the polymorphic VI inputs do not determine the instance to use, you must select the instance manually. If you manually select an instance of a polymorphic VI, the VI no longer behaves as a polymorphic VI because it accepts and returns only the data types of the instance you select.
To select the instance manually, right-click the polymorphic VI, select Select Type from the shortcut menu, and select the instance to use. You also can use the Operating tool to click the polymorphic VI selector, shown as follows, and select an instance from the shortcut menu.

Right-click the polymorphic VI on the block diagram and select Visible Items»Polymorphic VI Selector from the shortcut menu to display the selector. To change the polymorphic VI to accept all the handled data types again, right-click the polymorphic VI and select Select Type»Automatic from the shortcut menu or use the Operating tool to click the polymorphic VI selector and select Automatic from the shortcut menu.
Build polymorphic VIs when you perform the same operation on different data types.
![]() |
Note You can build and edit polymorphic VIs only in the LabVIEW Professional Development System. |
For example, if you want to perform the same mathematical operation on a single-precision floating-point numeric, an array of numeric values, or a waveform, you could create three separate VIs—Compute Number, Compute Array, and Compute Waveform. When you need to perform the operation, you place one of these VIs on the block diagram, depending on the data type you use as an input.
Instead of manually placing a version of the VI on the block diagram, you can create and use a single polymorphic VI.
The polymorphic Compute VI contains three instances of the VI, as shown in the following illustration.

| 1 | Compute |
| 2 | Compute Number |
| 3 | Compute Array |
| 4 | Compute Waveform |
The Compute VI statically links the correct instance of the VI based on the data type you wire to the Compute subVI on the block diagram, as shown in the following illustration.

| 1 | Compute |
| 2 | Compute Number |
| 3 | Compute Array |
| 4 | Compute Waveform |
Polymorphic VIs differ from most VIs in that they do not have a block diagram or a front panel.
Consider the following issues when you build polymorphic VIs:
If you want the data type a user wires to an input of the polymorphic VI to determine the instance to use and you do not want the user to know that the VI is polymorphic, consider the following guidelines when you build a polymorphic VI:
When you place a polymorphic VI on the block diagram, LabVIEW loads the polymorphic VI into memory. If you make changes to the polymorphic VI in the Polymorphic VI window and close the window without saving the changes, the changes still exist in memory. If you close the VI and then open it again, the changes to the polymorphic VI no longer appear.
When you generate complete documentation for a VI that includes a polymorphic subVI, the polymorphic VI and its instances appear in the list of subVIs section of the documentation.