Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

What does "samples to read" really means

Solved!
Go to solution

Hi, all,

 

I'm using a PCI-6259 DAQ card right now to read data from multiple channels. However, I don't really understand the "sample to read" node in "DAQmx read.vi".

 

In my opinion, if I use the DAQ to sample multiple channels, this "sample to read" would be the number of samples per channel.  But I'm not sure if the sampling is simultaneously or not? If not, how to make simultaneous samples for different channels? According to the user mannual, the DAQ should support simultaneous sample of difference channels, or I was wrong? 

 

Kind regards,

Rui

0 Kudos
Message 1 of 7
(4,287 Views)

The specs and manual are pretty clear that it is not a simultaneously sampled board. When you sample multiple channels, there will be a small inter-channel delay between each channel.

 

When you specify multiple channels to read, the number of samples refers to samples of each channel.

Message 2 of 7
(4,282 Views)

Thank you.

 

So if I want the inter-channel delay to be small, I can just reduce the number of sample per channel, is that correct?

0 Kudos
Message 3 of 7
(4,279 Views)

No, not at all. It is affected by the sample rate. See this.

Message 4 of 7
(4,276 Views)
Solution
Accepted by topic author rui0632

There are three parameters that control the timing of an acquisition in DAQmx:

 

Sample Rate

This controls how fast samples are taken.  This is specified in terms of Samples per Second.

samplerate.PNG

 

Samples Per Channel

For a finite acquisition, this is the total number of samples that your program will acquire.  For a continuous acquisition, this is just used to help determine the buffer size.

Samples per Channel.PNG

 

Samples to Read

This is a setting on the DAQmx Read VI.  This determines how many samples per channel are returned each time that Read VI is called.  A value of "-1" returns all the samples that are available.  If the specified number of samples aren't available with the Read VI is called, the Read VI will block until the samples are available, or until the time that is wired to the "timeout" terminal elapses.

 samplestoread.PNG

 

So, for example, if we have an application with the following parameters:

Samples Rate = 1000 S/s

Samples per Channel = 5000

Samples to Read = 100

 

Then the  application will gather 5000 total samples at a rate of 1000 samples per second.  The total acquisition will thus take 5 seconds.

We will need to call the Read VI 50 times, because each time we call the VI, it will return 100 of the available samples.

 

Inter-channel delay is controlled by the  AI Convert Clock Rate property.  The smallest value it can be set to is the inverse maximum aggregate sampling rate for your board.  The default rate is 10uS to allow for additional settling time, unless your sampling rate is above  100 kS/s, in which case we use the smallest possible value.

 

So, for example, my PCI-6289 has a maximum aggregate sampling rate of 500 kS/s (as indicated by the specifications.)  So, my minimum inter-channel delay is the inverse of 500 kHz, or 2 uS.

 

You can set the AI Convert Clock Rate using the DAQmx Timing Property Node:

 convertclock.PNG

 

Hope this clarifies things!

Message Edited by Seth B. on 03-24-2010 01:09 PM
Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
Message 5 of 7
(4,272 Views)
What if I have a board which can do simultaneous sampling, how can I set these nodes to do simultaneous sampling for all the channels?
0 Kudos
Message 6 of 7
(4,260 Views)

If you have a board that does simultaneous sampling, such as one of our S Series boards, DSA boards, or a simultaneously sampled X Series board, then simultaneous sampling happens by default.  The AI Convert Clock Rate property isn't supported because the boards always sample simultaneously.  The property will return an error if you try to set it on a simultaneously sampled board.

 

Regards,

Message Edited by Seth B. on 03-24-2010 02:23 PM
Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 7 of 7
(4,252 Views)