LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Executable VI remains in memory after closing the program

Using LabVIEW 8.5.1
 
I've had two problems like this now.  One in a vista machine and the other in a windows 2000 machine.  The program is the same with minor changes between the machines.  At first I thought the problem was in the installer and I had to change the target OS to Vista only, but now I'm not sure that is the issue as it is happening in a win2K machine as well.
 
The program runs fine but when we stop the execution and then close the program by hitting the X on the upper right corner of the window it closes the window but the instance remains loaded in memory and I have to go to the task manager to end the task. 
 
Any leads on the fixt to this would be helpful.
 
Thanks,
0 Kudos
Message 1 of 9
(4,388 Views)
Do you have any code responding to the 'Close' event as described here.

You most likely have a VI with a hidden front panel open, this prevents the executable to close.
Make sure all your front-panels are closed.
EDIT:
Note using the [x] is totally acceptable in my opinion.

Ton


Message Edited by TonP on 08-04-2008 09:01 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 9
(4,382 Views)
To quote Ed dickens:

Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

You should place a stop button on your VI and create an event that will unload your VI from memory when you press it.
Jim

LV 2020
0 Kudos
Message 3 of 9
(4,382 Views)

To clarify,

I am not hitting the abort button to stop the program.  I am not hitting the X on the window before stopping the program progrmatically.  I do have sub-vi's that can be called based on user imput and others that do not open the front pannel at all during the execution of the program.

The program executes fine, when the stop button is pressed it goes to a programmed shut down procedure and as the last step this procedure has the "Stop VI".  At this point the program can be started again by pressing the white arrow (run) button or the window can be closed.  I have not called the "quit labview" vi but I'm wondering if I should do it as a last step in the shutdown procedure.  The way I close the program front pannel (again, after stoping the program programatically) is by hitting the X in the upper right hand corner of the window.  But the program instance remains listed in the windows task bar and when I go to the task manager it is also listed there.  So the only way to completely quit the program is by ending the task in the task manager.  Other wise the program remains in memory and can not be re-started either.

 

I hope this clarifies my problem.

thanks, 

0 Kudos
Message 4 of 9
(4,371 Views)


ChillyWilly wrote:

when the stop button is pressed it goes to a programmed shut down procedure and as the last step this procedure has the "Stop VI".  At this point the program can be started again by pressing the white arrow (run) button or the window can be closed. 


The most possible reason is that your Stop vi has a problem. Maybe you leave a vi (without front panel) in memory.
Although i don't agree with your programming style. The program should not be terminated at that point. It should pass to an idle state, waiting either for a button "Run" to be pressed, or the "X". If "X" is pressed then you terminate your program.
 


ChillyWilly wrote:

 I have not called the "quit labview" vi but I'm wondering if I should do it as a last step in the shutdown procedure. 


DO NOT. This may solve your problem, but it should never be used in exe files. Find which vi remains in memory, to solve your problem.
0 Kudos
Message 5 of 9
(4,351 Views)


@ChillyWilly wrote:

To clarify,

The program executes fine, when the stop button is pressed it goes to a programmed shut down procedure and as the last step this procedure has the "Stop VI".  At this point the program can be started again by pressing the white arrow (run) button or the window can be closed. 


Close the front panel programmatically of this VI (the method FrontPanel.Close).

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 9
(4,334 Views)
I will check for code left running as this may be the most likely cause.

As to what Pnt wrote:
 
"Although i don't agree with your programming style. The program should not be terminated at that point. It should pass to an idle state, waiting either for a button "Run" to be pressed, or the "X"."

I am giving you a glimpse of what the code does.  I'm not saying that I'm an expert programer as it is not my full time responsibility.  However, I am asking for help on figuring out what is going on with my code and I understand that it will be hard to pin point the problem without posting the entire program for members to disect.  Having said that, it would also be difficult to get but a glimpse on my programming style without me posting what I would consider a finished program.  For example, (here is another glimpse at my style) the program does go into an idle state waiting for the user to run another recipe or to terminate the program.  If the user decides to run a recipe but needs to abort the recipe, there is an option to do that and the program goes back to idle.  Further more the program can only be stopped while it is idle, a recipe has to be aborted prior to stopping the program (this is required to avoid leaving the furnace in an unsafe state) unless the user forces the program to quit by way of the "end task" which thanks to the note posted in a previous reply I know how to hadle now...  
 
Sorry for the deviation from the actual topic, I could go on and on about what the program is supposed to do and how I'm meeting the end user requirements but I don't see the value of that at the momment.
 
0 Kudos
Message 7 of 9
(4,319 Views)

ChillyWilly, did you ever resolve this issue, and if so, what did the problem turn out to be?  I am experiencing what appears to be the same problem, built executables are staying in the "processes" list in Windows task mgr, but are removed from the "applications" list and from the taskbar.  Each time the .exe is run another remnant copy is left in the processes list, until the system is rebooted.

 

Can someone explain why the "Exit Labview" VI shouldn't be used in an executable?  That seems the obvious way to exit...

 

- Brian

 

0 Kudos
Message 8 of 9
(4,089 Views)

Brian,

 

your question is answered in the link  TonP has in his post.

I have to disagree with Pnt in his statement "DO NOT. This may solve your problem, but it should never be used in exe files.".

But i have to admit, that the "Quit LabVIEW" function has its backdraft just as stated by Jim Kring in his KB. This is absolutly true. But if you can make sure, that this function is the last one called in your application, it is valid to use it. If you can't, listen to Pnt....

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 9 of 9
(4,085 Views)