11-09-2010 12:49 AM
I have installed an application (built using LV 2009) on a couple of Laptops running Windows XP. If the application stays open for a couple of days and I then I exit the program I can see in the Windows Task Manager my application saying "not responding", and I have to manually click on the End Task button.
My Top Level VI uses the JKI State Machine (2010), which uses the Exit Macro to close the Front Panel to the Top Level VI, then it's reference and then exits the while loop. When this didn't work I tried the following outside the JKI State Machine While Loop (ie. the last VI to be executed).
1) MGI "Exit if Runtime.vi" which also closes the Front Panel of the Top Level VI and then calls the QUIT primitive and when this didn't work
2) I tried my own VI which closes all VI's Front Panels in Memory and then does the same as the MGI VI, but this didn't help either.
The application exits fine if I play with it for a while and open/close a few interfaces. Would a slow memory leak cause it to not shut-down properly?
Chris
11-09-2010 12:16 PM
Just a wild guess and I am no super user but
Is your application using serial or DAQ resources?
11-09-2010 12:16 PM
Just a wild guess and I am no super user but
Is your application using serial or DAQ resources?
11-09-2010 08:11 PM
No - I'm afraid it's all plain simple LabVIEW - no DAQ, no Serial.
I do interface to two USB Brother Printers, but I talk to them through their own API use Properties and Methods, and I'm VERY careful to close all references in this interface.
Chris.
11-10-2010 02:15 AM
You can make a try of first stopping the while loop and then at the end use the Exit macro to Exit the application.This might be due to your PC performance also.
11-10-2010 02:37 AM
Yeah unfortunately that's what I've done - The last VI executed is the LabVIEW Exit (Quit) function.
As you said maybe it is taking the laptop a long time to close down LabVIEW, but how long should one wait? I waited a couple of minutes, and it still was NOT Responding in the Task Manager.
Chris
11-10-2010 02:46 AM
Check for the time delays inside the while loop. Keep a delay of 250 or 500ms if your application is Ok with that. When you use very less time delay it will occupy a lot in the system memory that you can see in the task manager>Performance. and memory usage.
11-10-2010 02:57 AM
I don't quite follow what you're saying, but it doesn't really matter anyway since I don't use a time delay in my While Loop - it uses the JKI State Machine - see the image and the Timeout is set to -1. You can also see my Exit VI on the right-hand side.
I'm going to monitor the Memory useage of the VI for a day and see if that's increasing - but I that probably doesn't really help me with this exit problem?
Chris
11-10-2010 03:09 AM
Ya you have given time out as -1 in the event case and have no time delay. I don't know how JKI state machine executes but generally when you use a while loop without a time delay it will occupy a very large memory in the system. So you can remove the -1 timeout and use 250 ms or 500ms and create an event to stop the code. To see the memory usage of while loop just run a while loop with and without time delayyou can see the difference.
11-10-2010 03:17 AM
Here is a screen shot where you can see the memory usage of while loop.