Instruction manual
AMPDIO DRIVERS
Page 38
This function accepts an array of values as its data. The number of values supplied depends on
the number of channels enabled in the channel mask. For example, if the channel mask is set to 5
(101
2
), then an array of two values is required where:
Array element [0] is the data for channel 0.
Array element [1] is the data for channel 2.
3.3.7 Configuring Analogue Resources on PCI Cards
As the PCI analogue acquisition cards do not have jumpers, there are a number of functions that
allow the analogue hardware to be configured.
The AIOsetHWADCchanMode and AIOsetHWDACchanMode functions (described in sections
6.4.18.1 and 6.4.18.12) determine whether on card channel hardware is configured as unipolar or
bipolar. These functions do not affect the way the software converts data for the channels. For data
to be converted correctly, each channel’s hardware setting should agree with its software setting —
see section 3.3.4.
The AIOsetHWADCchanDiff function (described in section 6.4.18.7) determines whether input
channels are single-ended or differential. Settings are interpreted in a card type-specific way. In
single-ended mode, the channel reads the input voltage with respect to a fixed reference (analogue
ground reference). In differential mode the channels reads difference in the input voltage compared
to another input pin (single-ended channels are paired up to form differential channels). The
differential input mode of the PCI230 and PCI260 cards is actually pseudo-differential — it takes a
reading from each of the two inputs with respect to the analogue ground reference and subtracts
them.
The AIOsetHWADCchanGain function (see section 6.4.18.9) allows different gains to be
associated with different input channels. The setting is interpreted in a card type-specific way. On
the PCI230 and PCI260 each pair of channels (0&1, 2&3, etc.) has its own gain setting.
The AIOsetHWDACchanRange function (see section 6.4.18.16) allows different ranges to be
selected. The setting is interpreted in a card type-specific way. On the PCI224, it allows the output
range to be set for the whole card, but there is no control over the output ranges of individual
channels. On the PCI234, the output range is determined by a jumper setting and this function has
no effect. It is not supported on any other cards.
3.4 Using Interrupts
There are a number of functions provided by the library that use interrupts to do specific tasks.
There is also a mechanism supported by the library that allows user functions to be called on
interrupt. The easiest way to use interrupts is to use one of the supplied interrupt functions.
3.4.1 Event Recorder
Using this function, it is possible to use a stopwatch (as described in section 3.1.4) to record the
elapsed times when an external event occurs. In order to do this, the event's status output must be
connected to an 82C55 digital input’s port C0. A low-to-high transition on this pin causes an
interrupt to occur. The driver-supplied interrupt service routine reads the elapsed time from the
stopwatch timer/counters and store the time into memory.
The TCsetEventRecorder function (see section 6.4.7.4) allows you to specify a digital input chip
(PPIX or PPIY) from which Port C bit 0 will be used as the event input, and interrupt source. Once
the board's interrupt has been enabled (see function enableInterrupts — section 6.4.2.1) and a
stopwatch timer has been started, a positive going signal on the PPI Port C bit 0 pin on SK1 will
cause the elapsed time to be recorded into memory.