Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 27 of 41

AdaptaScan Bar Code Readers (Cat. Nos. 2755-SN3, -SN5, and -SN8) Application Guide: 12 - Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging, pages 222 to 230

Pages 222 to 230 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 222

-

Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging Overview

This application describes how to connect and configure an AdaptaScan Bar Code Reader to communicate with a PLC-5 processor over a DeviceNet network in a master/slave mode using explicit messaging. A 4 character Interleaved 2 of 5 bar code symbol is used in this application. The DeviceNet network has the following nodes: • AdaptaScan Bar Code Reader on node 3 • 1771-SDN DeviceNet Scanner on node 1 • Computer running DeviceNet Manager Software on node 62 The DeviceNet terminal block in the reader’s wiring base connects the AdaptaScan Reader to the DeviceNet network. The wiring base has two DeviceNet terminal blocks; one for upstream connection and one for downstream connection.

Hardware Requirements

The hardware items required for this application are: • 2755-SN3, -SN5 or -SN8 AdaptaScan Bar Code Reader • 2755-NB40 or -NB41 Wiring Base • 2755-PW46 or -PW47 Power Supply • 2755-NC43 or -NC48 Configuration Cable • 1771-SDN Scanner Module (v3.04 firmware or later) • 1770-KFD DeviceNet RS-232 Interface • DeviceNet trunk cable • 1771 I/O chassis • PLC-5 processor • Computer running Windows 3.1 (or later) or Windows 95 • 9-to-25 Pin Adapter (for Computer with 25-pin COM port)

Software Requirements

The software requirements for this application are: • 2755-ASN AdaptaScan Offline Programming Software (v8.0 or later) • 6200 Series Programming Software • 1787-MGR DeviceNet Manager Software (v3.0 or later)

Publication 2755-6.8

Page 223

12–2

Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging

Related Publications

Related publications include: Publication

Description

2755-837

AdaptaScan Bar Code Readers User Manual

2755-838

AdaptaScan Software User Manual

1787-6.5.3

DeviceNet Manager Software Manual

1771-6.5.118

DeviceNet Scanner Configuration Manual

In addition, you may want to refer to the PLC-5 Hardware and Software User Manuals.

Connecting to the DeviceNet Network

The following illustration shows the three nodes of the DeviceNet master/slave network.

Computer 1770-KFD DeviceNet Interface Card

PLC-5 Processor 1771-SDN DeviceNet Scanner

Node 62

AdaptaScan Bar Code Reader

1787-MGR DeviceNet Manager Software 6200 Series Programming Software 2755-ASN AdaptaScan Software

Node 1 DeviceNet Trunk Cable

Connecting a Power Supply to the Reader

Node 3

DeviceNet Trunk Cable

The following illustration shows how to connect a 2755-PW46 or -PW47 power supply to a single bar code reader. Use a shielded cable (Belden 9316 recommended) to make the connections. Connect the shield to the ground screw on the reader’s wiring base. 2755-PW46 Power Supply

Reader 24V+

V-

Ground Screw on Wiring Base

Publication 2755-6.8

Page 224

Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging

PLC Ladder Logic

12–3

This section provides the PLC-5 ladder logic program and data monitor results. The ladder logic uses: • File N23 as the BTR file • File N22 ad the BTW file The data table shows file N23 after the AdaptaScan Reader successfully reads and transfers data ‘0300’ (from a 4 character, Interleaved 2 of 5 symbol) to the PLC-5 data table. File N23

N22

Location Word 0 Word 1 Word 0

Bit 15

Word 0

Bit 0

Word 1

Bit 7

Description Status word for SDN Scanner ‘New Message Being Sent’ bit from AdaptaScan Reader Status word 1=SDN Scanner in run mode 0=SDN Scanner in idle mode Idle mode is used to write the DeviceNet configuration to the SDN Scanner. ‘Send Message’ bit to AdaptaScan Reader

Message AddressingD Message Data is formatted the same as messages sent through the serial port. When setting up the DeviceNet scanner for addressing message data, use the following table. Description Number of Characters (LSB) Number of Characters (MSB) First Message Character (Beginning of Message) Other Message Characters from left to right Last Message Character (End of Message)

Word #

Byte #

➀➁

2 3

2

4 3

3+N where N is the number of characters in the message.

➀ Bytes #0 and #1 (word 1) are reserved for Discrete I/O. ➁ Poll Rx Size = 4 + (# of Characters in string).

Message data is addressed and sent to other DeviceNet devices through a DeviceNet scanner (Catalog No. 1771-SDN or 1747-SDN). To configure the scanner, you will need to provide the size of the message data, the beginning byte and bit number of the message and the destination of the message data.

Publication 2755-6.8

Page 225

12–4

Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging

Message Flow Control DeviceNet Input #8 and Output #16 control the transmission of bar code messages when using DeviceNet master-slave. Message flow control (handshaking) lets the controller know that data is available and that the reader does not send out messages faster than they can be received. Your controller logic program must transfer the message data and set the DeviceNet Input #8 (Send Next Data) for message flow control. New Data Is indicated by changing the state of DeviceNet Output #16 of the DeviceNet I/O. A change of state (0 to 1 or 1 to 0) indicates that a new message is being sent. Send Next Data Is indicated by changing the state of DeviceNet Input #8 of the DeviceNet I/O. A change of state (0 to 1 or 1 to 0) indicates that the controller is ready to receive the next message. Flow Control Example The following shows how DeviceNet Input #8 and Output #16 control the transmission of messages. Output #16 is changed by the reader and Input #8 is changed by the controller. DeviceNet Scan Number

Message Data

1 - Poll

-

1 - Response 2 - Poll 2 - Response 3 - Poll 3 - Response

Publication 2755-6.8

No Message Sent

DeviceNet Output #16 OFF (0)

Message 1 Sent

ON (1) ON (1)

Message 2 Sent

DeviceNet Input #8 OFF (0)

OFF (0) OFF (0)

Page 226

Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging

12–5

Note: The following ladder logic program is for reference only. Application specific interlocks may be necessary.

Note: If you are using channel B instead of channel A, bit 2 of word 0 needs to be set to 1.

Publication 2755-6.8

Page 227

12–6

Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging

Data Table File N23 Monitor In Data Table File N23: • N23:1 contains the DeviceNet status bits • Bit 15 is the control bit from the AdaptaScan Reader which toggles between 0 and 1 to indicate a ‘new message being sent’ • N23:2 is the byte count (4) of the message sent from the reader • N23:3 is the start of the data read 3000. Data is actually 0300. All data is byte swapped. 1771-SDN to AdaptaScan Interface Data Table

Processor File :MASTER.ACH

Data Table File N23

Address

Data (Radix = ASCII)

N23:0

\00\00

\80\01

\00\04

3 0

0 0

\00\00

\00\00

\00\00

\00\00

\00\00

N23:10

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:20

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:30

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:40

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:50

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:60

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:70

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:80

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:90

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:100

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:110

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:120

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:130

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:140

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

N23:150

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

\00\00

Data Table File N22 Monitor Below is a partial listing of the Data Table File N22. The table shows N22:1 bit 7 as the DeviceNet status bit which toggles between 0 and 1 to indicate ‘send next message’. 1771-SDN to AdaptaScan Interface Data Table

Publication 2755-6.8

Processor File: MASTER.ACH

Address

Data (Radix=BINARY)

N22:0

0000000000000000

N22:1

0000000010000000

N22:2

0000000000000000

N22:3

0000000000000000

Data Table File N22

Page 228

Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging

Configuring the DeviceNet Scanner

12–7

This section describes how to configure the 1771-SDN Scanner using the DeviceNet Manager software. Before configuring the 1771-SDN Scanner, you must wire the DeviceNet network and apply DeviceNet Address of 3 to the AdaptaScan Bar Code Reader. See page 12–15. To configure the 1771-SDN DeviceNet Scanner: 1. Double-click the DeviceNet Manager icon. 2. Create a new project with the network name Network 1. 3. Click the Build Online button to create a DeviceNet network. The network should have the following nodes:

• Node 1 – 1771-SDN Scanner Module • Node 3 – 2755-SNx AdaptaScan Bar Code Reader • Node 62 – 1787-MGR DeviceNet Manager

Publication 2755-6.8

Page 229

12–8

Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging

4. Double-click the 1771-SDN Scanner Module to open the 1771-SDN Module and Channel Configuration dialog.

5. Set the following PLC Interface Addresses. All other default values can remain the same. BXfer 62

Input N23:0

Output N22:0

The PLC ladder logic uses these addresses in the Block Transfer Read (N23:0) and Block Transfer Write (N22:0) instructions. The SDN scanner maps data from the AdaptaScan Reader to its 62 word file. This selection maps data to the N23 file in the PLC. The BTW instruction writes data from the N22 file to the 62 word file in the SDN scanner. If you are using an AdaptaScan with v7.0 firmware on a network with 2 or more nodes, change the Interscan Delay parameter to 20 ms. This will allow the AdaptaScan more CPU time to process bar code data instead of responding to DeviceNet polls. Note: Version 8.0 of the AdaptaScan Offline Programming Software and firmware minimizes DeviceNet polling interruption of scanning.

Publication 2755-6.8

Page 230

Communicating with a PLC-5 Processor on a DeviceNet Network using Explicit Messaging

12–9

6. Click the Edit Scan List button to open the Scan List Editor.

7. Select A03 and click the Edit I/O Parameters button. 8. Edit the following parameters in the Edit Device I/O Parameters dialog: • Under I/O Type, select the Polled check box. • In the Poll Rx Size box, type 8 (Bytes) • In the Poll Tx Size box, type 1 (Bytes) • From the Poll Rate list box, select Every Scan. The dialog should look like this:

9. Click OK to return to the Scan List Editor dialog. Node 3 (AdaptaScan) is enabled and will be polled by the SDN scanner. The SDN scanner will expect 8 bytes of data (4 characters + 4 bytes of overhead) and will transmit 1 byte of data back to the module (BTW N22:1).

Publication 2755-6.8