The text of a manual · part 31 of 70
SLC 500 Instruction Set Reference Manual, pages 301 to 310
Pages 301 to 310 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 301
SLC Communication Instructions
12-35
04
00
Table 12.15 Modbus RTU Master Control Block 15
14
13
12
11
10
09
08
07
06
05
03
Word 0
EN
ST
DN
ER
CO
EW
NR
TO
Error Codes
Word 1
Not Used - Always 0
Word 2
Number of Elements
Word 3
Target Data Address (decrement user input by 1)
Word 4
Reserved (unused, default to 0)
Word 5
Reserved (unused, default to 0)
Word 6
Not Used - Always 0
Word 7
Not Used - Always 0
Reserved (Internal Messaging Bits)
Word 8
Reserved (Internal Messaging Bits)
Message Timer Preset
Word 9
Message Timer Scaled Zero
Word 10
Message Timer Accumulator
Word 11
Reserved (Internal Messaging Bits)
Word 12
AO= 0
Word 13
Reserved (Internal Messaging Bits)
02
01
Target Node
Start-Bit/Coil/Input at Physical Address Register Size WQ
Reserved (Internal Messaging Bits)
Publication 1747-RM001G-EN-P - November 2008
Page 302
12-36
SLC Communication Instructions
Table 12.16 SLC 5/05 Channel 1 Read or Write, Local or Remote to a PLC-5 (with Logical ASCII/Symbolic Addressing) 15 14 13 12 11 10 09 08 07 06 05 04 03 02 EN ST DN ER CO EW NR TO Error Code Reserved Remote Station Address (Remote only) Number of Elements Not Used File Type (Based on Local Source or Destination Address) Not Used Not Used Remote Bridge Address (Remote only) Reserved (Internal Messaging Bits) Reserved (Internal Messaging Bits) Message Timer Preset Message Timer Scaled Zero Message Timer Accumulator Reserved (Internal Messaging Bits) AO=1 Reserved (Internal Messaging Bits) Reserved (Internal Messaging Bits) Logical ASCII Address String Length including NULL Termination Character (bytes) First Byte of ASCII Address String Second Byte of ASCII Address String Third Byte of ASCII Address String ... ... ... ... ... Word 55 Eighty-First Byte of ASCII Address String NULL Byte of Longest ASCII Address String Word 56 First Byte of IP Address String(1) Second Byte of IP Address String
01
Word 0 Word 1 Word 2 Word 3 Word 4 Word 5 Word 6 Word 7 Word 8 Word 9 Word 10 Word 11 Word 12 Word 13 Word 14 Word 15 Word 16
Word 57 Third Byte of IP Address String ... ... Word 76 Forty-First Byte of IP Address String Word 77 Not Used Word 78(3) Words 79 83(3) Word 84(3) Words 85 92(3)
ASA Service
00
WQ
... ... ... NULL Byte of Longest IP Address String Ethernet Message Type = 0(2), 10h(3), or 11h(3) Internal Object Identifier (IOI) Size in Words (1 to 5)
ASA Internal Object Identifier (IOI)
Not Used
Connection Path Size in Words (1 to 8)
Connection Path
(1)
The IP Address format is up to 42 ASCII characters including a terminating NULL character. The first byte in the array is the left most character in the string as written. For example: If the IP Address is 423.156.78.012, the first byte is the ASCII character “4”. If the MSG destination is an INTERCHANGE client on a host computer, the destination is specified as “client” and stored as a NULL terminated string.
(2)
Not MultiHop MSG.
(3)
MultiHop MSG.
Publication 1747-RM001G-EN-P - November 2008
Page 303
SLC Communication Instructions
The following section describes the status bit sequencing for an SLC 5/03, SLC 5/04, or SLC 5/05 MSG instruction.
Status Bit Sequencing for SLC 5/03, SLC 5/04, and SLC 5/05 MSG Instruction 1.Rung goes True.
1
EN
1 0
EW
1 0
ST
1 0
DN ER
12-37
2.Target node receives packet. 2
3.Acknowledge sent of successful receipt.
3
4.Not shown.
5.Target node processes packet successfully and returns data (read) or writes data (success).
5
1 0 1 0
1 0 1 TO 0 WQ 1 0 NR
Rung Goes True When the MSG rung becomes true and the MSG is scanned, if there is room in any of the four active MSG buffers and no other MSG are in the queue, the MSG is immediately placed in an available buffer, and the EN and EW bits are set. If this was a MSG Write instruction, the source data would be transferred to the MSG buffer at this time. If there is no room in the four MSG buffers or other MSG instructions are already in the queue, and a position is available in the MSG queue, then the MSG enters the queue and only the EN bit is set. The 10-position MSG queue works on a first-in-first-out basis that allows the SLC processor to remember the order the MSG instructions were enabled. Note that the program does not have access to the SLC MSG queue. If there is no room in any of the four MSG buffers and no room in the 10-position MSG queue, only the WQ bit is set. Note that when the WQ bit is set, the MSG instruction must be re-scanned with true rung conditions at a later time when there is room in either the four MSG buffers or the 10-position MSG queue.
Publication 1747-RM001G-EN-P - November 2008
Page 304
12-38
SLC Communication Instructions
Once the EN bit is set, it remains set until the entire MSG process is complete and either the DN, ER, or TO bit is set. The MSG Timeout period begins timing when the EN bit is set. If the timeout period expires before the MSG instruction completes it function, the ER bit is set and an error code (37H) is placed in the MSG block to inform you of the timeout error. If you choose to set the CO bit, your MSG instruction will take up permanent residence in one of the four active MSG buffers. The MSG instruction continues to re-transmit its data each time the DN or ER bit is set. If this were a MSG Write instruction, your source data would be updated each MSG cycle.
Publication 1747-RM001G-EN-P - November 2008
Page 305
SLC Communication Instructions
12-39
Next End of Scan At the next end of scan or SVC, the SLC processor determines if it should examine the MSG queue for “something to do.” The processor bases its decision on the state of bits S:2/15, S:33/7, S:33/5, S:33/6, network communication requests from other nodes, and if previous MSG instructions are already in progress. If the SLC processor determines that it should not access the queue, the MSG instruction remains as it was. (Either the EN and EW bits remain set, or only the EN bit is set, or only the WQ bit is set until the next end of scan or SVC. If only the WQ bit is set, the MSG instruction must be re-scanned later with true rung conditions.) If the SLC processor determines that it has something to do, it unloads the MSG queue entries into the MSG buffers until all four MSG buffers are full. Each MSG buffer contains a valid network packet. If a packet cannot be successfully built from the MSG queue, the ER bit is set and a code is placed in the MSG block to inform you of an error. When a MSG instruction is loaded into a MSG buffer, the EN and EW bits are set. The SLC processor then exits the end of scan or SVC portion of the scan. The processor’s background communication function sends the packets to the Target Nodes that you specified in your MSG instruction. Depending on the state of bits S:2/15, S:33/7, S:33/5, and S:33/6 you can have up to eight MSG instructions (four from each channel) active at any given time.
Successful Receipt of Packet If the Target Node successfully receives the packet, it sends back an ACK (acknowledge). The ACK causes the processor to clear the EW bit and set the ST bit. The Target Node has not yet examined the packet, to see if it understands your request. Note that the Target Node is not required to respond within any given time frame. For broadcast write commands, Ethernet and DF1 Radio Modem communication, there is no ACK/NAK mechanism. For the SLC 5/05, the ST bit is set when the Ethernet daughterboard internally indicates it has received the command from the main processor and will send it out. For broadcast write commands and DF1 Radio Modem, the ST bit is set when the command has successfully been transmitted. Skip step 4 for Ethernet and DF1 Radio Modem communications.
TIP
If the Target Node faults or power cycles during this time frame of a MSG transaction, you will not receive a reply. As a result, use a MSG Timeout value in your MSG instruction.
Publication 1747-RM001G-EN-P - November 2008
Page 306
12-40
SLC Communication Instructions
Step 4 is not shown in the timing diagram.
An ACK is Not Received If you do not receive an ACK, step 3 does not occur. Instead, either no response or a NAK (no acknowledge) is received. When this happens, the ST bit remains clear. These conditions can cause no response. • The target node is not there. • The target node does not respond because the packet became too corrupted in transmission to be properly received. • The response was corrupted in transmission back. These conditions can cause a NAK. • Target node is too busy. • Target node received a corrupt packet.
Target Node Sends a Reply Packet Following the successful receipt of the packet, the Target Node sends a reply packet. The reply packet will contain one of the following responses. • The write request was successfully performed. • The read request was successfully performed and here is the data. • The request was not performed because of an error. At the next end of scan or SVC, following the Target Node’s reply, the SLC processor examines the packet from the target device. If the reply contains successfully performed the write request, the DN bit is set and the ST bit is cleared. The MSG instruction function is complete. If the MSG rung is false, the EN bit is cleared the next time the MSG instruction is scanned. If the reply contains successfully performed the read request, and here is the data, the data is written to the data table, the DN bit is set and the ST bit is cleared. The MSG instruction function is complete. If the MSG rung is false, the EN bit is cleared the next time the MSG instruction is scanned. If the reply contains the request was not performed because of an error, the ER bit is set and the ST bit is cleared. The MSG instruction function is complete. If the MSG rung is false, the EN bit is cleared the next time the MSG instruction is scanned. Publication 1747-RM001G-EN-P - November 2008
Page 307
SLC Communication Instructions
12-41
For SLC 5/03 (OS301 and higher), SLC 5/04, and SLC 5/05 processors, there are four MSG buffers per channel. Each channel has its own 10-position MSG queue. The SLC processor unloads the two MSG queues into the MSG buffers evenly at end of scan or SVC. This gives both channels equal access to communications. If you program a SVC instruction that is configured to service only one channel, then only that channel will have its MSG queue unloaded into the MSG buffers (until the next end of scan or SVC when both channels will again be unloaded evenly).
MSG Instruction Error Codes
When the processor detects an error during the transfer of message data, the processor sets the ER bit and enters an error code that you can monitor from your programming software.
Table 12.17 MSG Instruction Error Codes Error Code
Description of Error Condition
02H
Target node is busy. The MSG instruction will automatically reload. If other messages are waiting, the message is placed at the bottom of the stack.
03H
Target node cannot respond because message is too large.
04H
Target node cannot respond because it does not understand the command parameters OR the control block may have been inadvertently modified.
05H
Local processor is offline (possible duplicate node situation).
06H
Target node cannot respond because requested function is not available.
07H
Target node does not respond.
08H
Target node cannot respond.
09H
Local modem connection has been lost.
0AH
Buffer unavailable to receive SRD reply.
0BH
Target node does not accept this type of MSG instruction.
0CH
Received a master link reset (one possible source is from the DF1 master).
10H
Target node cannot respond because of incorrect command parameters or unsupported command, or the data file specified does not exist.
11H
Local file has constant file protection.
12H
Local channel configuration protocol error exists.
13H
Local MSG configuration error in the Remote MSG parameters.
14H
Local communication driver is incompatible with the MSG instruction.
15H
Local channel configuration parameter error exists.
16H
Target or Local Bridge address is higher than the maximum node address.
17H
Local service is not supported.
18H
Broadcast (Node Address 255) is not supported.
Publication 1747-RM001G-EN-P - November 2008
Page 308
12-42
SLC Communication Instructions
Table 12.17 MSG Instruction Error Codes (Continued) Error Code
Description of Error Condition
19H
Improperly formatted Logical ASCII Address string. String not properly terminated with a NULL character or the string length does not match the value in the length parameter.
20H
Target Node responded with: Host has a problem and will not communicate.
30H
Target Node responded with: Remote station host is not there, disconnected, or shutdown.
37H
Message timed out in local processor.
38H
Message disabled pending link response.
40H
Target Node responded with: Host could not complete function due to hardware fault.
45h
Parameters of a reply to a MSG command do not match what was expected.
50H
Target node is out of memory.
60H
Target node cannot respond because file is protected.
70H
Target Node responded with: Processor is in Program Mode.
80H
Target Node responded with: Compatibility mode file missing or communication zone problem.
81H
Modbus Error 1: Illegal Function. The function code sent by the Master is not supported by the slave or has an incorrect parameter.
82H
Modbus Error 2: Illegal Data Address. The data address referenced in the Master command does not exist in the slave, or access to that address is not allowed.
83H
Modbus Error 3: Illegal Data Value. The data value being written is not allowed, either because it is out of range, or because it is being written to a read-only address.
84H
Modbus Error 4: Slave Device Failure. An irrecoverable error occurred while the slave was attempting to perform the requested action.
85H
Modbus Error 5: Acknowledge. The slave has accepted the request, but a long duration of time will be required to process the request.
86H
Modbus Error 6: Slave Device Busy. The slave is currently processing a long-duration command.
87H
Modbus Error 7: Negative Acknowledge. The slave cannot perform the program function received in the command.
88H
Modbus Error 8: Memory Parity Error. The slave attempted to read extended memory, but detected a parity error in the memory.
89H
Modbus Error: Non-standard reply. An error code greater than 8 was returned by the slave.
90H
Target Node responded with: Remote station cannot buffer command.
B0H
Target Node responded with: Remote station problem due to download.
C0H
Target Node responded with: Cannot execute command due to active IPBs.
D0H
No IP address configured for the network, -orBad command - unsolicited message error, -orBad address - unsolicited message error, -orNo privilege - unsolicited message error, -orMultihop messaging cannot route request.
D1H
Maximum connections used - no connections available
D2H
Invalid internet address or host name
D3H
No such host
D4H
Cannot communicate with the name server
D5H
Connection not completed before user-specified timeout
Publication 1747-RM001G-EN-P - November 2008
Page 309
SLC Communication Instructions
12-43
Table 12.17 MSG Instruction Error Codes (Continued) Error Code
Description of Error Condition
D6H
Connection timed out by the network
D7H
Connection refused by destination host
D8H
Connection was broken
D9H
Reply not received before user-specified timeout
DAH
No network buffer space available
DBH
Multi-hop messaging CIP message format error
DFH
MSG has no IP address configured for network
E1H
Target Node responded with: Illegal Address Format, a field has an illegal value.
E2H
Target Node responded with: Illegal Address format, not enough fields specified.
E3H
Target Node responded with: Illegal Address format, too many fields specified.
E4H
Target Node responded with: Illegal Address, symbol not found.
E5H
Target Node responded with: Illegal Address Format, symbol is 0 or greater than the maximum number of characters support by this device.
E6H
Target Node responded with: Illegal Address, address does not exist, or does not point to something usable by this command.
E7H
Target node cannot respond because length requested is too large.
E8H
Target Node responded with: Cannot complete request, situation changed (file size, for example) during multi-packet operation.
E9H
Target Node responded with: Data or file is too large. Memory unavailable.
EAH
Target Node responded with: Request is too large; transaction size plus word address is too large.
EBH
Target node cannot respond because target node denies access.
ECH
Target node cannot respond because requested function is currently unavailable.
EDH
Target Node responded with: Resource is already available; condition already exists.
EEH
Target Node responded with: Command cannot be executed.
EFH
Target Node responded with: Overflow; histogram overflow.
F0H
Target Node responded with: No access
F1H
Local processor detects illegal target file type.
F2H
Target Node responded with: Invalid parameter; invalid data in search or command block.
F3H
Target Node responded with: Address reference exists to deleted area.
F4H
Target Node responded with: Command execution failure for unknown reason; PLC-3 histogram overflow.
F5H
Target Node responded with: Data conversion error.
F6H
Target Node responded with: The scanner is not able to communicate with a 1771 rack adapter.
F7H
Target Node responded with: The adapter is not able to communicate with a module.
F8H
Target Node responded with: The 1771 module response was not valid - size, checksum, etc.
F9H
Target Node responded with: Duplicated Label.
FAH
Target node cannot respond because another node is file owner (has sole file access).
FBH
Target node cannot respond because another node is program owner (has sole access to all files).
Publication 1747-RM001G-EN-P - November 2008
Page 310
12-44
SLC Communication Instructions
Table 12.17 MSG Instruction Error Codes (Continued) Error Code
Description of Error Condition
FCH
Target Node responded with: Disk file is write protected or otherwise inaccessible (off-line only).
FDH
Target Node responded with: Disk file is being used by another application; update not performed (off-line only).
FFH
Local communication channel is shut down.
TIP
Explicit Message Instruction Overview
The MSG error code reflects the STS field of the reply to your MSG instruction. Codes E0 - EF represent EXT STS codes 0 - F. Codes F0 - FC represent EXT STS codes 10 - 1C.
The CEM, DEM, and EEM explicit message instructions allow generic Common Industrial Protocol (CIP) commands to be initiated to devices, such as drives, communicating on ControlNet, DeviceNet, and EtherNet/IP networks. Each instruction requires RSLogix 500 version 7.10 or higher software for programming. The CEM instruction utilizes the explicit message capability built into the 1747-SCNR ControlNet scanner module, while the DEM instruction utilizes the explicit message capability built into the 1747-SDN DeviceNet scanner module. While not adding any additional capability over what already exists in the scanner modules, the CEM and DEM instructions greatly simplify the programming, configuration, monitoring, and troubleshooting of explicit messages on ControlNet and DeviceNet. Unlike I/O configured in the scanner module’s scan list, which is updated on a continual basis, explicit messages allow data to be sent and received on an as-needed basis, minimizing network traffic. For instance, you may only want to write configuration parameters to a drive once at machine start-up time. The CEM and DEM instructions can be used with any SLC 5/03, 5/04, or 5/05 processor that is at OS firmware level Series C, FRN 10 or higher. The EEM instruction explicit message capability is implemented through the channel one Ethernet port of the SLC 5/05 processor. It shares the same queuing and buffering scheme, as well as Ethernet connection resources, that are used by the MSG instruction. Like the standard MSG instruction, data can be sent and received on an as-needed basis. Ethernet explicit messages are useful for communicating with third party EtherNet/IP devices that don’t understand standard MSG commands, as well as providing access to data in Allen-Bradley EtherNet/IP devices that isn’t accessible via standard MSG instruction commands. The EEM instruction can be used with any SLC 5/05 processor at OS firmware level Series C, FRN 10 or higher.
Publication 1747-RM001G-EN-P - November 2008