Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
8 ratings:
 3 out of 5   

How Do I Programmatically Open and Close a VI Within Another VI?

Primary Software:
Primary Software Version: 2012
Primary Software Fixed Version: 2012
Secondary Software: LabVIEW Development Systems>>LabVIEW Full Development System

I have a VI that I would like to programmatically open, view, and close while running a separate VI. Is this possible?

There are two possible ways to do this:
  • Place the second VI as a subVI within the first. On the block diagram, right-click the subvi and select SubVI Node Setup. From there, you can select the two options Show Front Panel when called and Close afterwards if originally closed. These options will provide for the desired functionality.

  • You can also programmatically obtain this by using VI Server References to call the needed VI. The picture below shows how you would use Open VI Reference, Invoke Nodes, and Close Reference to open a VI and run it programmatically from within another VI.  You can see an example of this code at NI Community, linked below.

Related Links:
KnowledgeBase 42NH4TUR: How Do I Stop a Running VI Programmatically?
NI Community Example:  Programmically Open a VI


Report Date: 12/18/2006
Last Updated: 04/02/2013
Document ID: 44HC8A7N

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit