User`s manual

XP8600 Software Reference s 33
Advanced Programming
Functions in PLC_EXP.LIB
int plcdac_addr( int bd )
Converts logical board address 063 to 12-bit (3-nibble) PLCBus
analog address.
RETURN VALUE: 12-bit (nibble-interchanged) bus address for an
XP8600 identified by a logical address (063).
void plc_fdac1( int dac_value )
void plc_sdac1( int dac_value )
Each of these routines writes data serially to DAC1 (U3) on the
presently addressed XP8600. These functions are equivalent and may
be used interchangeably. However, plc_fdac1 is slightly faster,
whereas plc_sdac1 is smaller (50 bytes vs. 130). A call to one of
these functions must be followed by a call to plc_latch1or its
equivalent in user-supplied codeotherwise no digital-to-analog
conversion occurs.
void plc_fdac2( int dac_value )
void plc_sdac2( int dac_value )
Each of these routines writes data (serially) to DAC2 (U4) on the
presently addressed XP8600. These functions are equivalent and may
be used interchangeably. However, plc_fdac2 is slightly faster,
whereas plc_sdac2 is smaller (50 bytes vs. 130). A call to one of
these functions must be followed by a call to plc_latch2or its
equivalent in user-supplied codeotherwise no digital-to-analog
conversion occurs.
void dac_latch1()
Transfers the data in Register A of DAC1 (U3) to Register B of DAC1,
whereupon the data are converted and the analog signal is output. A
call to this function must be preceded by a call to plc_fdac1 or
plc_sdac1or their equivalent in user-supplied code.
void dac_latch2()
Transfers the data in Register A of DAC2 (U3) to Register B of DAC2,
whereupon the data are converted and the analog signal is output. A
call to this function must be preceded by a call to plc_fdac2 or
plc_sdac2or their equivalent in user-supplied code.
void dac_init()
Initializes the presently addressed XP8600. Sets both D/A converter
outputs to zero. Board must be currently addressed on PLCBus with
set12adr().