LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Buffer problems

I am reading in three signals from a DAC and storing them in memory whilst
doing FFTs etc. If I make the buffer large (32000 samples per channel)I can
get it to work for about a minute before I get an error message. Reducing
the buffer size makes it crash sooner. I imagine it is down to how
powerful the PC is,how much memory etc.
Is there a way to fix things so it is not so hit and miss (ie the speed of
the PC) when it crashes. Can I use a Wait of some sort?
Also is it possible to stream data directly to disk.


Tam


0 Kudos
Message 1 of 2
(2,748 Views)

Hello Tam,

The three things you can do to prevent a buffer overflow from occurring are to decrease the sampling rate, increase the buffer size, or increase the number of samples per channel to read.  It sounds like you have already tried increasing the buffer size, and instead of solving the problem, has just delayed the buffer overwrite.  I would then try to both decrease the sampling rate of your acquisition, and increase the number of samples per channel you read each iteration.  If you decrease the sampling rate of your acquisition, data will enter the buffer at a slower rate, and LabVIEW will be able to better keep up with emptying data from the buffer.  You can also try increasing the number of samples per channel to read, so that LabVIEW empties more samples from the buffer each iteration.  You could try setting the 'number of samples per channel' of the DAQmx Read VI to -1, which will tell LabVIEW to empty all available data in the buffer during each iteration.  Give these suggestions a try and let us know how it turns out.  Also, here's a helpful document that explains how to monitor the number of samples remaining in the buffer at all times.
KB 2ZFHCKL1: (DAQmx) Error -200279 During a Continuous, Buffered Acquisition

Regards,
Travis G.
Applications Engineering

 
0 Kudos
Message 2 of 2
(2,720 Views)