The text of a manual · part 43 of 70
SLC 500 Instruction Set Reference Manual, pages 421 to 430
Pages 421 to 430 of 694
The original document is the PDF (7.2 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 1747-L514
Page 421
SLC Communication Channels
IMPORTANT
13-91
Modbus protocol may not be consistently implemented in the field. The Modbus specification calls for the addressing range to start at 1; however, some devices start addressing at 0. The Modbus Data Address in the Message Setup Screen may need to be incremented by one to properly access a Modbus slave’s memory, depending on that slave’s implementation of memory addressing.
Configuring a Channel for Modbus RTU Master To configure a channel for Modbus RTU master, first place the processor into program mode and do the following using your programming software:
To bring up the Channel Configuration interface, double-click on the Channel Configuration icon.
Publication 1747-RM001G-EN-P - November 2008
Page 422
13-92
SLC Communication Channels
Define the location of the diagnostic file used for Channel Status here. For Channel Status details, see page 13-94.
Select the Modbus RTU Master from the Channel Configuration menu as shown below.
Publication 1747-RM001G-EN-P - November 2008
Page 423
SLC Communication Channels
13-93
The Baud defaults to 19200. The Control Line can be configured as: • No Handshaking • Full-Duplex Modem • Half Duplex without Continuous Carrier The Protocol Control defaults are: • No Handshaking • InterChar. Timeout = 0 • Pre Transmit Delay = 0. When the system driver is Modbus RTU Master, the following communication port parameters can be changed:
Table 13.26 Modbus RTU Master Channel Configuration Parameters Parameter Options Channel Driver Baud Rate Parity Control Line Inter-character Timeout (x1 ms) RTS Off Delay (x20 ms)
RTS Send Delay (x20 ms)
Pre Transmit Delay (x1 ms)
Channel 0 Modbus RTU Master 110, 300, 600, 1200, 2400, 4800, 9600, 19.2K, 38.4K none, even, odd No Handshaking, Full-Duplex Modem, Half-Duplex without Continuous Carrier 0 to 65535 (can be set in 1 ms increments); 0 = 3.5 character times
Programming Software Default 0 19.2K none No Handshaking 0
Specifies the minimum delay between characters that indicates the end of a message packet. 0 0 to 65535 (can be set in 20 ms increments) Specifies the delay time between when the last serial character is sent to the modem and when RTS is deactivated. Gives the modem extra time to transmit the last character of a packet. 0 to 65535 (can be set in 20 ms increments)
0
Specifies the time delay between setting RTS until checking for the CTS response. For use with modems that are not ready to respond with CTS immediately upon receipt of RTS. 0 to 65535 (can be set in 1 ms increments)
0
When the Control Line is set to No Handshaking or Full-Duplex Modem, this is the delay time before transmission. Required for 1761-NET-AIC physical Half-Duplex networks. The 1761-NET-AIC needs 2 ms of delay time to change from receive to transmit mode.
Stop Bits
When the Control Line is set to Half-Duplex Modem, this is the minimum time delay before RTS assertion. 1, 1.5, 2
1
Publication 1747-RM001G-EN-P - November 2008
Page 424
13-94
SLC Communication Channels
Modbus RTU Master Channel Status Channel Status data is stored in the diagnostic file defined on the Channel 0 Configuration screen.
Double-click on the Channel Status Icon Located beneath the Configuration icon to bring up the Channel Status screen.
The Channel Status dialog box similar to the following appears. Data for the data link layer diagnostic counters is displayed. See Table 13.27 for information regarding the diagnostic counter data displayed.
Publication 1747-RM001G-EN-P - November 2008
Page 425
SLC Communication Channels
13-95
Table 13.27 SLC 5/03 and Higher Channel 0 Modbus RTU Master Channel Status Data Link Layer Diagnostic Counters (Modbus Master RTU) Status Field
Diagnostic File Location
Definition
DTR
Word 0; Bit 4
DTR (Data Terminal Ready)
DCD
Word 0; Bit 3
DCD (Data Carrier Detect)
DSR
Word 0; Bit 2
DSR (Data Set Ready)
RTS
Word 0; Bit 1
RTS (Request to Send)
CTS
Word 0; Bit 0
CTS (Clear to Send)
Messages Sent
Word 1
Total Message Packets Sent
Messages Received
Word 2
Total Message Packets Received
Link Layer Error Count
Word 3
Link Layer Error Count
Link Layer Error Code
Word 4
Link Layer Error Code
Click the Channel 0 - Ext tab to display data for the PL diagnostic counters. See Table 13.28 for information regarding the diagnostic counter data displayed.
Table 13.28 SLC 5/03 and Higher Channel 0 Modbus RTU Master Channel Status PL Diagnostic Counters (Modbus Master RTU) Status Field/Description
Diagnostic File Location
Error Code 1 Counter
Word 7
Last Device Reporting Error Code 1
Word 8
Error Code 2 Counter
Word 9
Last Device Reporting Error Code 2
Word 10
Error Code 3 Counter
Word 11
Publication 1747-RM001G-EN-P - November 2008
Page 426
13-96
SLC Communication Channels
Table 13.28 SLC 5/03 and Higher Channel 0 Modbus RTU Master Channel Status PL Diagnostic Counters (Modbus Master RTU) Status Field/Description
Diagnostic File Location
Last Device Reporting Error Code 3
Word 12
Error Code 4 Counter
Word 13
Error Code 5 Counter
Word 14
Error Code 6 Counter
Word 15
Error Code 7 Counter
Word 16
Error Code 8 Counter
Word 17
Non-Standard Response Counter
Word 18
Last Device Reporting Error Code 4-8 or Non-Standard Response
Word 19
If you click the Clear button while monitoring Channel Status online, it will reset all the channel status diagnostic counters to zero.
Modbus Commands The controller configured for Modbus RTU Master responds to the Modbus command function codes listed in the following table: Table 13.29 Supported Modbus Commands as a Modbus RTU Master Command
Function Code (decimal)
Subfunction Code (decimal)
Read Coil Status
1
-
Read Input Status
2
-
Read Holding Registers
3
-
Read Input Registers
4
-
Write Single Coil(1)
5
-
Write Single Holding Register(1)
6
-
Write Multiple Coils(1)
15
-
Write Multiple Holding Registers(1)
16
-
(1)
Publication 1747-RM001G-EN-P - November 2008
Broadcast is supported for this command.
Page 427
SLC Communication Channels
13-97
Modbus Error Codes Upon receiving a Modbus command that is not supported or improperly formatted, the controller configured for Modbus RTU Master will respond with one of the exception codes listed in the following table: Table 13.30 Modbus Error Codes in Modbus RTU Master MSG Instruction Error Code
Error
Description
Received Exception Code
81
Illegal Function
The function code sent by the Master is not supported by the slave 1 or has an incorrect parameter.
82
Illegal Data Address
The data address referenced in the Master command does not exist 2 in the slave, or access to that address is not allowed.
83
Illegal Data Value
The data value being written is not allowed, either because it is out 3 of range, or it is being written to a read-only address.
84
Slave Device Failure
An unrecoverable error occurred while the slave was attempting to 4 perform the requested action.
85
Acknowledge
The slave has accepted the request, but a long duration of time will 5 be required to process the request.
86
Slave Device Busy
The slave is currently processing a long-duration command.
6
87
Negative Acknowledge
The slave cannot perform the program function received in the command.
7
88
Memory Parity Error
The slave attempted to read extended memory, but detected a parity error in the memory.
8
89
Non-standard Error Code
An error code greater than 8 was returned by the slave.
>8
Publication 1747-RM001G-EN-P - November 2008
Page 428
13-98
SLC Communication Channels
ASCII Communications
The SLC 5/03 (OS301 and higher), SLC 5/04, and SLC 5/05 processors support user-defined ASCII protocol by configuring channel 0 for User mode. In User mode, all received data is placed in a buffer. To access the data, use the ASCII instructions in your ladder program. You can also send ASCII string data to most attached devices that accept ASCII protocol.
TIP
Only ASCII instructions can be used when User mode is configured. If you use a Message (MSG) instruction that references channel 0, a 14H error occurs.
Configuring Channel 0 for ASCII Communications To configure an SLC 5/03, SLC 5/04 or SLC 5/05 processor channel 0 for ASCII communications, do the following using your programming software.
To bring up the Channel Configuration interface, double-click on the Channel Configuration icon.
Publication 1747-RM001G-EN-P - November 2008
Page 429
SLC Communication Channels
13-99
Select User Mode
1. On the Channel 0 user tab, choose ASCII for your Driver. 2. Configure the communication driver characteristics according to Table 13.31.
Publication 1747-RM001G-EN-P - November 2008
Page 430
13-100
SLC Communication Channels
Table 13.31 Define these communication parameters when configuring an SLC 5/03, SLC 5/04, or SLC 5/05 processor for ASCII communication. Tab
Parameter
Default
Selections
Channel 0 User
Baud Rate
19200
Toggles between the communication rate of 110, 300, 600, 1.2K, 2.4K, 4.8K, 9.6K and 19.2K (additional rate of 38.4K for SLC 5/04 and SLC 5/05 only).
Parity
None
Toggles between None, Odd, and Even.
Stop Bits
1
Toggles between 1, 1.5, and 2.
Data Bits
8
Toggles between 7 and 8.
Delete Mode
Ignore
Toggles between Ignore, CRT, and printer. This parameter is dependent on the Echo parameter being Enabled.
Echo
Disabled
Toggles between Disabled and Enabled.
RTS Off Delay
0
Allows you to select the RTS off delay value in increments of 20 ms. Valid range is 0 to 65535 (in 20 ms increment). Only valid for Half-duplex Control Line settings.
RTS Send Delay
0
Allows you to select the RTS send delay value in increments of 20 ms. Valid range is 0 to 65535 (in 20 ms increment). Only valid for Half-duplex Control Line settings.
Control Line
No Handshaking
Toggles between No Handshaking, Half-duplex With Continuous Carrier, Half-duplex Without Continuous Carrier, and Full-duplex Modem.
XON/XOFF
Disabled
Toggles between Disabled and Enabled.
Termination 1 Termination 2
\d \ff
Specify \ff for no termination character.
Append 1 Append 2
\d \a
Specify \ff for no append character.
Publication 1747-RM001G-EN-P - November 2008