From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Series M Sample Rate and Number of samples

Solved!
Go to solution

Never had an application for this until now..  I'm trying to read 12 channels differentially..sequentially at one time .  400 Hz is the freq 5vac.

If I understand the specs, using differential readings I have to count each channel separately when it comes to sample rate.  so 25k Samples/sec divided by 24 channels comes out to roughly 10K samples/sec per channel..Thats fine..less than nyquist.   And that means a sample every 100 msec but I have 24 channels so by the time I get from ch 1 to ch 12 roughly 0.2 msec has passed..correct??  And that's just one sample??  If I have my # of samples set to 1000 ( say) it could be 200 msec ( .2 msec*1000 samples) before all 12 channels have read all the data before it is processed??  Can someone show me where it specs and how to read max samples I can have in this particular case?? Could I do 2047 samples?

I know...I know..Simultaneously Sample card !!

Thanks.

0 Kudos
Message 1 of 18
(4,881 Views)

Hi Clint,

 

so 25k Samples/sec divided by 24 channels comes out to roughly 10K samples/sec per channel.

Simple math: 25kS/s / 24 ~= 1kS/s

 

.Thats fine..less than nyquist.

Nyquist says you need atleast twice your main frequency. 1kS/s is more than 2*400Hz…

 

And that means a sample every 100 msec but I have 24 channels so by the time I get from ch 1 to ch 12 roughly 0.2 msec has passed..correct??

A sample rate of 1kS/s means a sample each millisecond - how did you calc for 100msec? This 1kS/s counts for all channels - so how did you calc this "0.2msec"?

 

  And that's just one sample??  If I have my # of samples set to 1000 ( say) it could be 200 msec ( .2 msec*1000 samples) before all 12 channels have read all the data before it is processed??

Simple math: with a sample rate of 1kS/s you need 1s to collect 1k of samples…

 

Can someone show me where it specs and how to read max samples I can have in this particular case??

Please explain "where it specs" and "read max samples"…

 

Could I do 2047 samples?

Yes, sure! Just wire 2047 as the number of samples to read…

Best regards,
GerdW


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

Let's look at your math again.  25kS/s divided by 24 channels is ~1kS/s (trying to keep the math simple).  So this would be a full scan every 1ms (that's right, all of the channels in 1ms).  So 200 samples from all of the channels would be ~200ms.  2047 samples would be a little over 2 seconds.

 

But let's take a step back.  What DAQ are you using?  Do you have options to get a newer model?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 18
(4,862 Views)

Hello Clint1000,

 

the M-series devices normally are multiplex the channels, for example, if the card can 250 KHz and you want to acquire 24 channels in referenced single mode, each channel can be be aquired with 10 KHz. Now you can set the number of samples to acquire, which can be 1000 samples.

 

With this settings 10 KHz and 1000 samples the DAQmx read returns every 100ms a 2D array with 24 channels and in each channel are 1000 values. If the Samples to read are set to 2000 you get every 200ms the 2D array back, but with 2000 values for each channel.

 

Which device is in use and what would you like to implement?

best regards
Alexander
0 Kudos
Message 4 of 18
(4,855 Views)

@GerdW wrote:

Hi Clint,

 

so 25k Samples/sec divided by 24 channels comes out to roughly 10K samples/sec per channel.

Simple math: 25kS/s / 24 ~= 1kS/s

 

.Thats fine..less than nyquist.

Nyquist says you need atleast twice your main frequency. 1kS/s is more than 2*400Hz…

 

And that means a sample every 100 msec but I have 24 channels so by the time I get from ch 1 to ch 12 roughly 0.2 msec has passed..correct??

A sample rate of 1kS/s means a sample each millisecond - how did you calc for 100msec? This 1kS/s counts for all channels - so how did you calc this "0.2msec"?

 

  And that's just one sample??  If I have my # of samples set to 1000 ( say) it could be 200 msec ( .2 msec*1000 samples) before all 12 channels have read all the data before it is processed??

Simple math: with a sample rate of 1kS/s you need 1s to collect 1k of samples…

 

Can someone show me where it specs and how to read max samples I can have in this particular case??

Please explain "where it specs" and "read max samples"…

 

Could I do 2047 samples?

Yes, sure! Just wire 2047 as the number of samples to read…


So right or wrong I try and put this in perspective so that I can understand what is going on..I'm a very visual person  w that said..

I have 12 analog channels connected differentially to my UUT which has 24 outputs. Maybe I'm using the wrong terms but when the analog card (PXI6229) starts reading AI channel 1 its T(zero) and sample 1 of say 1000 .  Now the "scan moves on" to Ai Ch2 and takes sample 1 for that channel.  Its now 100 msec later or 200 msec since ch 1 sample 1 was read.  Now ch3 sample 1 is read.  Its now 300 msec since ch1 sample 1 was read.  By the time I get to my 12th differential ch , 12 (or 24 not sure which) * 100 msec has passed since ch1 sample was read.  I guessing that nothing is done w this data until all the samples ( in my case 1000) is read.  To me 100 msec * 1000 samples is a significant amount of time that passes before anything is done w my readings.  Am I making more out of this than I should??  How big is the buffer , aggregate , on the 6229??  I'm guessing I can't have an infinite buffer so I was asking how large a number can I set in my situation of 12 differential channels..So my question was where is this in the data sheet??  Hope this is a little clearer.  I had a post in another part of discussion forum (http://forums.ni.com/t5/LabVIEW/Phase-measurement-of-Synchros/m-p/3593791) that made me start questioning the ability to do what I was doing and it seemed more appropriate to post that question here.

0 Kudos
Message 5 of 18
(4,838 Views)

Yes, and sorry my math was off...It should have been 1kS/sec NOT 10kS/sec..

0 Kudos
Message 6 of 18
(4,836 Views)
Solution
Accepted by topic author Clint1000

Ok, go read this white paper: Maximum Sample Rate in Differential Mode

 

Summary: In differential mode, it is still just a single sample of the ADC.  So if you have 12 differential channels, it is only 12 readings being performed.

 

So lets go through the math again.  If you run at the 250kS/s (maximum for the PXI-6229), that will give you an effective sample rate of 20kS/s (rounding down for easier math).  That will give you a full scan of the channels every 50us.  So to perform 1000 samples for all channels, it will be 50ms.  Is that fast enough for you?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 18
(4,829 Views)

Hello Clint1000,

 

if you want the delay between ch1 s1 and ch2 s1 this time is sheduled from the convert clock and can be read out with a property

How is the Convert (Channel) Clock Rate Determined in NI-DAQmx and Traditional NI-DAQ (Legacy)?

The Input FIFO size 4,095 samples on the card, but this is for the transfer then the onboard RAM in the PC is the buffer which holds the values.

 

best regards
Alexander
0 Kudos
Message 8 of 18
(4,827 Views)

I don't want to doubt you but if I interpret the white paper correctly...

 

"Yes, Multifunction DAQ cards from National Instruments (M Series, E Series, and Compact DAQ) can sample differentially at their maximum rate on a single channel. A differential measurement and a single-ended measurement only differ in the way that the negative terminal of the ADC is connected ( to ch0- and ground, respectively). In both differential and single-ended configurations, the ADC makes only one conversion per channel, therefore input configuration does not affect the maximum sample rate that you can achieve.

 

This, to me, means if I have ONE differential channel I taking a measurement on..

 

BUT..

 

On the other hand, when measuring multiple channels, whether they are single-ended or differential, the signals are multiplexed into a single ADC which causes the effective per-channel sample rate to be the maximum sample rate of the ADC divided by the number of channels.

And to me means I have 12 differential ( measure at one time.."multiple channels") or 24 channels I have to divide the sample rate up into..250 kS/s divided by 24= 10 kS/s =100 microsec per sample  x 1000 samples=100 msec for all channels..no??

 

And my second question how many samples can I take??  Is the max 1024?

0 Kudos
Message 9 of 18
(4,815 Views)

@Clint1000 wrote:

And to me means I have 12 differential ( measure at one time.."multiple channels") or 24 channels I have to divide the sample rate up into..250 kS/s divided by 24= 10 kS/s =100 microsec per sample  x 1000 samples=100 msec for all channels..no??

 

And my second question how many samples can I take??  Is the max 1024?


No, you have 12 channels.  The MUX has a negative side as well, so it will connect either AI GND or the negative channel along with the positive side.  So your effective sample rate is 250kS/s / 12 channels = 20kS/s.

 

The maximum number of samples is based on the available buffer.  Looking at the specification, it has a 4096 sample FIFO.  Divide that by your 12 channels and you get 341 scans that can be stored on the board itself.  I cannot speak for what buffers the DAQmx driver adds for you using Windows memory.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 18
(4,810 Views)