LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 8.0.1 vi memory dump with DAQmx channel read

I am having a tough time from keeping this vi I made from consuming so much memory over time.  I made it using LV 8.0.1.  Basically, all it is doing is reading in analog input line from a usb device linked to a sensor that basically monitors the line.  Whenever the sensor goes on, the count increments by one no matter how long the signal is held on for and then the time and count of this event is then written to a data log lvm file.  This occurs each time the sensor goes on.  Which is why I am uncertain as to why it still consumes memory other than when it first goes high and writes to the data log.  I didn't think it would keep using the memory up if the sensor was off.  I was wondering if anybody has any suggestions on keeping a simple vi like this from consuming so much memory.  Basically, if running for more than a 1/2 hour, the smaller computer gets a memory dump crash (blue screen with some kind of a reference to nimxdfk.dll).  I was unable to see any refnums that needed to be closed within the while loops.  Am I supposed to clear the task after each iteration?  A little confused.  It is fully commented on if you have the time to look it over.  Thank you very much for your suggestions.
 

Message Edited by scott_7723 on 02-09-2007 07:04 AM

0 Kudos
Message 1 of 4
(2,874 Views)
I have added a clear task step after my daqmx assistant (generated to DAQmx code) stop task vi since my original post which appears to be the solution. 

Message Edited by scott_7723 on 02-09-2007 10:22 AM

0 Kudos
Message 2 of 4
(2,862 Views)
Hello Scott_7723,

I took at look at your code, thank you for taking the time to add comments. I appreciate this.

With regards to your code, I noticed a few things. If you go into your Untitled 3.vi you will noticed that on the DAQmx create task, a 'true' is wired to the Autoclean pin. The auto cleanup specifies if LabVIEW automatically destroys the task when the application completes execution. Since you are running this program for more than 30 mins, the task you created is never destroyed, it sits there. You also have the Untitled 3.vi sitting in another while loop, this also runs multiple times creating a task every time you execute the larger while loop. This can add up to a large amount of space in memory.

What you might consider doing is creating the task once outside the while loop and then have it read from the channels multiple times, by only placing the read in the while loop. Take another look at your code and see if you can optimize the number of while loops you need to have. For an application like this, you may want to consider using lower level vis. Perhaps consider having the create task, sample clock, start task, stop task, or clear task outside the while loop. I have included a very useful link to various low level vis that you can use to program your DAQ applications.

Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Application

Make note of the figures and the order in which the vis are sequenced.

Give these suggestions a try!

Regards,
  Sandra T.

Applications Engineer | National Instruments

Message 3 of 4
(2,845 Views)
Thank you so much for taking the time to look at this, Sandra.  I will definately look into making the changes you suggested.  I appreciate the link as well.  Thank you. 
0 Kudos
Message 4 of 4
(2,837 Views)