Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling rate issues with Labview and NI 9215 modules

Using the DQAassit in Labview, I have set up a VI to collect data from 4 modules with 3 channels each. The sampling rate is set to 24kHz. However, when we choose say 720 000 sampling points (corresponding to 30s of data), the system actually only reads for 28.1s. This means the actual sampling rate is around 25622Hz. I'm not sure where I might be going wrong?

 

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

What kind of error do you get?

 

Doing the math makes me wonder if you have a buffer size or buffer overflow issue.  720 000 points on each of 12 channels is 8.64E6 samples. Now consider 24 kHz * 12 channels * 28.1 s = 8.09E6 samples. 2^23 = 8.39E6.  If the sample buffer is sized at a power of 2, 30 seconds might overflow the buffer while 28.1 might not.

 

You may be better off avoiding the DAQ Assistant and using the standard DAQmx functions for a situation like this. Set the acquisition for continuous samples outside the loop, read one or two seconds of data at a time in the loop, pass the data to a parallel loop via a queue, and then clear the task after leaving the loop. This is the basic idea of the Producer/Consumer Design Pattern.

 

Lynn

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