LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel file handles not released.

Hello!

 

I appended a quite complicated labview application for a customer a few weeks ago. 

This application performs a number of measurements and generates reports in a few different formats. 

Around every 5-10 minutes the application generates 3 different reports, 2 using write to binary file and 1 in TDMS which is converted to excel.

I have double and tripple checked that all files that are generated are closed as well.

 

However if I leave the task manager open I see over time a large amount of Excel processes stacking upp and eating up memory.

 

This application is designed to test a large amount of  products in each batch and is generally set up to opperate over night.

 

If the customer uses the system to capacity the system will generate around 450 reports in a process that takes around 10 hours. 

Lately the PC that runs the labview application has been crashing due to lack of memory and is causing problems for me and my custumer.

 

Does anyone have an idea how to release the file handles to release the memory involved.

 

Thanks in advance.

 

 

0 Kudos
Message 1 of 3
(2,936 Views)

Do you interface with Excel from LV?

 

If yes: Which interface (ActiveX, .NET) are you using?

If no: What is creating these Excel intances?

 

Did you use DETT to look if you got reference leaks in the application?

 

Norbert

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

You describe writing a file in TDMS "which is converted to Excel".  LabVIEW does this conversion "out of sight" and hence "out of control" (the literal meaning, like "not under our control"), so who knows if they are properly closing Excel or not?

 

Have you considered having two programs, one that writes a TDMS file, and a second that reads your TDMS file and does the conversion to Excel?  I presume that while you are acquiring the data over several hours, you are not trying to simultaneously read the reports, so doing them all at the end shouldn't be a problem.  You can also, in principle, fire up the second program as an independently-running LabVIEW application that processes the latest, or a specific, TDMS file to Excel (or maybe processes all TDMS files that are not already in Excel), so you can have the two running asynchronously and in parallel.  If the Excel-producer stops and is restarted, then any memory or handles it has should be released.

 

Finally, have you considered skipping the TDMS write and creating the Excel Report directly with the Report Generation Toolkit (assuming that you have this available to you)?  I'm pretty sure that Dispose Report "releases" Excel, so you should be able to generate hundreds of Excel reports without consuming memory.

 

Bob Schor

 

P.S. -- if you need more specific help, attach your code (attach the VI or a zipped Project folder -- please do not send "pictures").

 

0 Kudos
Message 3 of 3
(2,923 Views)