User`s manual
XP890058 s Software Reference
Operate Target Board
int plcXP89Sw( int Addr, int state )
Turns the D/A converters and references to op-amps on or off. Note
that all channels on a particular board are switched at the same time.
PARAMETERS: Addr is the logical address, 07, of the board set by
jumpers. Both the reference (switched on by this call) and the D/A
converter output (switched off by this call, switched on by plcX89Out)
must be set correctly to get the proper output.
state indicates whether the D/A converter and reference voltage
should be turned on or off. The reference is turned on when state is
nonzero. Otherwise the D/A converters will tristate and the reference
will output0. The output voltage of all channels should be approxi-
mately 0 at the op-amp when the D/A converter is off.
RETURN VALUE: 1 if the board cannot be found, 0 if the operation
is completed.
LIBRARY: EZIOPBDV.LIB
The XP8900 output voltages may fluctuate to 2 V for each
channel while plcX89Sw is executing to turn on the op-amp
reference and to switch off the D/A converter.
int plcXP89Out( int Addr, unsigned int oValue )
Sends the 12-bit oValue to the proper D/A converter channel. Call
plcXP89Init and plcXP89Sw before calling plcXP89Out. Note that
plcXP89Out does not switch the voltage reference on or off. Both the
D/A converter and the voltage reference must be set up correctly to get
the proper voltage output. plcXP89Sw enables the voltage reference.
PARAMETERS: Addr is 8*board
_
number + channel
_
number. Note
that board_number and channel_number start from zero. board_number
ranges from 0 to 7 as set by the address jumpers. channel_number
ranges from 0 to 7 (XP8900), or from 0 to 3 (XP8910).
oValue is the 12-bit value to send to the D/A converter.
RETURN VALUE: 1 if the D/A converter cannot be found, 0 if the
operation is successful. If the D/A converter does not exist, this
function also bit-ors the constant EIO
_
NODEV to eioErrorCode.
LIBRARY: EZIOPBDV.LIB
!
plcXP89Out(42,2048)
// make channel 2 on board 5 output about 0 V