Chapter 5 Programming
AT-MIO-16X User Manual 5-14
©
National Instruments Corporation
Setting the SCANEN bit in conjunction with the DAQEN bit in
Command Register 1 enables scanning during multiple A/D
conversions. The SCANEN bit must be set regardless of the type of
scanning used (continuous or interval); otherwise, only a single channel
is scanned.
Setting the SCN2 bit in Command Register 1 enables the use of a scan
interval during multiple A/D conversions. The scan-interval counter
gives each cycle through the scan sequence a time interval. The
scan-interval counter begins counting at the start of the scan sequence
programmed into the channel configuration memory. When the scan
sequence terminates, the next cycle through the scan sequence does not
begin until the scan-interval counter has reached its terminal count.
Be sure that the scan-interval counter allows enough time for all
conversions in a scan sequence to occur so that conversions are not
missed.
Data Acquisition Programming Functions
This section provides a detailed explanation of the functions necessary
to program the analog input for single and multiple channel A/D
conversions.
Clearing the Analog Input Circuitry
The analog input circuitry can be cleared by strobing the DAQ Clear
Register. This operation leaves the analog input circuitry in the
following state:
• Analog input error flags OVERFLOW and OVERRUN are cleared
• Pending data acquisition interrupt requests are cleared
• ADC FIFO is emptied
• DAQCOMP flag in the Status Register is cleared
Empty the ADC FIFO before starting any A/D conversions. This action
guarantees that the A/D conversion results read from the FIFO are the
results from the initiated conversions and are not left over results from
previous conversions.