LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW does not exit in executable

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

0 Kudos
Message 1 of 19
(4,992 Views)

Just a wild guess and I am no super user but

Is your application using serial or DAQ resources?

 

 

0 Kudos
Message 2 of 19
(4,948 Views)

Just a wild guess and I am no super user but

Is your application using serial or DAQ resources?

 

 

0 Kudos
Message 3 of 19
(4,947 Views)

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.

0 Kudos
Message 4 of 19
(4,925 Views)

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.

 

Smiley Wink

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 19
(4,910 Views)

Yeah unfortunately that's what I've done Smiley Sad -  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

0 Kudos
Message 6 of 19
(4,902 Views)

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.

 

Smiley Wink

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 19
(4,897 Views)

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

0 Kudos
Message 8 of 19
(4,893 Views)

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.

 

Smiley Wink

-----

The best solution is the one you find it by yourself
0 Kudos
Message 9 of 19
(4,886 Views)

Here is a screen shot where you can see the memory usage of while loop.

 

Memory usage without delay.JPG

 

 

 

Memory usage with delay.JPG

 

 

 

Smiley Wink

-----

The best solution is the one you find it by yourself
0 Kudos
Message 10 of 19
(4,875 Views)