A User’s Guide to Configuring Serial Ports for DirectLOGIC PLCs: Part Two
In the previous issue of Automation Notebook, Winter 2005 Issue 3, we discussed the communications capabilities of Port 2 on the DL06, DL250-1 and DL260 DirectLOGIC CPUs. We covered networking, wiring diagrams and protocols. In this issue we will discuss how to configure the communication port using DirectSOFT programming software while connected to the CPU.
Configuring Port 2
In the DirectSOFT software menu, select PLC (1). Then from the drop-down menu select Setup (2), then Setup Sec. Comm Port (3), as shown in figure 1.
The setup window (shown in figure 2) will appear.
There are three protocols available: standard, non-sequence and remote I/O. Each of these protocols will require some configuration.
Standard Protocols (Figure 2)
You will notice in figure 2 that K-sequence, DirectNET and MODBUS protocols (1) are all checked by default. These are the default protocols for the slave PLCs discussed in part one of this article. Select the desired protocol.
Time-out is the amount of time the port will wait for a response to a message it sent before it logs an error. It is only used when the PLC is the master device. Notice the selection is relative to the Base Time-out listed next to each protocol, i.e. for K-Sequence, Base Time-out x 1 = 800ms.
RTS On/Off Delay (3)
RTS (Request to Send) is a handshaking signal to notify another device that the asserting device would like to transmit. RTS on and RTS off delay can typically be set to 0ms for 4-wire networks. For 2-wire networks, the values should be increased to 5ms and 2ms respectively. See figure 3.
Station Number (4)
The station number is the slave number or address. This is the number that will be polled by the master on the network. Typically this is set to 1 for the master. Slaves can be addressed from 1 through 90 for DirectNET protocol or 1 through 247 for MODBUS protocol, depending on the slave and CPU.
Baud Rate (5)
Baud rate is the rate at which data is transmitted across the connection in bits per second (bps). A good starting point is 9,600 bps. If no problems are encountered, then increase the baud rate to the maximum achievable without communication problems.
Stop Bits (6)
Stop bits are extra bits which follow the data and parity bits to mark the end of the transmission. For older systems, the Stop Bit may need to be increased to 2, but 1 is usually the correct setting.
Parity is a low level form of error checking that counts the number of 1’s in the bit stream to ensure that none have been changed. The parity bit is turned on or off to achieve the correct number of 1’s in the data packet; either odd or even. If the number of 1’s is even when parity is set to odd, then the packet has been corrupted. This setting largely depends upon the required settings of the other equipment on the network.
The Baud rate, Stop bits and Parity must all be the same for every device on the network in order for communications to work properly.
DirectNET protocol requires that the Format be selected – Hex or ASCII. In other words, the data represents a hexadecimal number or an ASCII character. All of the other protocols ignore this parameter. If you want the fastest communication possible, select HEX mode. The same data is twice as long in ASCII format, so it takes longer to transfer. If you have a device on the network that requires ASCII, then choose ASCII mode. ASCII is not usually recommended unless absolutely necessary.
Echo Suppression (9)
In a half duplex 2-wire network, the receiver of the transmitting device must be disabled so that data is not “echoed” back to the receiver. This is called Echo Suppression. If you selected MODBUS or Non-Sequence as the network protocol, you must select either 4-wire or 2-wire. In effect, this is turning echo suppression on for 2-wire networks and off for 4-wire networks and RS-232.
Non-Sequence Protocol (Figure 4)
Non-sequence protocol (1) allows the CPU to use port 2 to either read or write (depending on CPU model) raw ASCII strings to devices such as barcode readers and printers.
The time-out, RTS on/off delay, stop bits, parity and echo suppression are configured as mentioned previously.
Data Bits (2)
If Non-Sequence is the network protocol, the number of Data bits will have to be selected. The data bits are the portion of the bit stream transmitted that actually contains useful information for the receiving device. It is what is left after taking off the Start, Stop, and Parity bits. Select either 7 or 8 to match the number of data bits required by the other devices connected to the network.
Memory Address (3)
This is the beginning V-memory location to temporarily store the ASCII data coming in to the PLC. The Memory Address will consume nine consecutive V-memory addresses. The default is V0 (TA0). This must be changed or there will be a conflict between Timer T0 and the ASCII string.
XON/XOFF and RTS Flow Control (4)
Select XON/XOFF for software handshaking. It is essentially a software approach to RTS/CTS hardware handshaking.
Select RTS if the port has the RTS signal wired between all devices. As with baud rate, stop bits and parity, every device on the network must be configured the same in order for communications to work properly.
Remote I/O Protocol (Figure 5)
The Remote I/O selection (1) is for use with the D2-250-1 and D2-260 CPUs only. It is used in conjunction with remote I/O slaves such as the D2-RSSS and T1K-RSSS to connect remote I/O bases that may be as far away as 1000 meters. There are only three settings for Remote I/O.
Station Number (2)
The Station number must be set to 0 for the port to operate as a remote I/O master.
Baud rate (3)
The baud rate is limited to 19.2K or 38.4K. Start with 19.2K baud and then change all devices to 38.4K once the communications are established.
Memory Address (4)
The Memory Address is the V-memory location to be used as the starting location of the Remote I/O configuration table. The value V37700 is recommended.
Additional information can be found in the Remote I/O manual D2-REMIO-M for configuring remote slave units on the network.
Saving the Configuration to the CPU
Once all of the parameters are configured, they must be written to the CPU. This is done by selecting the icon located below the Close button. Select the icon that shows a blue arrow pointing ‘to’ the PLC.
If problems are encountered, first check the settings common to all devices such as baud rate, parity, stop bits, etc. Make sure you are starting with a low baud rate such as 9,600, especially for long cable runs. Next, increase the time-out on the master device, such as a PLC or operator interface. Check the cable connections and cable integrity. Lastly, check the cable routing to ensure it is not routed in such a way as to pick up electrical noise from low/high voltage AC systems or variable frequency drives. For RS422 and RS485, verify that all required termination resistors are installed and sized correctly. If you constructed your own cable, make sure that the RTS/CTS connections are jumpered together. Try increasing the RTS on/off delay times. Increase these values to 5 – 10ms. Also, check station number settings and make sure you are addressing the correct slave from your master.
If you are using radios, make sure they are capable of maintaining the packet integrity for the protocol you have chosen. You may have to adjust packet sizes, timing delays, etc. in the radios. Also, radios typically require longer delay times and time-out settings in the master.
For more information, refer to the following Technical and Application Notes posted on the technical support page of the AutomationDirect Web site:
CPU Communications Port Setup Parameters
DL06, D2-250(-1),D2- 260 to D2-240 RS-232 Communications wiring Diagram
DL06, D2-250(-1), D2-260 to DL06, D2-250(-1), D2-260 RS-232/RS422 Communications wiring
D2-250(-1) to Modem / RS-232 communications wiring diagram
Using the D2-250, D2-250-1, D2-260, and DL06 to Communicate to a printer/data terminal
EZTouch, EZText RS 422/485 wire connections to DirectLOGIC PLCs.
How to Connect DirectLOGIC PLCs through the MDM-TEL modem.
By Robert Thornton
Originally Published: March 1, 2005