The text of a manual · part 33 of 70
SLC 500 Instruction Set Reference Manual, pages 321 to 330
Pages 321 to 330 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 321
SLC Communication Instructions
12-55
• Done bit DN (word 0, bit 13) is set when the message has completed successfully. This bit is reset the next time the message rung goes from false to true. Do not set or reset this bit. It is informational only. • Enabled bit EN (word 0, bit 15) is set after the message rung goes from false to true AND the scanner module accepts this message because it is not currently processing any other explicit messages. (The scanner module can only process one DEM instruction at a time.) If the message rung goes false before the scanner module accepts this message, then the enable bit will remain off and the message will not be executed. This bit is reset when the message has completed with either the Done bit set or the Error bit set and the message rung goes false. If the message rung conditions remain true, you may retrigger the message instruction by resetting this bit after either the ER or DN bit has been set, indicating that the previous execution has completed. • Waiting for Slot bit WS (word 0, bit 10) is set when the message rung goes from false to true, but the scanner module is still processing another DEM instruction. To ensure that this message gets processed, you must leave the message rung conditions true until the WS bit is reset and the EN bit is set, indicating that the scanner module has accepted this message for processing. Do not set or reset this bit. It is informational only.
Scanner Status, Error, and Error Description on the General Tab The error code displays the explicit message status returned by the scanner module. An error code of 01h means Transaction completed successfully. Table 12.23 DEM Instruction Scanner Codes Scanner Code
Description of Scanner Status
2H
Transaction in progress.
3H
Slave not in scan list.
4H
Slave offline.
5H
DeviceNet port disabled/offline.
6H
Transaction TXID unknown.
7H
Slave not responding to explicit request.
8H
Invalid command code.
9H
Scanner out of buffers.
10H
Another transaction in progress.
11H
Could not connect to slave device.
12H
Response data too large for block.
13H
Invalid port.
14H
Invalid size specified.
15H
Connection busy.
Publication 1747-RM001G-EN-P - November 2008
Page 322
12-56
SLC Communication Instructions
All error codes listed above result in an error code of 2. Table 12.24 Complete List of Valid DEM Error Codes Error Code
Description of Error Condition
0
No error.
1
Timeout error. DeviceNet explicit message timed out by processor.
2
Scanner error. See Scanner Status.
3
User error. DeviceNet explicit message aborted by user.
For error code 4, the error description displays the CIP response error code and description as documented in the CIP Common Specification, Appendix B. Any time the error code is non-zero, the DEM error (ER) bit is set.
Send Data Tab The Send Data Tab provides a convenient way of viewing and entering in data to be sent along with the explicit message command. The data is shown in byte format with a selectable radix of either Decimal or Hex/BCD. The display only shows the number of words that are defined in the Size of Send Data (Bytes) field, starting with the low byte of the first word. If the Size of Send Data is zero, then no data is displayed. You can also change the data being viewed, but only when offline or during an online edit. Click on the data and enter in a byte value based on the current radix (0 to 255 for Decimal and 0 to FF for Hex/BCD). The changed data gets copied to the DEM control block when the rung is accepted. To update the Send Data display with the current values stored in the DEM control block, click on the Refresh button.
Receive Data Tab The Receive Data Tab provides a convenient way of viewing the data that is returned by the target device in response to the explicit message command sent. The data is shown in byte format with a selectable radix of either Decimal or Hex/BCD. The display shows 58 bytes of receive data, starting with the low byte of the first word. To update the Receive Data display with the current values stored in the DEM control block, click on the Refresh button.
Publication 1747-RM001G-EN-P - November 2008
Page 323
SLC Communication Instructions
12-57
04
0
Control Block Layout The control block layout is shown below. Table 12.25 SLC 5/0x DeviceNet Explicit Message (DEM) Control Block Structure 15 Word 0
14
EN
13
12
DN
ER
11
Word 1
10 WS
09
08
07
06
05
AB
Error Code
IMR
Message Timeout Preset
Word 2
Message Timeout Accumulator
Word 3
Message Timer Scaled Zero
Word 4
Unused
Word 5
Unused
Word 6
Transaction ID
Scanner Command
Word 7
Scanner Port (always 0x00)
Size of Send Data (in bytes)
Word 8
Service Code
Target MAC ID
Word 9
Reserved (not transmitted)
Class
Word 10
Instance
Word 11
Reserved (not transmitted)
Word 12
Transaction Send Data (next 26 words)
----------
03
02
01
Attribute (optional)
Word 37 Word 38
Transaction ID
Scanner Status
Word 39
Scanner Port (always 0x00)
Size of Reply Data (in bytes)
Word 40
Reply Service Code
Target MAC ID
Word 41
Transaction Reply/Receive Data (next 29 words)
---------Word 69
Publication 1747-RM001G-EN-P - November 2008
Page 324
12-58
SLC Communication Instructions
This output instruction lets you initiate connected CIP Generic messages via channel 1 on a SLC 5/05 processor. These messages can be initiated to EtherNet/IP nodes on the same Ethernet network as the SLC 5/05 or can be bridged through a ControlLogix gateway to nodes on remote ControlNet or Ethernet networks. The instruction is similar in operation to a standard MSG instruction.
EtherNet/IP Explicit Message (EEM)
Fixed SLC SLC SLC SLC SLC 5/01 5/02 5/03 5/04 5/05 •
EEM Instruction Parameters Enter the following parameters when programming this instruction: • Control Block is an integer file address that you select. It is a block of words, containing the status bits and other data associated with the EEM instruction. • Control Block Length is a display-only field that indicates how many integer file words are being used by the control block. For the EEM instruction, the length is always 58 words.
EEM Instruction Setup Screen Parameters Parameters for This Controller on the General Tab • Channel Always 1. • Size in Words (Receive Data) This field defines the size of the integer data file that will be used to store the data that is returned by this explicit message command. For best performance, define this file size to only be as large as is required. If no receive data is expected, you may leave this field at 0 and no receive data file will be defined. If unsure of how much data will be returned, you may select up to the maximum size of 124 words, and then reduce the size later based on experience. • Size in Words (Send Data) This field defines the size of the integer data file that will be used to store the data that is sent along with this explicit message command. For best performance, define this file size to only be as large as is required. If no send data is required, you may leave this field at 0 and no send data file will be defined. If unsure of how much data will be sent, you may select up to the maximum size of 124 words when defining the instruction, and then reduce the size later based on experience. Publication 1747-RM001G-EN-P - November 2008
Page 325
SLC Communication Instructions
12-59
• Data Table Address (Send Data) If Size in Words (Send Data) is non-zero, then this field requires a starting integer (N) file address for storing the Send Data. • Data Table Address (Receive Data) If Size in Words (Receive Data) is non-zero, then this field requires a starting integer (N) file address for storing the Receive Data.
Parameters for Target Device on the General Tab • Message Timeout (x1 sec) Message Timeout for the EEM cannot be modified in the Setup Screen. It is assigned by the processor and is determined by adding the Channel 1 Msg Connection Timeout value to the Channel 1 Msg Reply Timeout value, then adding five seconds. This value can be modified by changing one or both of the timeout values in the Channel 1 Channel Configuration Screen. The modified message timeout applies to all EEM and Ethernet MSG instructions. • MultiHop Always Yes. • Service This pulldown lets you select services based on name rather than Service Code. The Custom service lets you enter in any Service Code in the hexadecimal range of 1 to 7F. The services listed in the pulldown selection are: – Read Assembly. – Write Assembly. – Write Output Point. – Read Output Point. – Read Input Point. – Read Parameter. – Write Parameter. – Read Analog Input. – Write Analog Output. – Generic Get Attribute Single. – Generic Set Attribute Single. – Reset Identity Object. – Custom.
Publication 1747-RM001G-EN-P - November 2008
Page 326
12-60
SLC Communication Instructions
• Service Code (hex) This field is read-only unless the Custom Service is selected. Possible Service Codes are 1 to 7F (hex). See Volume 1 of the CIP Common Specification, Appendix A, for the list of valid explicit messaging Service Codes. • Class (hex)/(dec) Possible Classes are 0 to FFFF (hex). See Volume 1 of the CIP Common Specification for the list of defined Classes. You may either enter in a hexadecimal Class value in the (hex) field or a decimal Class value in the (dec) field. • Instance (hex)/(dec) Possible Instances are 0 to FFFF (hex). See Volume 1 of the CIP Common Specification for the list of valid Instances for each Class. You may either enter in a hexadecimal Instance value in the (hex) field or a decimal Instance value in the (dec) field. • Attribute (hex)/(dec) Possible Attributes are 0 to FF (hex). See Volume 1 of the CIP Common Specification for the list of valid Attributes for each Class. You may either enter in a hexadecimal Attribute value in the (hex) field or a decimal Attribute value in the (dec) field.
Publication 1747-RM001G-EN-P - November 2008
Page 327
SLC Communication Instructions
12-61
Definitions for Message Status Bits on the General Tab The table below lists the various status bits associated with the EEM instruction as displayed in the EEM instruction setup screen. Table 12.26 EEM Instruction Setup Screen Status Bits Bit Definition
Bit Mnemonic
Bit Address
Ignore if timed out
TO
0/8
Awaiting execution
EW
0/10
Continuous run
CO
0/11
Error
ER
0/12
Done
DN
0/13
Transmitting
ST
0/14
Enabled
EN
0/15
Waiting for queue space
WQ
7/0
• Ignore if timed out bit TO (word 0, bit 8) is set when the EEM instruction times out due to no reply being returned within the configured timeout period. You may also set this bit in order to abort the EEM instruction before it has completed. The ER bit will be set at the same time the TO bit is set. This bit is reset the next time the message rung goes from false to true. • Awaiting execution bit EW (word 0, bit 10) is set after the enable bit is set and the message is physically placed in one of the four available channel 1 transmit buffers. The EW bit is reset when either the ST or ER bit is set. Do not set or reset this bit. It is informational only. • Continuous run bit CO (word 0, bit 11) can be set in order to continually resend the EEM command. Once the CO bit is set and the EEM instruction is triggered, the EEM command will occupy one of the four channel 1 transmit buffers. Therefore, a maximum of four EEM and channel 1 MSG instructions may have their CO bits set at the same time. • Error bit ER (word 0, bit 12) is set when the message has failed to complete successfully. This bit is reset the next time the message rung goes from false to true. Do not set or reset this bit. It is informational only. • Done bit DN (word 0, bit 13) is set when the message has completed successfully. This bit is reset the next time the message rung goes from false to true. Do not set or reset this bit. It is informational only. • Transmitting bit ST (word 0, bit 14) is set when the Ethernet daughtercard has validated and accepted the EEM command for a transmission attempt. The command may not have been transmitted yet. Do not set or reset this bit. It is informational only.
Publication 1747-RM001G-EN-P - November 2008
Page 328
12-62
SLC Communication Instructions
• Enabled bit EN (word 0, bit 15) is set after the message rung goes from false to true and there is space available in either the channel 1 message buffers or message queue. It remains set until message transmission is completed and the rung goes false. If the message rung conditions remain true, you may retrigger the message instruction by resetting this bit after either the ER or DN bit has been set, indicating that the previous execution has completed. • Waiting for Queue Space bit WQ (word 7, bit 0) is set when the message rung goes from false to true, but the channel 1 message buffers and message queue are full. In order to assure that this EEM command gets processed, you must leave the message rung conditions true until the WQ bit is reset and the EN bit is set, indicating that the EEM command has been placed into the message queue. Do not set or reset this bit. It is informational only.
Error and Error Description on the General Tab The error codes for the EEM instruction are a superset of the MSG instruction error codes. Refer to p. 12-41 for a listing of the MSG instruction error codes. Table 12.27 lists other valid error codes. Table 12.27 EEM Instruction Error Codes Error Code
Description of Error Condition
51
CIP response error code.
52
Configuration error. Receive/send data size exceeds 124 words.
53
Configuration error. Response data > receive data file size.
54
Response error. Unsupported response format.
For error code 51, the error description displays the CIP response error code and description as documented in the CIP Common Specification, Appendix B. Any time the Error Code is nonzero, the EEM error (ER) bit is set.
MultiHop Tab The MultiHop Tab provides a way for the path to the destination node to be configured. This path can be as simple as the IP address of the destination node, or can include bridging through a Logix gateway to a remote ControlNet destination node or to a remote Ethernet destination node.
Publication 1747-RM001G-EN-P - November 2008
Page 329
SLC Communication Instructions
12-63
Send Data Tab The Send Data Tab provides a convenient way of viewing and entering in data to be sent along with the explicit message command. The data is shown in byte format with a selectable radix of either Decimal or Hex/BCD. The display only shows the number of words that are defined in the Size in Words (Send Data) field, starting with the low byte of the first word as defined in the Data Table Address (Send Data) field. If the Size in Words is zero, then no data is displayed. You can also change the data being viewed, but only when offline or during an online edit. Click on the data and enter in a byte value based on the current radix (0 to 255 for Decimal and 0 to FF for Hex/BCD). The changed data gets copied to the Send Data data table file when the rung is accepted. To update the Send Data display with the current values stored in the Send Data data table file, click the Refresh button.
Receive Data Tab The Receive Data Tab provides a convenient way of viewing the data that is returned by the target device in response to the explicit message command sent. The data is shown in byte format with a selectable radix of either Decimal or Hex/BCD. The display shows only the number of words that are defined in the Size in Words (Receive Data) field, starting with the low byte of the first word as defined in the Data Table Address (Receive Data) field. If the Size in Words is zero, then no data is displayed. To update the Receive Data display with the current values stored in the Receive Data data table file, click the Refresh button.
Publication 1747-RM001G-EN-P - November 2008
Page 330
12-64
SLC Communication Instructions
Control Block Layout Table 12.28 SLC 5/05 EtherNet/IP Explicit Message (EEM) Control Block Structure 15
14
13
12
11
10
09
08
07
06
TO
Error Code
05
Word 0
EN
ST
DN
ER
CO
EW
Word 1
Extended STS Size (in words)
Word 2
Extended Status Debug Word 1
Word 3
Extended Status Debug Word 2
Word 4
Total Response Size (in bytes)
Word 5
Unused
Word 6
Unused
Word 7
Unused
Reserved (internal bits)
Word 8
Reserved (internal bits)
Message Timer Preset
Word 9
Message Timer Scaled Zero
Word 10
Message Timer Accumulator
Word 11
Reserved (internal bits)
Word 12
AO=0 Reserved (internal bits)
Word 13
Reserved (internal bits)
Word 14
1st byte of IP Address String
Word 15
3rd byte of IP Address String
04
03
2nd byte of IP Address String
Word 34
41st byte of Address String
NULL byte of Longest String
Word 35
Unused
Message Type = 0 x 13
Word 36
ASA Service Code
Internal Object Identifier (IOI): Size
Word 37
Internal Object Identifier (0)
Word 38
Internal Object Identifier (1)
Word 39
Internal Object Identifier (2)
Word 40
Internal Object Identifier (3)
Word 41
Internal Object Identifier (4)
Word 42
Reserved
Word 43
Connection Path (0)
Word 44
Connection Path (1)
Word 45
Connection Path (2)
Word 57
Connection Path (14)
Publication 1747-RM001G-EN-P - November 2008
01
0
General STS
----------
----------
02
Connection Path Size in Words
WQ