To download NI software, including the products shown below, visit ni.com/downloads.
Overview
Code that will double check if the user really wants to close the application after pressing the red close button on the front panel.
Description
In LabVIEW, you can take advantage of Filter Events to catch things (and undo if desired) before they happen. In LabVIEW, there are Filter Events and Notify Events. When configuring the event structure, Notify Events show up with a green arrow next to them. These events simply tell you that the desired event occurred - nothing more. Filter Events show up with a red arrow next to them, as well as a question mark. Filter Events let you know about the event before it is actually processed. That way, you have the option to override.
Download and run the attached code. If you try and close the VI while it is running by clicking the Red "X," you will get a verification dialog. This can be used as a safeguard in critical applications.
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
1. Run the VI
2. Press the red close button
3. When prompted, select the desired option
4. Use the Stop button to finish the execution.
Additional Information or References
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Could you convert the code to LV 2009 please? Thanks!
Thank you! I am having this discussion on the NI forum. Basically I am trying to porperly close the front panel so it can be re-opened again. The suggestion is to use FP.Close event to properly close the fron panel - it might be also useful in your example.