LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queue fills too fast and crashes program

Hi all,

 

 

I am trying to gather data from three different DAQ devices and different rates, present the data in a graph, while also resampling the data to be written to a TDMS file with a common time stamp.

 

i am using a consumer/producer loop structure, passing data between the loops using queues. The issue I am having is that the queue fills so fast, that once it reaches approximate 90000 samples, it crashed my VI and says 'there is not enough memory to complete this task'. This happens within 1-2 minutes, while I need the program to run anywhere from 10 minutes to 2 hours.

 

Any advice on how to solve this issue is greatly appreciated. I have attached my VI for Labview 2015 as wel as Labview 8.5.

 

 

0 Kudos
Message 1 of 4
(2,857 Views)

From the looks of it, you are telling the read VI to just read every single sample found in the buffer, instead of a finite amount, which might be causing the performance loss. Also since you're using TDMS I would strongly suggest to use a structure of "open-write-close" for data conservation purposes; if program crashes or another inconvenience arises, you might face data loss if it's perpetually open, tdms was designed to be fast precisely because of this.

0 Kudos
Message 2 of 4
(2,852 Views)

Thank you for your reply Daikataro.

 

My goal is to read every sample so that the data can later be resampled and written with a common time stamp. If I set a finite amount of samples to be read from the buffer, once I stop the acquistion process, will all the sample be read out of the buffer? Or will there be data that remains in the buffer that cannot be retrieved.

 

Thanks again.

0 Kudos
Message 3 of 4
(2,845 Views)

Actually you seem to be in luck, because I'm specifically working on DAQmx sampling and thus have been researching about it like mad. These 3 NI articles are very informative and should tell you all you need to know about the buffer

 

http://digital.ni.com/public.nsf/allkb/D4BB69D64483DE928625695E0052EE22

 

http://digital.ni.com/public.nsf/allkb/E1E67695E76BA75B86256DB1004E9B07

 

http://digital.ni.com/public.nsf/allkb/3E3D74E26B8A5B83862575CA0053E4B5

 

Also, once you have the data in a non-volatile storage (like a .tdms file) it is no longer needed and can be safely ignored, that's why I recommend to read a finite amount of samples off the buffer; for example if you are sampling 2k samples at 2kHz then you could read 2k samples every second, and record that in .tdms no need to re-write the data into the buffer since it's already stored. You can also use the DAQmx read node to further control how the buffer is read, for example defining an offset and where to start reading data from.

0 Kudos
Message 4 of 4
(2,815 Views)