User`s manual

PK220038 s System Development
Serial Communication
Dynamic C has serial communication support libraries. For the Z180 port
z0 and Z180 port z1, use AASC.LIB, Z0232.LIB, and Z1232.LIB. For
RS-232 expansion cards that interfaced through the PLCBus on the
PK2200, use EZIOPLC.LIB.
Functional support for serial communication includes the following:
Initialization of the serial ports
Monitoring, and reading, a circular receive buffer
Monitoring, and writing to, a circular transmit buffer
An echo option
CTS (clear to send) and RTS (request to send) control for
RS-232.
XMODEM protocol for downloading and uploading data
A modem option
The PK2200 can be configured for either two RS-232
channels or one RS-232 and one RS-485. Z0 is RS-232
only and Z1 may be configured for RS-232 or RS-485.
See Chapter 3 for information on configuring the serial
communication channels.
Z180 Port Z0 is configured at the factory for RS-232
and Port Z1 is configured for RS-485.
Receive and Transmit Buffers
Serial communication is made easier with a background interrupt routine
that updates receive and transmit buffers. Every time a port receives
another character, the interrupt routine places it into the receive buffer. A
program can read the data one character at a time or as a stream of
characters terminated by a special character.
A program sends data by writing characters into the transmit buffer. If the
serial port is not already transmitting, the write functions automatically
initiate the transmission. Once the last character of the buffer is sent, the
transmit interrupt is turned off. Data can be written one character at a
time or as a stream of characters.
!
FD