LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is samples to read correlate with rate?

I am trying to run an experiment for 4 hours and I am trying to save the data. It seems like that samples won't be read if my rate is 10 and samples to read is 1k.  Is there a correlation between the two? Or is this the limitation on reading samples for 10 Hz. Thanks.
0 Kudos
Message 1 of 7
(6,943 Views)

I'm not sure why you are having problems with these two values, as I think you should be able to store 1k samples in the buffer before being consumed by your program.

 

There is no real correlation between your sample rate and the number of samples to read.  If you are setup to read samples continuously, then the DAQmx Read VI would take 1 seconds to read 1k samples at a rate of 1khz.  It would take 0.5 seconds to read 500 samples at a rate of 1khz.

 

A lot of my applications involve "slow" DAQ rates.  I tend to sample at 100hz, 50 samples at a time, and then have my samples averaged so that the numbers that are saved are 2hz.

0 Kudos
Message 2 of 7
(6,938 Views)
If your rate is 10 samples/second and you want to read 1000 samples, then it will take 100 seconds to collect those thousand samples.  The default timeout for a DAQmx function is probably 10 seconds.  So you may timeout before you've acquired all the samples.  You would need to either increase your timeout to be greater than 100 seconds, or read perhaps 50 samples at a time and do that 20 times.
0 Kudos
Message 3 of 7
(6,935 Views)

This article provides additional information about buffered acquisitions and what can be done to make them more efficient:

 

http://digital.ni.com/public.nsf/allkb/7AD4854943BF344186256D6500807935

Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 4 of 7
(6,893 Views)

Hi, the link to the article doesn't work anymore - is there another link to it? Maybe it's changed since then.

 

Thanks, Andrea

0 Kudos
Message 5 of 7
(6,403 Views)

Hi, I am trying to do the same averaged sampling as you mentioned in your comment. I understand how to set up the sampling rate and size but how did you average all of the data for it to be reported?

 

Thanks!

0 Kudos
Message 6 of 7
(4,680 Views)

Using any of the provided averaging functions, or the simplest way is simply to use the Sum Array function then divide by the Array Size output.

0 Kudos
Message 7 of 7
(4,665 Views)