Example Code

Two Ways to Programatically Open a Sub-VI Front Panel

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

 

 

Overview
This example shows two ways to programatically open and run the front panel of a sub-VI.
Description
By utilising VI Server , the first method locates the Sub-VI's and utilises Invoke Nodes to open and run the sub-VI. The second method uses the properties of the called Sub-VI. By right-clicking the sub-VI and selecting 'SubVI Node Setup', you can configure the sub-VI to open its front panel when called and then close afterward if originally closed.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

Open Example.lvpoj

Method 1

  1. Open Main (Method 1).vi
  2. Locate the path of sub-VI.vi in the path control
  3. Turn on the 'Activate?' boolean
  4. Run the main VI

Method 2

  1. Open Main (Method 2).vi
  2. Run VI
  3. Click 'Run sub VI' boolean

 

Additional Information or References
VI Block Diagram

 5-107.png

 

  **This document has been updated to meet the current required format for the NI Code Exchange.**

 

 


ShalimarA | CLA

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.