LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cDAQ Acquisition

Question regarding cDAQ configuration for samples and sample rate. 

 

I am trying to get data points at every 0.01 seconds from the cDAQ module 9174. And struggling between choosing the type of acquisition. Require guidance. 

 

I tried continuous and N data acquisition sampling. Is it right to say, if I have 2000 hz of sampling rate with continuous sampling, and number of samples (200) is the buffer size.  And the buffer will keep over writing ?

 

If so, in that case,  when I choose 1D wave form from my DAQmx read ( N channel, 1 sample), I am getting a 1D array, where the wave form is plotting all the channels in a single plot, rather than N plots. I could not reshape the array, as it is a continuous sampling. Is there an alternative to this?

 

Which led to trying N Data acquisition. This apparently seemed to be real slow. Even though I have a 2000 Hz sampling rate and only say 2 samples -- which should take 1ms to acquire, and after that some basic math ( may be 2 ms for the math) and later a waveform display. This whole process is in a while loop and it should take less than 10 ms. But, it is literally taking 1 second to get the data and my acquisition is not real time anymore. Played around with sampling rate and number of samples - have no luck. 

 

I would like to get a data point of each of the N channels at every 10 ms. So what would you guys suggest - N sampling or continuous sampling? Whatever it is, how would I would like to display in a continuous wave form. 

 

PS: No wait in the while loop

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

The choice between Continuous sampling and N-sample Finite sampling depends on additional details of your app needs that aren't clear.

 

Meanwhile, I think a key issue is the distinction between sampling rate and buffer retrieval rate.  USB devices such as cDAQ have a significant latency between when samples are acquired at the device and when they get transferred over USB to the main memory where they can be retrieved.

 

Consequently, your cDAQ *can* sample at 2000 Hz, but you may not be able to *retrieve* this data at 100 Hz by repeatedly requesting the next 200 samples.  I'm not super experienced with cDAQ, but I'd take an educated guess that you could reliably retrieve at 10 Hz whereas 100 Hz retrieval probably sometimes works and sometimes doesn't keep up.

 

Whatever that latency-driven limit turns out to be, you probably have limited ability to affect it with any USB-based data acq device.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 3
(2,265 Views)

My recommendation

 

Go to Help menu, Find Examples, search for

Voltage (with Events) - Continuous Input

(Save a copy and modify)

 

You can make an event based loop and play around with getting data every 10, 20 , 50, 100 Hz and see what works for your system.

 

mcduff

 

Message 3 of 3
(2,257 Views)