LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What information is stored/pulled from a buffer

Hi I have created a VI which reads and writes data continuously from multiple channels. I have used DAQ mx timing and DAQ mx read with analog, 1D, waveform, N samples, N channels. I know that the sample rate determines how many samples will be taken per second (eg: 1000Hz = 1000 samples per second). I know that the number of samples per channel is the number of samples that will be pulled from a buffer each iteration and determines your buffer size.

 

Questions below refer to 1000Hz sample rate and 100 samples per channel.

My question is how exactly does the data get pulled and stored from the buffer?

If 100 samples out of 1000 taken in a second are stored in a buffer, is it the first 100 samples that are stored or is it random?

After the 100 samples are stored is the output from the buffer an average of the 100 samples taken or is the output 100 different samples of data and in what order?

 

Thanks for any help!

0 Kudos
Message 1 of 4
(2,476 Views)

Hi cwel,

 

I know that the sample rate determines how many samples will be taken per second (eg: 1000Hz = 1000 samples per second). I know that the number of samples per channel is the number of samples that will be pulled from a buffer each iteration

So you know the basics: "iteration time = samplerate * number of samples"…

 

and determines your buffer size.

Are you sure about this? "Number of samples to read" only determines the "number of sample to read"!

 

My question is how exactly does the data get pulled and stored from the buffer?

It's like a (size-limited) FIFO.

 

If 100 samples out of 1000 taken in a second are stored in a buffer, is it the first 100 samples that are stored or is it random?

Surely you read the oldest samples as they are put into the buffer "in order"!

 

After the 100 samples are stored is the output from the buffer an average of the 100 samples taken

Why should you get an average???

 

is the output 100 different samples of data

Yes, sure!

 

and in what order?

Oldest samples first: "size-limited FIFO"!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,449 Views)

Hey GerdW,

 

Thanks for the response!

A size limited FIFO makes a lot of sense. With respect to the previous example of 1000 Hz and 100 samples per channel.

 

Does that mean if I have 1000 Hz sample rate, in the first second the first 100 samples will be stored in a buffer and the other 900 disregarded. Then the buffer will output those 100 samples in the order that they arrived (FIFO)?
Therefore on average the program will record data every 10 milliseconds (1000Hz/100 samples = 10 )?

0 Kudos
Message 3 of 4
(2,417 Views)

Hi cwel,

 

Does that mean if I have 1000 Hz sample rate, in the first second the first 100 samples will be stored in a buffer

The first 100 samples will be put into the buffer in just 0.1s! (100 samples / 1kS/s = 0.1s!)

 

and the other 900 disregarded.

Why should the be disregarded? They are also put into the buffer!

 

Then the buffer will output those 100 samples in the order that they arrived (FIFO)?

Yes, you read them in the order they arrived…

 

Therefore on average the program will record data every 10 milliseconds (1000Hz/100 samples = 10 )?

Wrong in two ways:

- "on average" is wrong, it's "exactly" because of the hardware timing of your DAQ device!

- "10 ms" is wrong, because of 100 samples / 1kHz = 100 samples / 1000 samples/s = 0.1s… (Didn't you learn how to handle units?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,406 Views)