04-01-2010 07:26 PM
Hi all,
I could not find a recent (LV 2009) thread on this subject.
I have an application which consists of two main VIs. The first VI (which the user never sees) calls the UI VI.
I have had trouble when the user wants to exit the UI VI. If I allow them to press the cross (X) in the corner of the Window then the UI VI closes and leaves the caller VI still running. To get around this I only allow them to push an Exit button on the UI front panel. This invokes the Quit LabVIEW VI which shuts down both the caller and the UI. This is not very elegant and there is a short flash of the caller VI when I do it this way.
I know there is some sort of App Event which I can use. I want the user to be able to push the Window cross (X) in the corner and for this to close all running VIs.
Any examples you could provide would be greatly appreciated.
Battler.
Solved! Go to Solution.
04-01-2010 09:17 PM - edited 04-01-2010 09:17 PM
04-01-2010 10:46 PM
04-01-2010 10:51 PM
How are you closing it now with the Exit button?
You could also do a close front panel on a reference to the calling VI.
04-01-2010 10:55 PM
Using the Quit LabVIEW VI.
The calling VI doesn't have an Event Structure.
04-01-2010 11:02 PM
Can you look at this thread:
http://forums.ni.com/ni/board/message?board.id=170&message.id=63179&query.id=1792880#M63179
"Closing by running the quit labview function results in a flash on the screen as the VI(s) stop and show their toolbar for a split second prior to closing. Not very elegant. So for built applications the best way to close is to do it by closing all the windows, then the application will quit nicely (off course, make sure you do all other exit operations."
04-01-2010 11:10 PM - edited 04-01-2010 11:12 PM
battler. wrote:Using the Quit LabVIEW VI.
The calling VI doesn't have an Event Structure.
You said that Quit LabVIEW was working for you now using your exit button.
I never said anything about the calling VI needing an event structure.
The called VI has the event structure to capture the panel close event, discard it, and do what you do now to close both VI's. If it is Quit LabVIEW and that works for you now, great.
Otherwise do something like this.
I'm not going to guarantee this will work precisely. There may be details you'll have to work out based on your exact application. Without seeing your exact application, I can't tell if there is anything special or extra you might have to do. Why do you have a first VI that the user never sees? What is the purpose of it?
04-02-2010 12:31 AM
The problem (as stated by that thread I pointed to): "Closing by running the quit labview function results in a flash on the screen."
The VI the user never sees calls two VIs: 1. with a splash panel showing program details. 2. Calls the main UI VI subject to some error checking.
04-02-2010 01:51 AM - edited 04-02-2010 01:59 AM
04-02-2010 08:35 AM