52 Chapter 1
Programming Fundamentals
Overview of RS-232 (Option 1AX)
Overview of RS-232 (Option 1AX)
Serial interface programming techniques are similar to most general I/O
applications. Due to the asynchronous nature of serial I/O operations, special care
must be exercised to ensure that data is not lost by sending to another device before
the device is ready to receive. Modem line handshaking can he used to help solve
this problem. These and other topics are discussed in greater detail in your
programming language documentation.
Settings for the Serial Interface
Please refer to the documentation on your computer and I/O to configure the serial
interface. Some common serial interface configuration settings are:
Handshake and Baud Rate
To determine hardware operating parameters, you need to know the answer for
each of the following questions about the peripheral device:
• Which of the following signal and control lines are actively used during
communication with the peripheral?
— Data Set Ready (DSR)
— Clear to Send (CTS)
• What baud rate is expected by the peripheral?
Character Format Parameters
To define the character format, you must know the requirements of the peripheral
device for the following parameters:
• Character Length: Eight data bits are used for each character, excluding start,
stop, and parity bits.
• Parity Enable: Parity is disabled (absent) for each character.
• Stop Bits: One stop bit is included with each character.
Baud Rate to 9600
Bits per character to 8
Parity to Odd or disabled
Stop bits to 1