The text of a manual · part 20 of 22
1747-SDN DeviceNet Scanner Module User Manual: E - Explicit Message Program Control
Pages 143 to 152 of 160, from 1747-SDN DeviceNet Scanner Module User Manual
The original document is the PDF (3.9 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-SDN
Page 143
Appendix
E
Explicit Message Program Control
Using Explicit Message Program Control
Use the Explicit Message Program Control feature to configure device parameters on your DeviceNet network via the M0 and M1 files. Use the Explicit Message Program Control feature to: • transmit configuration data from your module to its slave devices on your DeviceNet network. • receive status and diagnostics from these devices on your DeviceNet network. • make runtime adjustments to device parameters according to changing conditions detected by your processor.
143
Publication 1747-UM655B-EN-P - June 2007
Page 144
144
Explicit Message Program Control
How the Explicit Message Program Control Feature Works 1 Explicit Message - A message used to transmit commands, data, requests for data or responses. The message is sent from a client on the DeviceNet network to a server on that network.
MO file transfer (including words 224…255) (sent from processor to module).
4 M1 file transfer (including words 224…255) (sent from module to processor).
Request - An explicit message sent by a client to a server requesting the server to perform a function. Response - An explicit message sent by a server to a client in response to the client’s request. For every request issued, there is a response.
5
M1 file transfer is completed. TXIDs are deleted and can be reused.
Master’s Explicit 2 Request
DeviceNet Trunk Line DeviceNet Drop Line
3 Slave’s Explicit Request
1203-GK5 Communication Adapter
1305 AC Drive
1. Format an M0 file transfer in the processor to send an Explicit Message Request to the module (download). 2. The module transmits the Explicit Message Request to the slave device over the DeviceNet network. 3. The slave device transmits the Explicit Message Response back to the scanner and is queued into a file transfer buffer. 4. The processor uses an M1 file transfer to retrieve the Explicit Message Response from the scanner’s buffer (upload). 5. Format an M0 file transfer with a Delete Response Command and the current transaction ID read in step 4. The transaction IDs are deleted and can be reused.
Publication 1747-UM655B-EN-P - June 2007
Page 145
Explicit Message Program Control
145
The module requires a precisely-formatted M0 and M1 file transfer size of 32 words including words 224…255. The module uses the file memory content as a client/server request.
How to Format the Explicit Message Transaction Block Up to ten 32-word transaction blocks may be queued within the module for Explicit Message Program Control. The transaction blocks accommodate both the download of Explicit Message Requests and the upload of Explicit Message Responses. The module can accommodate one request or response for each transaction block. You must format each transaction block as shown in the following figure. 15 Transaction Header (3 words)
0 TXID Port
CMD/Status Size
Word 224
Service
MAC ID
Word 226
Word 225
Transaction Body (29 Words)
Word 255 One Word = Two Bytes = 16 Bits
The transaction block is divided into two parts. • Transaction header – contains information that identifies the transaction to the scanner and processor. • Transaction body – in a request, this contains the DeviceNet Class, Instance, Attribute and Service Data portion of the transaction. In a response, this contains only the response message. Each of the data attributes in the transaction header are one byte in length. • Command/status – for each download, you assign a command code to instruct the scanner how to administer the request.
Publication 1747-UM655B-EN-P - June 2007
Page 146
146
Explicit Message Program Control
Command Code
Description
0
Ignore transaction block (block empty)
1
Execute this transaction block
2
Get status of transaction TXID
3
Reset all client/server transactions
4
Delete transaction from response queue
5…255
Reserved
For each upload, the status code provides the processor with status on the device and its response.
Publication 1747-UM655B-EN-P - June 2007
Status Code
Description
0
Ignore transaction block (block empty)
1
Transaction completed successfully
2
Transaction in progress (not ready)
3
Error – slave not in scanlist
4
Error – slave offline
5
Error – DeviceNet port disabled/offline
6
Error – transaction TXID unknown
7
Error – slave not responding to explicit request
8
Error – invalid command code
9
Error – scanner out of buffers
10
Error – other Client/server transaction in progress
11
Error – could not connect to slave device
12
Error – response data too large for block
13
Error – invalid port
14
Error – invalid size specified
15
Error – connection busy
16…255
Reserved
Page 147
Explicit Message Program Control
147
• TXID (transaction ID) – when you create and download a request to the scanner, the processor’s ladder logic program assigns a TXID to the transaction. This is a one-byte integer in the range of 1…255. The scanner uses this value to track the transaction to completion, and returns the value with the response that matches the request downloaded by the processor. The ladder logic program monitors rollover and usage of TXID values. 15 Transaction Header (3 words)
0 Word 224
Port
CMD/Status Size
Service
MAC ID
Word 226
TXID
Word 225
Transaction Body (29 Words)
Word 255 One Word = Two Bytes = 16 Bits
• Size – the size of the transaction body in bytes. The transaction body can be as many as 29 words (58 bytes) in length. If the size exceeds 29 words, an error code will be returned. • Port – the DeviceNet port (zero) where the transaction is routed. • MAC ID (node address) – the DeviceNet network address of the slave device where the transaction is sent. This value can range from 0…63. The port and MAC ID attributes coupled together identify the target slave device. The slave device must be listed in the module’s scanlist and be online for the Explicit Message transaction to be completed successfully. • Service – for each Explicit Message Request and Response, the service attribute contains the service request and response codes that match the corresponding request for the TXID.
Publication 1747-UM655B-EN-P - June 2007
Page 148
148
Explicit Message Program Control
The following figure describes the format and mapping of transaction blocks for request and response messages in the module. Transaction Blocks Format of 32-word M0 Transfer File for Explicit Message Request
Transaction Header (3 Words)
15 TXID
Format of 32-word M1 Transfer File for Explicit Message Response
15
0
Port
CMD/Status Size
Service
MAC ID
Word 224 Word 225 Word 226
Transaction Header (3 Words)
0 TXID
CMD/Status
Word 224
Port
Size
Word 225
Service
MAC ID
Word 226
Class Instance Attribute (optional Service Response Data
Service Data
Transaction #1
Transaction #1 Word 255
Word 255
How the Processor and Module Manage Messages File transfer operations between the processor and the scanner always originate in the processor. The module can wait only for the processor to download a transaction block to the module or request an upload of a transaction block from the module. Once an Explicit Message Request transaction block is downloaded to the module, a ladder logic program in the processor polls the module for the transaction block containing the Explicit Message Response for that request. This is done by the processor with an M1 file transfer on the module. Depending on the network load, the scanner could take a few seconds to complete the request. When a response is loaded, bit 15 of the module status register is set to 1. The program may have to poll the module a number of times before the scanner returns a Response Transaction Block. The module recognizes I/O data and control as higher priorities over explicit messaging on the DeviceNet network.
Publication 1747-UM655B-EN-P - June 2007
Page 149
Explicit Message Program Control
149
Message lengths and slave device types impact transaction message completion times. If the processor has queued multiple Explicit Message Transactions to the module for multiple slave devices, the transactions with the slaves may not complete in the order in which the requests were received. The slave responses are queued to the 32 word M1 file transfer in the order in which they are received. As response transaction blocks are uploaded, the processor’s program matches the responses to the requests by using the TXID field.
Processor
1747-SDN Module
DeviceNet Network
M0 File Transfer Request Transaction Block
Request Transaction Block
Ladder Scans
Process Requests and Responses
Scanner Request Queue
DeviceNet Explicit Message Requests and Responses
Slave Device
Done or Error-detached
Response Transaction Block
Response Transaction Block
Scanner Response Queue
M1 File Transfer
Explicit Message Program Control Limitations • The processor is always the DeviceNet client and the slave is always the DeviceNet server. • A maximum of ten Explicit Message Request Transaction Blocks with the execute command can be queued to the module at any time. For example, ten M0 file transfers containing one transactions each, can be queued at any time. The module receives and deletes any additional client/server requests with the execute command over the maximum of ten.
Publication 1747-UM655B-EN-P - June 2007
Page 150
150
Explicit Message Program Control
As transactions are removed from the queue and response transaction blocks are returned to the processor, additional transaction blocks can be issued in their place, as long as the total does not exceed ten. • The module supports one transaction block per upload and download. • Request Transaction Blocks can be queued only for slave devices of the module and must appear in the module’s scanlist. • If a slave device is not communicating at the time the module processes its Request Transaction Block, the module will return an error status for that transaction. • Check documentation of destination device for specifics concerning services supported and Class Instance Attribute information. At a minimum, the module supports the following DeviceNet services in Request Transaction Blocks.
Service Name
Service Code
Example
Get_Attribute_Single
0E hex
Upload a single parameter value from a device
Set_Attribute_Single
10 hex
Download a single parameter value to a device
Get_Attribute_All
01 hex
Upload all parameter values from a device
Set_Attribute_All
02 hex
Download all parameter values to a device
• All transaction blocks are processed, therefore an unused transaction block must be left blank. • Client/Server commands and requests with transaction IDs that are in use are ignored by the module. • If a slave device returns a DeviceNet error in response to the request downloaded from the processor, the scanner recognizes the error as a successful transaction (status code =1). A failure to respond to the request within the number of retries or timeout period specified for the Explicit Message Connection is recognized by the module as an error. The error code is returned in the status attribute of the transaction header.
Publication 1747-UM655B-EN-P - June 2007
Page 151
Explicit Message Program Control
151
Explicit Messaging Error Codes Error codes have two bytes of data. The first byte is a General Error Code and the second is an optional Additional Code Field that may contain additional information about the error. If this field is unused, the value 0FFH is shown. The following table describes explicit messaging error codes.
CIP Response Error Codes Numeric Code
Name
Description
02H
Resource unavailable
A needed resource was not available
08H
Service unsupported
Service is not defined or implemented for this class/instance
09H
Invalid attribute value
Data is invalid for the specified attribute
0BH
Already in requested state
Object is in the requested state - redundant request
0CH
Object state conflict
Not allowed with object in present state
0EH
Attribute cannot be set
Read-only attribute
0FH
Privilege violation
A permission/privilege check failed
10H
Device state conflict
Not allowed with device in present state
11H
Reply too big
Reply larger than buffer allocated when connection was established
13H
Too little data
Request included insufficient data
14H
Attribute not supported
Attribute number is incorrect
15H
Too much data
Request included extra data
16H
Object does not exist
Class/instance numbers are incorrect
18H
No stored attribute data
Attribute data was not saved prior to this request
19H
Store operation failure
Attribute data was not successfully saved
1FH
Vendor-specific error
Second byte may offer details - refer to vendor documentation
20H
Invalid parameter
Parameter associated with request is invalid
D0H
Reserved and service-specific errors
Used only when none of the standard error codes supplemented by the second byte accurately describes the problem
FFH
Publication 1747-UM655B-EN-P - June 2007
Page 152
152
Explicit Message Program Control
Publication 1747-UM655B-EN-P - June 2007