Example Code

Self closing VI using LabVIEW

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

Description

1. Overview

This VI shows how to close a VI from its own block diagram.

 

2. Description

The code shows how to open a VI reference (can be itself or some other in the directory), and pass it to an invoke node that calls the function ‘FP.Close’ in order to close the referenced VI.

 

3. Requirements

NI LabVIEW Base Development System 2012 (or compatible).

 

4. Steps to Implement or Execute Code

  1. Download and run the code.
  2. You can take the case structure wherever you want your application to close itself. Note that the while loop and event structures are placed so that the program doesn't poll continuously the front panel controls.
  3. You can change the Current VI’s path constant to a constant or control in order to change the VI you wish to manipulate.

 

5. Additional Information or References

 

 Self closing VI Screenshot.PNG

 

 

  

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

Regards

Robert

National Instruments UK & Ireland

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

Comments
Balaji_DP
Active Participant
Active Participant
on

could you please tell me , if i use FP.state = Close. then what happend...?

is it any different in property...?

Regards,
Balaji DP
Ahmed.TUN
Member
Member
on

That's very useful, specially when someone would want to switch from one front panel to another

CDeVane
Member
Member
on

This VI is absolutely the most useful and practical kind that speaks directly to how LabView should be used. It is incredibly difficult to find this sort of information in he available data. Robert L. has done my a great service in clearing the air on tis use of the invoke node. It was clear, direct and easy to understand. On top of that, it was very useful in my application in clearing many PopUp windows. I have a lot of data in various forms that must be accessed as it occurs or at the operator's option.