12-08-2011 08:37 AM
Using the X to close an executable or File/Exit menu, does this make a difference? It appears so.
I acquired an application executable to upgrade and whenever I close this executable, using the OS window X mouse click, it will persist in the Task Bar. As a result, I must open the OS task manager and stop the Process in order to start a fresh start. But, if I use the LV menu, File/Exit (Ctrl+Q), to close the executable everything closes as normal, gone from task bar. Is this occuring because the code doesn't close references, visa ports, instruments etc? What is a fix.
12-08-2011 08:46 AM
The windows X button is not fully supported in labview. An event structure can detect when you are pressing the X button. See attached vi!
12-08-2011 08:53 AM
You have to implement actions when closing the window using the X button. There's no automatic link to a quit menu item or similar. If you want the same behavior with X and quit you have to implement it that way using the event as sandal mentioned.
12-08-2011 03:37 PM
Hmmm, not sure if I agree that this is the way LV works. Oh yes there is application close event of course that I believe Sandal mentions. I work with many a executable and none of them required expicitly closing the VI except this one of course. I'll continue my search.
12-09-2011 01:42 AM
To press the X button without implement the close action is the same as pressing the red abort button in your programming environment. You are aborting the code flow without closing references, and other things you do "after" the while loop.
12-09-2011 08:57 AM
You guy are talking about a running executable and I add an event to handle when the executable closes, i.e. a running VI.
If your ideas are correct why does this occur when the executable is open but not running and I click X to close. The way I understand, the LV application closes and is removed from the task bar by the OS. Obviously, the OS still sees a process running or open in the application, as a result, it will fail to close the labview process and thus persist in the task bar.
I only have this problem on this executable.
12-09-2011 09:02 AM
@richjoh wrote:
You guy are talking about a running executable and I add an event to handle when the executable closes, i.e. a running VI.
If your ideas are correct why does this occur when the executable is open but not running and I click X to close. The way I understand, the LV application closes and is removed from the task bar by the OS. Obviously, the OS still sees a process running or open in the application, as a result, it will fail to close the labview process and thus persist in the task bar.
I only have this problem on this executable.
Exactly!. this is why so many projects contain a case srtucture switched by the vi server property "app kind" to quit the app instance if app kind is Run Time Engine.
12-09-2011 09:26 AM
Are you suggesting I use app kind property to fix this issue? If so, will this fix the issue of a not running but open executable and close it using X? I've used app kind before to label the executable version in the title bar per an NI zone paper.
12-09-2011 09:38 AM - edited 12-09-2011 09:40 AM
I can't post example code today but, yes. on filter event app close? or front panel close? if app kind is RTE discard the event, run cleanup code and call the Quit Application primitave (that we all love to hate):smileywink:
File>> Exit is an App close event the windows X is a panel close event
12-09-2011 09:48 AM
OK, Jeff your statement makes sense now (to me). I do the panel close, if RTE discard event and Quit App. I'll put this in later when time permits and post the result.
Thanks for the response.