LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

double buffering daqmx

I understand that DAQmx is supposed to do double buffering automatically.  When I run the example below in continuous mode, It will run continuously without error.  when I hit stop, it will give me a "Not enough memory to complete this operation." error.  This error occurs only when i've acquired greater than about 70M samples.  If I don't hit stop it will run to about 300M samples, give the above error and also an unspecified Labview error.  The rate does not appear to affect this.  Am I actually double buffering?
Does it only do double buffering with the "Continuous Samples" mode?  I've been using the example below with both continuous and finite samples and in both cases it seems to acquire more samples the 64MB. 
Does this have anything to do with what i'm seeing?
 
Equipment:
Labview 8.2
NI-8350 Controller
MXI-4
PXI-6534
0 Kudos
Message 1 of 3
(3,166 Views)
I forgot to add the example.
 
0 Kudos
Message 2 of 3
(3,133 Views)
You are creating the second buffer in your application. DAQmx is not at fault here. You are wiring the output from the DAQmx Read VI to an auto-index tunnel on the While Loop. As your program runs this auto-index tunnel builds an array of every value that was sent to it in every iteration of the loop. So as time goes on, this array gets bigger and bigger. Eventually you will run out of available memory.

You should look into other ways of streaming data out of a loop, such as using Queues. You could then have a background loop to handle any data analysis or display.
Jarrod S.
National Instruments
0 Kudos
Message 3 of 3
(3,130 Views)