User`s manual

XP8500
Software Reference s 37
XP8500 Drivers
Use the software drivers in this section to interface with the XP8500.
int plcXP85Init( unsigned Addr )
Resets the selected XP8500 and reads back the associated calibration
coefficients into an internal array.
PARAMETER: Addr is the jumper-selected address of the board (0
7).
RETURN VALUE: 0 if the reset is successful, -1 if the board cannot
be found.
LIBRARY: EZIOPBDV.LIB
int plcXP85In( unsigned int address )
Reads an XP8500 A/D converter channel. Note that this function
reads back only the raw valueuse plcXP85InC to read back a
calibrated value.
PARAMETER: address is 16*board
_
address +
channel
_
number
. board
_
address ranges from 03, depending on
the address jumpers, and channel
_
number ranges from 010,
depending on the A/D channel number.
RETURN VALUE: whole number from 0 to 4095, 1 if the XP8500
board is not found. The global variable eioErrorCode is bit-ored
with EIO
_
NODEV if the board is not found.
LIBRARY: EZIOPBDV.LIB
float plcXP85InC( unsigned int address )
Reads an XP8500 A/D converter channel and converts the value to a
calibrated value using the constants read by eioAdc4Init. Note that
eioAdc4Init must be called before plcXP85InC. Use plcXP85In
to read back a raw value.
PARAMETER: address is 16*board
_
address +
channel
_
number
. board
_
address ranges from 03, depending on
the address jumpers, and channel
_
number ranges from 010,
depending on the A/D channel number.
RETURN VALUE: floating-point number that represents the cali-
brated value read by the A/D channel. The global variable
eioErrorCode is bit-ored with EIO
_
NODEV if the board is not found.
LIBRARY: EZIOPBDV.LIB