National Instruments Low-Cost Multifunction I/O Board for ISA Lab-PC+ User Manual

Page 174

Advertising
background image

Register-Level Programming

Appendix E

Lab-PC+ User Manual

E-18

© National Instruments Corporation

acquisition operation is fully configured. Use the following sequence to configure the Lab-PC+
for interval scanning:

1. Write the configuration value indicating the highest channel number in the scan sequence, the

gain, and the input polarity to the Analog Configuration Register. The SCANEN bit must be
clear during this first write to the Analog Configuration Register. Immediately write a 0 to
the INTSCAN bit in the Command Register 4. The EOIRCV bit should be configured with
the desired value. These two writes should be performed prior to any other configuration
steps.

2. Configure the remainder of the data acquisition circuitry as specified in any of the previous

outlines.

3. After programming the sample-interval counter (Counter A0) or configuring the circuitry to

use EXTCONV*, configure the interval-scanning counter (Counter B1), if necessary. Use
the following sequence to program this counter. All writes are 8-bit write operations. All
values given are hexadecimal.

a. Write 74 to the Counter B Mode Register (select Mode 2).

b. Write the least significant byte of the scan-interval count to the Counter B1 Data

Register.

c. Write the most significant byte of the scan-interval count to the Counter B1 Data

Register.

If you intend to use Counter B1 to generate your scan-interval pulses, remember to connect a
source to the CLKB1 line on the I/O connector.

4. Finally, take the Analog Configuration Register bit pattern used in step 1, set the SCANEN

bit, and write the value to the Analog Configuration Register. As soon as this value is
written, the interval-scanning circuitry is gated on. A channel-scanning cycle will commence
immediately following the first rising edge that occurs on OUTB1 (after SCANEN is set).
Subsequent channel-scanning cycles will then commence at the interval determined by the
signal on OUTB1.

Programming Multiple A/D Conversions in Single-Channel
Interval Acquisition Mode

The Lab-PC+ can perform interval sampling on a single input channel. You enable single-
channel interval acquisition by setting the INTSCAN bit in Command Register 4 and clearing the
SCANEN bit in Command Register 1. Counter B1 determines the interval, just as in the interval
scan mode. You must program the number of samples to be taken between each interval in the
Interval Counter. The interval counter is armed when you write a count of N in the Interval
Counter Data Register and strobe the count into the counter. You must then program Counter B1
for the interval, which should be greater than (N * sample interval). A software trigger starts the
sampling sequence. The Lab-PC+ takes N samples on the specified channel, after which
acquisition halts until the next interval pulse is generated on OUTB1. The Lab-PC+ takes

Advertising