The text of a manual · part 32 of 70
SLC 500 Instruction Set Reference Manual, pages 311 to 320
Pages 311 to 320 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 311
SLC Communication Instructions
12-45
All three instructions use an integer control block for storing the instruction parameters and a configuration setup screen, similar to the MSG instruction. The CIP commands consist of a Service Code; the object Class, Instance, and Attribute; and Send and Receive Data (if required for the selected Service Code). The setup screen provides a list of standard CIP Services to select from, including: • Read Assembly. • Write Assembly. • Read Parameter. • Write Parameter. • Generic Get Attribute Single. • Generic Set Attribute Single. In addition, a Custom setting lets you enter any Service Code. For the CEM and EEM instructions, send data and receive data are stored in separate data table files. For the DEM instruction, send data and receive data are both stored within the instruction control block.
This is an output instruction that lets you initiate unconnected CIP Generic messages via a 1747-SCNR ControlNet scanner module installed in the local chassis. These messages can be initiated to any nodes on the same ControlNet network as the 1747-SCNR, regardless of whether the destination node is in the scanner’s scan list or not, and regardless of whether the scanner is in Run mode or Idle mode. Each scanner module can process only one CEM instruction at a time. The instruction is similar in operation to a standard MSG instruction.
ControlNet Explicit Message (CEM)
Fixed SLC SLC SLC SLC SLC 5/01 5/02 5/03 5/04 5/05 • Output Instruction
•
•
CEM 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 CEM 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 CEM instruction, the length is always 67 words.
Publication 1747-RM001G-EN-P - November 2008
Page 312
12-46
SLC Communication Instructions
CEM Instruction Setup Screen Parameters The following sections provide parameters for the CEM instruction setup screens.
Parameters for This Controller on the General Tab • 1747-SCNR Slot This drop-down field lists all of the local slots that contain ControlNet scanner (1747-SCNR) modules within the IO Configuration. Select the slot number of the particular scanner module that this explicit message will be initiated through. • 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 250 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 248 words when defining the instruction, and then reduce the size later based on experience. • 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.
Publication 1747-RM001G-EN-P - November 2008
Page 313
SLC Communication Instructions
12-47
Parameters for Target Device on the General Tab • Message Timeout(x1 ms) The amount of time in milliseconds that the scanner will wait for a reply to the explicit message command. Range is 2 to 32767. • ControlNet Addr (dec) The target ControlNet node address. Valid range is 1 to 99. If you enter in the local scanner’s ControlNet node address, the command is executed by the local scanner. • Service This dropdown allows you to select services based on name rather than Service Code. The Custom service allows you to enter in any Service Code in the hexadecimal range of 1 to 7F. The services listed in the dropdown 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. – Generic Get Member. – Generic Set Member. – Reset Identity Object. – Custom. • 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.
Publication 1747-RM001G-EN-P - November 2008
Page 314
12-48
SLC Communication Instructions
• Class (hex)/(dec) Possible Classes are 0 to FF (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 FFFF (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. • Member (hex)/(dec) Possible Members are 0 to FFFF (hex). See Volume 1 of the CIP Common Specification for the list of valid Members for each Class. You may either enter in a hexadecimal Member value in the (hex) field or a decimal Member value in the (dec) field.
Definitions for Message Status Bits on the General Tab The table below lists the various status bits associated with the CEM instruction as displayed in the CEM instruction setup screen. Table 12.18 CEM Instruction Setup Screen Status Bits Bit Definition
Bit Mnemonic
Bit Address
Timeout
TO
08
Error
ER
12
Done
DN
13
Enabled
EN
15
Waiting for slot
WS
10
• Timeout bit TO (word 0, bit 8) is set when the scanner module times out the message either due to no response from the target device or due to no reply being returned within the configured timeout period. 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. Do not set or reset this bit. It is informational only.
Publication 1747-RM001G-EN-P - November 2008
Page 315
SLC Communication Instructions
12-49
• 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. • 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 process only one CEM 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 CEM instruction. In order 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 Scanner Code displays the explicit message status returned by the scanner module. A scanner code of 0 means no errors. Table 12.19 lists other valid scanner codes. Table 12.19 CEM Instruction Scanner Codes Scanner Code
Description of Scanner Status
201H
Invalid command data size
202H
Internal fault detected
204H
Invalid service code
205H
Invalid IOI size
206H
Invalid CIP request block contents
207H
CIP message request timeout
208H
CIP timeout value too small
Publication 1747-RM001G-EN-P - November 2008
Page 316
12-50
SLC Communication Instructions
A scanner code of 0x207 results in an error code of 1. All other scanner codes listed result in an Error Code of 2. Table 12.20 list all valid CEM instruction Error Codes. Table 12.20 Valid CEM Instruction Error Codes Error Code
Description of Error Condition
0
No error.
1
Timeout error. ControlNet explicit message timed out by scanner.
2
Scanner error. See Scanner Status.
3
Configuration error. Send file length > 248 or invalid IOI size.
5
Processor error. Invalid response.
6
Processor error. Unsolicited response received.
7
Configuration error. Size of response data > receive data size.
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 CEM 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 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 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 only shows 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 on the Refresh button.
Publication 1747-RM001G-EN-P - November 2008
Page 317
SLC Communication Instructions
12-51
04
0
Control Block Layout The control block layout is shown below. Table 12.21 SLC 5/0x ControlNet Explicit Message (CEM) Control Block Structure 15
14
13
12
DN
ER
11
10
09
07
06
TO
Reserved by 1747-SCNR
Word 0
EN
Word 1
Target MAC ID
Word 2
Message Timeout Preset (x1 ms)
Word 3
Complex I0I Size
Word 4
Reserved
Service Code
Word 5
Reserved
Class
Word 6
Instance
Word 7
Attribute
Word 8
Member
Word 9
Size of Command Data (Words)
Word 10
Request Status - Scanner Status (Scanner Code)
Word 11
Response Status
Word 12
Extended Status Size (Words)
Word 13
Size of response and status (Words)
Word 14
Complex IOI Buffer (Allows you to manually set IOI)
-------
WS
08
05
03
02
01
Word 63 Word 64
Error Code
Word 65
Extended Status Debug Word 1
Word 66
Extended Status Debug Word 2
Transaction ID
Publication 1747-RM001G-EN-P - November 2008
Page 318
12-52
SLC Communication Instructions
This is an output instruction that lets you initiate unconnected CIP Generic messages via a 1747-SDN DeviceNet scanner module installed in the local chassis. These messages can be initiated to any node on the same DeviceNet network as the 1747-SDN, as long as the node is in the scanner’s scan list. The scanner can be in either Idle mode or Run mode. Each scanner module can only process one DEM instruction at a time. The instruction is similar in operation to a standard MSG instruction.
DeviceNet Explicit Message (DEM)
Fixed SLC SLC SLC SLC SLC 5/01 5/02 5/03 5/04 5/05 •
•
DEM 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 DEM instruction. It also contains the Send and Receive data. • Control Block Length is a display-only field that indicates how many integer file words are being used by the control block. For the DEM instruction, the length is always 70 words.
DEM Instruction Setup Screen Parameters The following sections provide parameters for the DEM instruction setup screens.
Parameters for This Controller on the General Tab • 1747-SDN Slot This drop-down field lists all of the local slots that contain DeviceNet scanner (1747-SDN) modules within the IO Configuration. Select the slot number of the particular scanner module that this explicit message will be initiated through. • Size in Send Data (Bytes) This field defines how many bytes of data are sent along with this explicit message command. If unsure of how much data will be sent, you may select up to the maximum size of 52 bytes when defining the instruction, and then reduce the size later based on experience.
Publication 1747-RM001G-EN-P - November 2008
Page 319
SLC Communication Instructions
12-53
Parameters for Target Device on the General Tab • Message Timeout(x1 sec) The amount of time in seconds that the processor will wait for a reply from the scanner to the explicit message command. Range is 0, 2 to 255. Like the Message Timeout in a standard MSG instruction, a value of 0 disables the Message Timeout and a value of 1 second gets bumped to 2 seconds upon instruction execution. If the built-in Message Timeout is disabled, user programmed timeout logic must be included to avoid a message lockup in the case where a reply is lost. • DeviceNet Addr (dec) The target DeviceNet node address. Valid range is 0 to 63. If you enter in the local scanner’s DeviceNet node address, the command is executed by the local scanner. • Service This pulldown lets you select services based on name rather than Service Code. The Custom service allows you to 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. • 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.
Publication 1747-RM001G-EN-P - November 2008
Page 320
12-54
SLC Communication Instructions
• Class (hex)/(dec) Possible Classes are 0 to FF (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. Note that if the value of the Attribute is set to 0, the DeviceNet scanner does not transmit an Attribute byte. Some Service Codes require that a zero-value Attribute byte be transmitted. For these Service Codes, the first byte of the Send Data must be set to zero and the Size of Send Data (Bytes) must include this additional byte.
Definitions for Message Status Bits on the General Tab The table below lists the various status bits associated with the DEM instruction as displayed in the DEM instruction setup screen. Table 12.22 DEM Instruction Setup Screen Status Bits Bit Definition
Bit Mnemonic
Bit Address
Abort
AB
08
Error
ER
12
Done
DN
13
Enabled
EN
15
Waiting for slot
WS
10
• Abort bit AB (word 0, bit 8) lets you abort an executing DEM instruction by setting this bit. The ER bit will be set as soon as the AB bit is set. This bit is reset the next time the message rung goes from false to true. • 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. Publication 1747-RM001G-EN-P - November 2008