User`s manual
XP860036 s Software Reference
Use the following steps to run the sample program.
1. Compile the program by pressing F3 or by choosing Compile from the
COMPILE menu. Dynamic C compiles and downloads the program
into the controllers memory. During compilation, Dynamic C rapidly
displays several messages in the compiling window, which is normal.
2. Run the program by pressing F9 or by choosing Run from the RUN
menu. It is also possible to single-step through the program with F7 or
F8.
3. To halt the program, press <CTRL-Z>.
4. To restart the program, press F9.
Check the board jumpers, PLCBus connections, and the PC/
controller communications if an error message appears.
See the Dynamic C Technical Reference manual for more
detailed instructions.
Functions in PBUS
_
LG.LIB
int DAC
_
Board_Addr( int bd )
Converts a logical D/A converter board address to a physical PLCBus
address.
PARAMETER: bd must be a number between 0 and 63 representing
the D/A converter board to access. This number has the binary form
pppzyx where ppp is determined by the board PAL number and x, y,
and z are determined by jumper block J3 on the board. ppp values of
000, 001, 010, etc., correspond to PAL numbers of FPO4800,
FPO4810, FPO4820, etc.; x, y, and z correspond to jumper block J3
pins 12, 34, and 56, respectively (0 = closed, 1 = open). The
resulting address is in the form pppx001y000z.
RETURN VALUE: Nibble-interchanged PLCBus address of the board
specified. This address may be passed directly to PBus12_Addr.
void write
_
DAC1( int val )
Writes data serially to DAC1 (U3) on the presently addressed XP8600.
The board address must have been set previously with a call to
PBus12
_
Addr. A call to one of these functions must be followed by a
call to latch
_
DAC1or its equivalent in user-supplied code
otherwise no digital-to-analog conversion occurs.
!
$