User`s manual

Exp-A/D12
Software Reference s 69
General Exp-A/D12 Functions
There are several functions specific to Exp-A/D12 boards in PLC
_
EXP.LIB.
Use the higher level functions that reference the signal table.
int add
_
sig
_
table( int entry, int addr,
int in
_
ch, int mode, int comp )
Fills in an entry in the signal table.
PARAMETERS: entry selects table entry.
addr is the 12-bit PLCBus address of Exp-A/D12.
in
_
ch is the input channel to read (07).
mode is the conversion mode (gain and polarity) (017).
comp 1 = use EEPROM compensation coefficients,
0 = no compensation.
RETURN VALUE:
0 signal data successfully entered in table
1 EEPROM hardware error
2 EEPROM write-protect error
3 invalid parameter used
int plcad
_
addr( int board )
Returns the 12-bit (nibble-interchanged) bus address for an
Exp-A/D-12 board identified by board, a logical address (063).
A/D Conversion
float ad
_
conv( int entry, int value )
Returns the voltage represented by a 12-bit A/D input value, assum-
ing a 2.5 V scale. The term entry identifies the signal in the signal
table. If the signal table entry specifies compensation for the signal,
the function computes its value using the entrys calibration coeffi-
cients, otherwise it uses a standard set of coefficients.
int plad
_
rd12( int mode )
Returns a 12-bit A/D value read from the A/D converter chip.
mode specifies one of the A/D conversion modes (017) to use.
To use this function, make sure that (1) the address of the Exp-A/
D12s B register is placed on the bus and (2) one of the eight input
channels has been selected.
Higher level functions are available.