User`s manual
XP8500
Software Reference s 39
int plcXP85WrCalib( int Addr,
struct _eioAdcCalib *pCalib )
Writes a calibration structure to the EEPROM storage corresponding
to a channel on the XP8500.
PARAMETERS: Addr is 16*board
_
address +
channel
_
number
. board
_
address ranges from 03, depending on
the address jumpers, and channel
_
number ranges from 010,
depending on the A/D channel number.
pCalib points to a calibration structure, which should be initialized
by calling eioAdcMakeCoeff.
LIBRARY: EZIOPBDV.LIB
Other XP8500 Drivers
The following software drivers from the PLC
_
EXP.LIB library are still
supported by Z-World. Z-World recommends using the newer drivers
from the EZIOCMMN.LIB, EZIOPBDV.LIB, and EZIOPLC.LIB libraries.
int adc4
_
init( unsigned int board
_
adr )
Determines if an XP8500 board is on the PLCBus. If the function call finds
the board, the A/D chip TLC2543 is initialized by enabling its chip-select line.
The chip-select line remains enabled until the board powers down.
PARAMETER: board
_
adr is the physical address of the XP8500
board, defined as 0000 1100 ppxy, where pp is the portion of the
boards address set by a particular PAL and xy is the portion of the
boards address set with jumpers.
RETURN VALUE: 1 if the specified XP8500 board is on the
PLCBus; 0 if it cannot be found.
int adc4
_
read( unsigned int board
_
adr, int chan )
Enables an analog-input channel, chan, and reads the A/D data
conversion for the specified channel.
PARAMETERS: board
_
adr is the physical address of the XP8500
board, defined as 0000 1100 ppxy.
chan ranges from 0 to 10, corresponding to the boards 11 A/D
channels. In addition, passing channel numbers above 10 will access
the A/D chips internal nodes: passing chan = 11 will return (VREF+
VREF)/2, passing chan = 12 will return VREF, and passing chan
= 13 will return VREF+. All data defaults to 12 bits unipolar mode,
with the most significant bit first. The nominal zero point is 4095 for
unipolar input and 2047 for bipolar input.
RETURN VALUE: whole number from 0 to 4095, 1 if the specified
XP8500 board cannot be found.