Running a VI executes the operation for which you designed the VI. You can run a properly wired VI from the block diagram, from the Project Explorer, or programmatically.

Before you can run a VI, you must wire all the subVIs, functions, and structures in the VI with the correct data types for the terminals.

Note You cannot edit a VI while the VI runs.

You can run a VI if the Run button on the toolbar appears as a solid white arrow:

Solid white arrow Run button icon.

The solid white arrow also indicates you can use the VI as a subVI if you create a connector pane for the VI.

To run a VI, use the following approaches:

  • Run a VI interactively from the block diagram or the front panel:
    1. Wire all the subVIs, functions, and structures with the correct data types for the terminal on the block diagram.
    2. Depending on how you want to run the VI, choose an option in the toolbar:
    OptionDescription
    Run the VI once Click the Run button, Solid white arrow Run button icon.

    The VI stops when the VI completes its data flow.

    Available from the front panel and the block diagram.

    Run the VI continuously Click the Run Continuously button, Run Continuously button icon with two arrows in a circular loop.

    The VI runs continuously until you stop it manually.

    Available from the front panel and the block diagram.

    Runs the VI in incremental steps Click the single-stepping buttons,
    Icons for Step Into, Step Over, and Step Out actions.

    This approach is useful for debugging a VI.

    Available from only the block diagram.

  • Run a VI interactively from a LabVIEW Project:
    1. Create a new project or open an existing project.
      The Project Explorer window appears.
    2. Right-click a VI in the Project Explorer window.
    3. Select Run from the shortcut menu.
    The VI front panel opens in run mode.
  • Run a VI programmatically using either of the following approaches:
    • Use the Run VI method.
    • Use the RunVI command line operation.
While a VI runs, the Run button changes to a darkened arrow (Darkened arrow Run button icon indicating VI is running.) to indicate that the VI is running.
Note The Abort Execution button (Abort Execution button icon, a red circle.) stops a VI immediately, before the VI finishes the current iteration. Aborting a VI that uses external resources, such as external hardware, might leave the resources in an unknown state by not resetting or releasing them properly. To avoid this problem, design VIs with a stop button that safely releases resources.

Configuring How a VI Runs

You can configure settings that determine how a VI runs.

For example, you can do the following:

  • Configure the VI to run immediately when it opens
  • Configure the VI to pause when called as a subVI
  • Configure the VI to run at different priorities if, for example, it is crucial for the VI to run without waiting for another operation to complete
    Note Incorrectly configuring a VI to run at different priorities can cause unexpected execution. You do not need to configure most VIs to run at different priorities.
  • Set reentrancy settings

To configure execution settings for a VI, complete the following steps.

  1. Open the VI.
  2. In the menu bar, select File » VI Properties.
  3. In the Category pull-down menu, select Execution.
  4. Change the settings.