02-19-2006 11:03 AM
02-19-2006 09:20 PM
02-20-2006 05:59 AM
Just to add to Alejandro's good answer, Read rate also determines at what rate you retrieve data from the AI buffer.
For ex, if you are acquiring at 1K sampling rate and you put 500 as number of samples to read, the 'DAQmx read' does 2 irterations in a second to retrieve 1000 samples in a second.
if you enter it as 10, DAQmx read executes 10 times in a second, and so on.
So it is essential that you choose a optimal value to prevent buffer overflow.
Hope this helps
regards
Dev
03-28-2006 02:19 PM
03-28-2006 02:43 PM
12-07-2010 11:07 AM - edited 12-07-2010 11:11 AM
A very old post, but I have a question regarding sampling rate and samples to read. Now, I have 3 analog channels reading voltages. USB 6008 has a max sampling rate of 10KS/s.
My acquisition vi acquires data at a particular sample rate 1.5KS/s. I read 500 samples. Now, is this read samples per second or per iteration time. My acquisition vi has a 25ms timer. My main vi that gets these values has an iteration time of 100ms. Now how does all of this affect my reading. Will there be any buffer overflow or something?
Let me know if I go this correct.
If sample rate is 1500Hz and I read 500 samples with iteration rate of 1s, then it would take me 3 seconds to read the entire buffer of 1500 samples until the buffer is updated. So, I am in effect reading past values that have been stored in the buffer.
Now, sample rate 1500Hz and I read 500 samples with iteration rate 100ms, then would I be reading values that dont exist?
What is the correct combination I need to use to not see errors.
VJ
12-07-2010 11:21 AM
Hi.
When you tell the VI to read 500 samples, it is per iteration. It will not read samples that do not exist. It will wait until there are 500 samples to read in the buffer.
If you do a finite acquisition of 1500 samples at 1.5kHz sampling rate, and you read 500 samples with an iteration rate of 1s, it will take 3 seconds to read your entire acquisition.
However, if your 1.5kHz acquisition is continuous instead of finite, your sample buffer will overflow eventually, since you are putting in 1500 samples per second, but only reading 500 each second.
I am not sure what the requirements of you application are, but in general, you do not need to add timers to your loops.
Since the VI that reads will wait until there are 500 samples, then if you are acquiring at 1.5kHz, the loop will automatically execute every 1/3 second. Even if you put a 25ms delay in there, the read samples VI will wait until there are 500 samples.
Hope this helps.
AlejandroZ
06-03-2016 08:31 AM - edited 06-03-2016 08:41 AM
Hi,
Very old post, i'm sorry, but i need some more (again) clarifications !
Suppose my acquisition is set to 1500 samples per second , and my number of samples to read at 500. All the 1/3 second my while loop will "read" these 500 samples and empty the buffer .
This is certainly a stupid question , but, if I wire my DAQ with a digital indicator , among these 500 samples , what the indicator will show me ? The final value ?
Or a mean ?
Because if it's the final value, what's the utility of reading 500 samples ?
Second question: if i have multiple daq on my while loop, i'll be lilting/slow down by the slowest acquisition card ?
Third question, setting "continuous sample" is good to avoid buffer overflow or it's still possible ? (because i don't know how)
Thank you very much and sorry for the old post
Erwan
06-03-2016 08:44 AM
A numeric indicator will show you the last value read because it can only store one value at a time; the use of reading more samples is for datalogging and graph purposes, for example if you are logging the data to a non-volatile storage such as a .tdms then said 500 values may contain information that has relevance to your measurements, which is why read VIs have the option to deliver data in n-dimensional array form
06-06-2016 02:54 AM
Understood ! Thank you !
Erwan