Instruction manual

AMPDIO DRIVERS
Page 37
Cooked data to be written to a DAC channel is uncooked in a card-specific way by the driver
before being output to the DAC. Raw data read from an ADC channel by the driver is cooked in a
card-specific way before being passed to the user.
The cooking or uncooking of data depends on the mode the channel is in, either unipolar or bipolar.
In general, the cooked data ranges are as follows:
Unipolar: 0 to 65535 (0 volts to max volts)
Bipolar: 32768 to +32767 (max volts to +max volts)
For cards which have DAC or ADC channels which cannot be set to unipolar mode in hardware
(e.g. PCI234), the above unipolar range is reinterpreted so that 0 maps to the minimum voltage (
max volts).
For cards which have DAC or ADC channels which cannot be set to bipolar mode in hardware, it is
intended for the above bipolar range to be reinterpreted so that 32768 maps to 0 volts.
Unfortunately, this reinterpretation of the bipolar range is not performed for the PC25E. This is
because the AMPDIO software does not currently distinguish the PC25E from the PC24E and the
PC24E does support bipolar mode in hardware (via jumper settings).
The above functions accept a ChanMask parameter that determines which channel(s) to configure.
There are also the AIOsetAllADCchanMode and AIOsetAllDACchanMode functions that allow all
channels in a group to be configured the same way (see sections 6.4.18.5 and 6.4.18.14). It is
more likely that these functions will be used, as on most cards, as on most cards all channels have
to be set as either unipolar or bipolar, and a mixture is not supported.
As well as configuring the software in bipolar/unipolar mode, it is also necessary to configure the
analogue hardware using on card jumpers or the specially provided hardware configuration
functions. If this is not done, output voltages or input readings may not be as expected. On the
supported PCI cards, the AIOsetAllADCchanMode and AIOsetAllDACchanMode will change the
hardware settings to match the software unipolar/bipolar configuration. There are also
AIOsetHWADCchanMode and AIOsetHWDACchanMode functions to change the hardware
unipolar/bipolar settings in a card-specific way without affecting the software unipolar/bipolar
settings (see sections 6.4.18.4 and 6.4.18.13).
3.3.5 Basic Analogue Input
In order to read an analogue voltage, the ADC channel group’s conversion source must be
configured. The AIOsetADCconvSource function (see section 6.4.19.1) allows the conversion
source to be specified. It is usual to set this to software conversion (CNV_SW) unless interrupts
are being used. For ISA cards, the selected conversion source should agree with the jumper
settings.
Once software conversion has been configured, the required analogue channel can be selected
using the AIOsetADCmultiplexer function and a software-trigger conversion can be started with the
AIOstartADCconversion function. The analogue data can then be read using AIOgetADCdata (see
section 6.4.19). It is possible to call AIOsetADCmultiplexer between calls to
AIOstartADCconversion and AIOgetADCdata. The data read is from the channel that was active
when AIOstartADCconversion was called.
3.3.6 Basic Analogue Output
The AIOsetDACchanData function (see section 6.4.20.1) is used to write to digital-to-analogue
convertors. The value written depends on whether the channel is unipolar or bipolar. The output
voltage or current produced will depend on what card type is used and how it is configured.