The text of a manual · part 22 of 41
AdaptaScan Bar Code Readers (Cat. Nos. 2755-SN3, -SN5, and -SN8) Application Guide: 10 - Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging, pages 183 to 192
Pages 183 to 192 of 354, from AdaptaScan Bar Code Readers (Cat. Nos. 2755-SN3, -SN5, and -SN8) Application Guide
The original document is the PDF (3.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 Accu-Sort 2755-SN3, Accu-Sort 2755-SN5, Allen-Bradley 2755-SN5, Accu-Sort 2755-SN8 and Allen-Bradley 2755-SN8
Page 183
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
10–21
7. Click the Outputs button to specify which output activates when a match occurs.
8. Under Available Outputs, select Discrete Input/Output 1. 9. Click the Add>> button to add this selection to the Output To: area. 10. Click OK to return to the main Match Table dialog.
Publication 2755-6.8
Page 184
10–22
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
Configure for a Package 1. Click the Package button to open the Package dialog.
2. Click the new button to create a Package. 3. Under Mode, select No-Read or No-Match. This mode is used to determine when a label is not read or does not match the rule defined in the Match function. 4. Highlight Match 1 to enable the Match function.
5. Click OK to return to the main Package dialog.
Publication 2755-6.8
Page 185
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
10–23
Configure for an Output 1. Click the Output To button to specify which output activates when a No-Read or No-Match occurs.
2. Under available Outputs, select Discrete Input/Output 2. 3. Click the Add>> button to add this selection to the Output To: area. 4. Click OK to return to the main Match Table dialog. 5. Click Save and Close to return to the main Project dialog.
Sending the Configuration to the Reader
From the main Project dialog, click the Send Device button to download the configuration to the bar code reader. Use the Monitor dialog to verify the decoding of bar code labels.
Running the Application
If the: • AdaptaScan Reader is configured correctly, • the 1747-SDN Scanner is configured correctly, and • the ladder program is entered as shown in this application, you will see bar code data or ‘nr’ in the SLC M1 file (N23) as bar code symbols are decoded. Remember that all data is byte swapped. If the 1747-SDN Scanner is not working properly, refer to the troubleshooting section.
Publication 2755-6.8
Page 186
10–24
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
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 in the SLC processor that is controlling these devices. You can use Explicit Message Program Control only with devices that are slaves of your 1747-SDN Scanner Module. These slave devices must be mapped in the scanner module’s scan list. Use the Explicit Message Program Control feature to: • transmit configuration data from your scanner 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
Publication 2755-6.8
Page 187
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
10–25
Explicit Message Program Control Feature
MC0 file transfer (including words 224-255) (sent from processor to scanner module)
4 MC1file transfer (including words 224-255) (sent from scanner 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 MC1 file transfer is completed. TXID’s are deleted and can be reused.
DeviceNet trunk line
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.
Master’s Explicit Request
AdaptaScan Bar Code Reader
DeviceNet drop line Slave’s Explicit Response
1203-GK5 Communication Adapter
1305 AC drive
1. Format an M0 file transfer in the processor to send an Explicit Message Request to the scanner module (download). 2. The scanner 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 2755-6.8
Page 188
10–26
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
Formatting the Explicit Message Transaction Block Up to ten 32-word transaction blocks may be queued within the scanner 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 scanner 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 cmd/status word 224 port size word 225 service
MAC ID word 226
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. 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
Publication 2755-6.8
Reserved
Page 189
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
10–27
For each upload, the status code provides the processor with status on the device and its response. Status Code
Description
0
Ignore transaction block (block empty).
1
Transaction completed successfully
2
Transaction in progress (not ready)
3
Error – slave not in scan list
4
Error – slave offline
5
Error – DeviceNet port disabled/offline
6
Error – transaction TXID unknown
7
Unused
8
Error – Invalid command code
9
Error – Scanner out of buffers
10 11
Error – Other Client/server transaction in progress 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 15 Transaction Header (3 words)
• TXID (transaction ID) – When you create and download a
0 TXID cmd/status word 224 port size word 225 service
MAC ID word 226
Transaction Body (29 words)
• word 255 One word = two bytes = 16 bits
Reserved
• •
• 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 to 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. 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 to 63. The port and MAC ID attributes coupled together identify the target slave device. The slave device must be listed in the scanner module’s scan list 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 2755-6.8
Page 190
10–28
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
The following figure describes the format and mapping of transaction blocks for request and response messages in the scanner module. Format of 32-word M0 Transfer File for Explicit Message Request 15 0 Transaction Header (3 words)
TXID command port size service
Format of 32-word M1 Transfer File for Explicit Message Response 15 0 word 224
MAC ID
Transaction Header (3 words)
TXID status port size service
MAC ID word 224
Class Instance Attribute (optional)
Transaction #1
Transaction #1 Service Response Data
Service Data word 225 word 225
Processor and Scanner Module Manage Messages File transfer operations between the processor and the scanner always originate in the processor. The scanner module can only wait 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 scanner module, a ladder logic program in the processor polls the scanner 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 scanner 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 scanner module a number of times before the scanner returns a Response Transaction Block. The scanner module recognizes I/O data and control as higher priorities over explicit messaging on DeviceNet.
Publication 2755-6.8
Page 191
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
10–29
Message lengths and slave device types impact transaction message completion times. If the processor has queued multiple Explicit Message Transactions to the scanner 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 using the TXID field. Processor
Scanner Module
DeviceNet Network
M0 file transfer Request Transaction Block
Request Transaction Blocks
Scanner Request Queue
Execute DeviceNet Explicit Message Requests and Responses
Process Requests and Responses
Ladder Scans
Slave Device
Done or Error-detected
Response Transaction Block
M1 file transfer
Response Transaction Blocks
Scanner Response Queue
Explicit Message Program Control Limitations • The processor is always the DeviceNet client and the slave is always the DeviceNet server. • A maximum of 10 Explicit Message Request Transaction Blocks with the execute command can be queued to the scanner module at any time. For example, 10 M0 file transfers containing one transactions each, can be queued at any time. The scanner module receives and deletes any additional client/server requests with the execute command over the maximum of 10.
Publication 2755-6.8
Page 192
10–30
Communicating with an SLC 5/03 Processor on a DeviceNet Network using Explicit Messaging
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 scanner module supports one transaction block per upload and download. • Request Transaction Blocks can only be queued for slave devices of the scanner module and must appear in the scanner module’s scan list. • If a slave device is not communicating at the time the scanner module processes its Request Transaction Block, the scanner module will return an error status for that transaction. • At a minimum, the scanner 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 scanner 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 scanner module as an error. The error code is returned in the status attribute of the transaction header.
Publication 2755-6.8