Objectives
Introduction
Preliminary Information
It is very important to collect preliminary information prior to attempting serial communications with the TXD/TXDU instructions. Examine the external serial device and gather the following key information:
- Baud Rate (300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200)
- Data Bits (7, 8)
- Stop Bits (1, 2)
- Parity (Even, Odd, None)
- Communication pin/connection assignments and RS/ER signal control
- Start Code, End Code details (if present and what)
General Procedure
1. Connect the serial communications signals with the appropriate cable ensuring proper wiring
2. Adjust the PLC Setup or Unit Setup to configure the RS-232 Port for Baud Rate, Data and Stop Bits, Parity and RS-232C/No-Protocol Mode (check PLC dip switch settings when applicable)
3. Create and execute the program utilizing the TXD/TXDU instruction
Other Tips and Common Mistakes
Wiring/Pin Assignment Mistakes
The images below depict several 9-pin assignments for common Omron Serial Ports:
CP1W-CIF01
CJ1 Built-In RS-232C Port
Serial Communication Units
Dip Switch Positions
Check the positions of dip switches on the CPU if using a built-in or option board serial port. These switches may override the mode of the port chosen in the PLC setup.
Start Code/End Code
The start code determines the beginning of the incoming message to the device. If this is incorrect, the external device will ignore the message. The End Code determines the end of the incoming message to the device such as a carriage return, line feed (CR, LF). If this is incorrect, overflow conditions may occur. Some devices rely on a specified amount of data to be received as the End Code indication. It is important to understand these details about the external device before attempting to transmit data.
Use a Terminal Emulator
There are several software programs that allow a PC to receive data transmitted from the PLC when executing a TXD/TXDU instruction (a serial port is required). This is helpful to examine the data being sent from the PLC and also to confirm settings. A few software programs for serial data examination are listed below:
- Hyperterminal (installed with some Windows operating systems)
- MultiWay link
LED indicators
Carefully examining the transmit and receive indicators on the PLC system at the moment of TXD/TXDU execution can be a simple indication that data is being sent.
Cycle Power After PLC Settings
Sometimes, cycling power after making PLC Setup changes is required for the settings to take effect
Summary