Chapter 2 Function Reference — SCAN_Sequence_Setup
NI-DAQ FRM for PC Compatibles 2-306
©
National Instruments Corporation
The scan sequence created by NI-DAQ looks like this:
scan number: 1 2 3 4
channels sampled: 2, 5, 7, 2, 2, 5, 2
scansPerSequence = 4
samplesPerSequence = 7
If your base scan rate is 1,000 scans/s, channel 2 is sampled at 1,000 S/s, channel 5 is sampled
at 500 S/s, and channel 7 is sampled at 250 S/s.
ScansPerSequence and samplesPerSequence are used to calculate the size of your
acquisition buffer. Your buffer size must be an integer multiple of samplesPerSequence. Use
ScansPerSequence to size your buffer to hold some unit of time’s worth of data. For example,
to figure out the size of a buffer in units of samples and to hold N seconds of data, use the
following formula:
bufferSize = N * (scanRate / scansPerSequence) * samplesPerSequence
The bufferSize returned by the above formula will have to be rounded up so that it is a multiple
of the samplesPerSequence if scansPerSequence does not divide evenly into scanRate.
In this example, your buffer size must be a multiple of 7. The number of samples your buffer
must hold to contain 5 s of data at a base scan rate of 1,000 scans/s is:
5 * (1,000 / 4) * 7 = 8,750 S.