The text of a manual · part 19 of 45
Enhanced and Ethernet PLC-5 Programmable Controllers User Manual: Chapter 10 - Communicating with Devices on a Serial Link, pages 151 to 158
Pages 151 to 158 of 388, from Enhanced and Ethernet PLC-5 Programmable Controllers User Manual
The original document is the PDF (5.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 1785-L20B and Allen-Bradley 1785-L40B
Page 151
Chapter
10
Communicating with Devices on a Serial Link
Using This Chapter For Information About:
Go to Page:
Choosing between RS-232C, RS-422A, and RS-423 10-1 Configuring the controller serial port
10-2
Using channel 0
10-2
Cabling
10-5
Configuring channel 0
10-6
Monitoring channel 0 status
10-22
If you are using PLC-5 controllers in Supervisory Control and Data Acquisition (SCADA) applications, see the SCADA System Selection Guide, publication AG-SG001.
Choosing Between RS-232C, RS-422A, and RS-423
The table below summarizes some of the differences between RS-232C, RS-422A, and RS-423 communication modes:
This Method
Is Normally Used When You
RS-232C have a data transmission range of up to 50 ft. (15.2m). Applications requiring longer distances can use modems or line drivers. Use RS-232C for half- or full-duplex communication. For example, computers communicating with controllers or modems in SCADA applications.
RS-422A want to transmit data to RS-422A-compatible devices over ranges greater than RS-232C allows. See on page 10-5. Use RS-422A for point-to-point communication, with one device communicating with as many as 10 other devices.
RS-423 want to transmit data to RS-423-compatible devices over ranges greater than RS-232C allows. See on page 10-5. Use RS-423 for point-to-point communication, with one device communicating with as many as 10 other devices.
1
Publication 1785-UM012D-EN-P - July 2005
Page 152
10-2
Communicating with Devices on a Serial Link
Configuring the Controller Serial Port
Channel 0 is the serial port and is configurable for RS-232C, RS-423, or RS-422A compatible communication. Use switch assembly SW2 to specify the serial port configuration. To set the controller switch, see chapter 23 or look on the side label of the controller, which shows the switches in switch assembly SW2 and a table listing the settings.
Using Channel 0
You can use the controller’s serial port (channel 0) to connect the controller to devices that: • can send and receive ASCII characters by using User mode (ASCII communication) • communicate using DF1 protocol by using one of three available System modes
User Mode In user mode, all data are received and sent via a buffer. To access or send this data, use ASCII instructions in your ladder program. The ASCII data a PLC-5 controller sends contain no additional protocol characters. In user mode, only ASCII instructions can be used. If you try to use a message (MSG) instruction that references the serial port, the error (.ER) bit is set. Examples of ASCII peripheral devices are: • ASCII terminals • Bar code readers • Allen-Bradley Dataliners • Weigh scales • Printers
System Mode In system mode, the controller interprets a command from another device. Use system mode when you need to communicate with other devices on a link. System mode, with DF1 protocol, is a separate and unique communication link from the DH+ link.
Publication 1785-UM012D-EN-P - July 2005
Page 153
Communicating with Devices on a Serial Link
10-3
In system mode, you can send data to a device using: • the message (MSG) instruction; or • ASCII write instructions (send as an ASCII string) All data is encapsulated inside a DF1 protocol packet; therefore, the controller can communicate only with peripheral devices that support the DF1 protocol. Examples of DF1 peripheral devices are: • personal computers • communication modules such as 1771-KF2 series C, 1771-KE, 1771-KF, and 1785-KE • modems Use this Mode
For
Point-to-Point communication between a PLC-5 controller and one other DF1 protocol compatible device In point-to-point mode, a PLC-5 controller uses DF1 full-duplex protocol.
DF1 Master Mode control of polling and message transmission between the master and each remote node In master mode, a PLC-5 controller uses DF1 half-duplex polled protocol. The master/remote network includes one PLC-5 controller configured as the master node and up to 254 remote nodes. You link remote nodes using modems or line drivers. A master/remote network can have node numbers from 0 to 376 (octal). Node 377 is reserved for broadcast. Each node must have a unique node address. Also, at least 2 nodes must exist to define your link as a network (1 master and 1 remote station are two nodes).
DF1 Slave Mode using controller as a remote station in a master/slave serial communication network When there are multiple remote stations on the network, you link remote nodes using modems or line drivers. When you have a single remote station on the network, you do not need a modem to connect the remote station to the master; you can configure the control parameter for no handshaking. You can connect from 2 to 255 nodes to a single link. In slave mode, a PLC-5 controller follows DF1 half-duplex protocol. One node is designated as the master and it controls who has access to the link. (For example, a master can be a PLC-5/250 or PLC-5/40 controller or a computer running ControlView SCADA option software. All other nodes are remote stations and must wait for permission from the master before transmitting. The master (except PLC-5/250) can send and receive messages from all nodes on the link and to nodes on other Data Highway links connected to the multidrop; whereas, a remote station can only respond to the master.
Publication 1785-UM012D-EN-P - July 2005
Page 154
10-4
Communicating with Devices on a Serial Link
Master Station to Remote Station Communication Methods A PLC-5 master station can communicate with remote stations in two ways: Method
Option Name
Principal Benefits initiating polling packets to remote stations standard according to their position on a polling list communication mode
This is the communication mode used most often in point-to-multipoint configurations.
Polling packets are formed independently of any user-programming.
Provides for these capabilities: remote stations can send messages to the master station (polled report-by-exception) remote stations can send messages to each other lets the master station maintain an active node table The poll list resides in a user designated and accessible integer-type data file. You can: include the master on the poll list configure the master for between-station polls (master transmits any message that it needs to send before polling the next remote station) have the master both in the poll list and configured for between-station polls initiating communication to remote stations message-based using only user-programmed message communication mode (MSG) instructions Each request for data from a remote station must be programmed via a message instruction. The master polls the remote station for a reply to the message after waiting a user-configured period of time. The waiting period gives the remote station time to formulate a reply and prepare the reply for transmission. After all of the messages in the master’s message-out queue are transmitted, the remote-to-remote queue is checked for messages to send.
Publication 1785-UM012D-EN-P - July 2005
If your application uses satellite transmission or public switched telephone network transmission, consider choosing message-based. Communication to a remote station can be initiated on an as needed basis. Or choose this method if you need to communicate with non-intelligent remote terminal units (RTUs).
Page 155
Communicating with Devices on a Serial Link
10-5
Polling Inactive Priority Stations Through the channel configuration feature of your programming software, you can choose to poll one or all of the inactive priority stations when the PLC-5 controller is in master mode on channel 0. The default selection is to poll one inactive priority station during each polling sequence. If you choose to poll all inactive stations, you are alerted immediately when an inactive station becomes active; you do not have to wait for all of the other polling sequences to complete. Polling all inactive stations might slow down channel performance.
Changing Modes Configure channel 0 of the controller to change communication modes via: • the channel configuration screen in your programming software (in program mode only) ; or • communication mode change characters (ASCII control characters) sent remotely to the controller, which switches modes
Cabling
The following table lists the maximum cable lengths you can use with channel 0. Port
Transmission Rate(s)
Maximum Cable Length
RS-232C
All
15 m (50 ft)
RS-422A All (compatible)
61 m (200 ft)
RS-423
All
61 m (200 ft)
IMPORTANT
Follow these guidelines: • When channel 0 is configured for RS-422A compatibility, do not use terminating resistors anywhere on the link. • When channel 0 is configured for RS-422A (compatible) and RS-423, do not go beyond 61 m (200 ft). This distance restriction is independent from the transmission rate.
Publication 1785-UM012D-EN-P - July 2005
Page 156
10-6
Communicating with Devices on a Serial Link
Configuring Channel 0
Use switch assembly SW2 controllers to specify RS232-C, RS422A (compatible), or RS423 communications for channel 0. You can configure channel 0 to communicate using these protocols: If You Want to Use System mode
User mode
See Page
DF1 point-to-point 10-6 DF1 slave
10-9
DF1 master
10-12
ASCII
10-18
Configure Channel 0 for DF1 Point-to-Point To configure channel 0 for DF1 point-to-point communication, use the system mode configuration screen in your programming software.
configure the serial communications as system point-to-point specify the details
Publication 1785-UM012D-EN-P - July 2005
Page 157
Communicating with Devices on a Serial Link
This Field
Specifies
Configure by Doing the Following
Diagnostic file
The file containing the channel’s status information
Enter an integer file number (10-999).
10-7
ATTENTION: Assign a unique diagnostic file to each channel. Do not assign a diagnostic file that is the I/O status file you assigned or any other used integer file. Unpredictable machine operation can result. Important: You must define a diagnostics file for a channel configured for anything but unused (even if you are not using the channel) if you want to get status information for that channel. Enable
Whether the remote mode change option is enabled
Select ENABLED.
Mode attention char.
The attention character for the system Enter a character. If the attention character you want to use is a control or the user mode character for remote character, specify the ASCII equivalent. change
System mode char.
The character to be used with the mode attention character (above)
Enter a character. If the attention character you want to use is a control character, specify the ASCII equivalent. When the controller encounters the attention character and the system mode character, the controller sets channel 0 communication to system mode. The remote mode change option must be ENABLED.
User mode char.
The character for the mode attention character (above)
Enter a character. If the attention character you want to use is a control character, specify the ASCII equivalent. When the controller encounters the attention character and the user mode character, the controller sets channel 0 communication to user mode. The remote mode change option must be ENABLED.
Serial Settings Baud rate
Communication rate for channel 0
Select 110, 300, 600, 1200, 2400, 4800, 9600, or 19.2k bps.
Configure all devices in the system for the same communication rate Parity
Parity setting for channel 0
Select NONE or EVEN.
Parity provides additional message packet error detection. Bits per character
Select the number of bits that make up Select 7 or 8. a transmitted character.
Error detect
Whether you want error detection set Select one of the following: to BCC or CRC BCC: the controller sends and accepts messages that end with a BCC byte for error checking. BCC is quicker and easier to implement in a computer driver. CRC: the controller sends and accepts messages with a 2-byte CRC for error checking. CRC is more complete checking Configure both stations to use the same type of error checking.
Publication 1785-UM012D-EN-P - July 2005
Page 158
10-8
Communicating with Devices on a Serial Link
This Field
Specifies
Configure by Doing the Following
Stop bits
Match the number of stop bits to the device with which you are communicating
Select 1, 1.5, or 2.
Control line
Select the mode in which the driver operates.
Select a method appropriate for your system’s configuration: If you are not using a modem, choose NO HANDSHAKING. If you are using a full-duplex modem, choose FULL-DUPLEX.
Option Settings Duplicate detect
Whether you want the controller to Select the desired setting. detect and ignore duplicate messages
ACK timeout
The amount of time you want the controller to wait for an acknowledgment to its message transmission
Enter a value 0-65535. Limits are defined in 20 ms intervals. For example to wait 40 ms, type 2. The recommended time elapse is 1 second. Specify 1 second by typing 50.
MSG appl timeout
The number of seconds within which the reply message must be received before the error bit is set on the message. The timer starts when the ladder program first initiates the message and is restarted if/when the ACK is received
Enter one of the following values: 1:30-60 seconds 2:60-90 seconds 3:90-120 seconds 4:120-150 seconds 5:150-180 seconds 6:180-210 seconds 7:210-240 seconds
NAK receive
The number of NAKs your controller can receive in response to a transmitted message
Enter a value 0-255. The recommended setting is 3.
DF1 ENQS
The number of enquiries (ENQs) that you want the controller to send after an ACK timeout
Enter a value 0-255. The recommended setting is 3.
Publication 1785-UM012D-EN-P - July 2005