Handshaking – Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 42

Advertising
background image

Chapter
Using the Communication Ports

2

2 -4

The BASIC module support both hardware and software handshaking.
You turn hardware and software handshaking on and off through the
MODE statement (page 11 -20).

Software Handshaking

The BASIC module uses these rules when software handshaking is
enabled:

When the BASIC module receives an XOFF from the external device, it

is recognized immediately and the BASIC module stops sending
characters from the transmit buffer to the UART. However, if there are
any characters already in the UART, these characters are sent to the
external device. The BASIC module continues sending new characters
to the transmit buffer (if PRINT statements are executed). If the
transmit buffer becomes full (i.e., 256 characters waiting to be
transmitted before it receives an XON), then BASIC pauses (while
executing the PRINT statement) until space is available in the transmit
buffer.

The BASIC module constantly monitors the number of characters in its

receive buffers. If the receive buffer accumulates 192 characters before
any are serviced by the BASIC program, it sends an XOFF to the
external device. The safety margin of 64 characters in the buffer
ensures the BASIC module can accommodate additional characters in
case the external device does not acknowledge the XOFF immediately
and continues to transmit. When characters are serviced by the BASIC
program and the receive buffer contains less than 128 characters, the
BASIC module sends an XON to the external device to allow new
characters to be received.

Important: The BASIC module automatically initiates XON/OFF codes
when software handshaking is enabled. Do not attempt to generate these
codes from the BASIC program or you could cause the serial ports to
appear to be “locked-up.”

Important: If you are receiving non-ASCII data from an external device,
we recommend that you do not use software handshaking. If software
handshaking is enabled and the external device happens to transmit data
that is equivalent to the code for XOFF, the BASIC module stops
transmitting the characters and appears to be “locked-up.”

Handshaking

Advertising