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 16 of 41

AdaptaScan Bar Code Readers (Cat. Nos. 2755-SN3, -SN5, and -SN8) Application Guide: 8 - Communicating with a PLC-5 over an RS-232 or RS-422 Link

Pages 129 to 140 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 129

Communicating with a PLC-5R over an RS-232 or RS-422 Link Overview

The New Generation PLC-5 processors from Allen–Bradley have a user port that can be used to interface a single point AdaptaScan Bar Code Reader using either RS-232 or RS-422 communication. This document includes cable diagrams and configuration information for the AdaptaScan readers. It also includes an example PLC-5 program which is needed to establish communication through Channel 0 on the new PLC-5 platform.

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 • 1785 PLC-5 processor • 1771 chassis • 1771 power supply • appropriate cables to program the PLC-5 and to configure the AdaptaScan Bar Code Reader • 1784-KT or equivalent card installed in your personal computer to enable you to program the PLC-5

Software Requirements

The software requirements for this application are: • 2755-ASN AdaptaScan Offline Programming Software • PLC-5 programming software

Related Publications

Publications you might want to refer to include: Publication

Description

2755-837

AdaptaScan Bar Code Readers User Manual

2755-838

AdaptaScan Software User Manual

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

Publication 2755-6.8

Page 130

8–2

Communicating with a PLC-5R over an RS-232 or RS-422 Link

Connecting the PLC-5 Processor to the Reader

For this application the PLC-5 occupies the first slot in a 1771 chassis. Power is supplied externally or from an internal power supply installed in any acceptable slot in the 1771 chassis. Bulletin 1771 Chassis

Channel 0

PLC-5

Power Supply RS-232 or RS-422

RS232 Port AdaptaScan Reader

Cabling RS-232 cabling must be constructed to connect the RS232 port of the AdaptaScan reader to User Port 0 on the PLC-5. Refer to this cabling diagram.

Publication 2755-6.8

PLC-5/30, /40, /60 Channel 0

AdaptaScan RS232 Terminal Strip

PIN

PIN

2

Rx

3

Tx

7

GND

Page 131

Communicating with a PLC-5R over an RS-232 or RS-422 Link

8–3

For RS-422 installations, a special pinout cable must be constructed. PLC-5/30, /40, /60 Channel 0

AdaptaScan Terminal Strip RS-422/485

PIN

PIN

2 TxD+

RxA–

14 TxD–

RxB+

3 RxD+

TxA–

16 RxD–

TxB+

Note: Maximum run length 200 feet

Configuring the PLC Processor

The screens in this section show the software configuration for the PLC-5 using the programming software.

• Set the PLC-5 Channel 0 to USER in the Channel Overview screen.

Publication 2755-6.8

Page 132

8–4

Communicating with a PLC-5R over an RS-232 or RS-422 Link

• Configure Channel 0 in the User Mode Channel 0 Configuration screen.

Note: Termination 2 is set for \0xa or Line Feed [LF], and Termination 1 is set for \0xd or Carriage Return [CR]. These terminators, along with the ARL instruction in the PLC-5, allow the User port to read in one message at a time with [CR][LF] terminators.

PLC-5 Ladder Logic Program

The sample ladder logic below instructs the PLC-5 to:

• Read one string of ASCII data terminated with a [CR][LF].

Refer to your PLC-5 user manual for detailed information on using the PLC-5 programming software including the ASCII instructions.

Publication 2755-6.8

Page 133

Communicating with a PLC-5R over an RS-232 or RS-422 Link

Configuring the Reader

8–5

This section shows how to configure the AdaptaScan Bar Code Reader using the AdaptaScan Software (Catalog No. 2755-ASN). The procedures in this section show how to: • configure a DeviceNet address • configure a bar code label and symbol • configure the scanner • configure the decoder trigger • configure the serial port • configure the content and format of messages These procedures provide general guidelines for setting up an application. You may need to modify the configuration for your application needs.

Create a New Project Create a new project named PLC for one AdaptaScan Bar Code Reader (Bar Code Reader 1). 1. Choose New from the Project menu to create a new project. 2. Click the New button to add a bar code reader (Bar Code Reader 1) to the project.

Publication 2755-6.8

Page 134

8–6

Communicating with a PLC-5R over an RS-232 or RS-422 Link

3. Choose Edit from the Project menu to rename the project PLC.

4. Click Save to save the project under the new name and then Close to return to the Project dialog.

Define the Bar Code Label 1. Click the Labels button to open the Bar Code Labels dialog. 2. Click the New button to define a label.

3. Click the New button to define a symbol for the label.

4. Select a symbology and any other parameters (Identifier, Lengths) required by your application.

Publication 2755-6.8

Page 135

Communicating with a PLC-5R over an RS-232 or RS-422 Link

8–7

5. Click OK until you return to the Bar Code Labels dialog. 6. Click Save and then Close to return to the Project dialog.

Define the DeviceNet Address 1. Click the Device button on the Project dialog.

2. Set the DeviceNet address. 3. Connect the 2755-NC43 or -NC48 Configuration Cable to the reader. 4. Click the Apply button. 5. Click Save and Close to return to the Project dialog.

Publication 2755-6.8

Page 136

8–8

Communicating with a PLC-5R over an RS-232 or RS-422 Link

Configure the Scanner 1. Click the Scanner button on the Project dialog to open the Scanner dialog.

2. Configure the scan pattern and use the Focus procedure for optimum scanner focus. 3. Click the Close button and return to the Project dialog.

Configure the Decoder Trigger This application uses a Timer to trigger the reader’s decoder. The Timer is typically used during application setup. Refer to Publication No. 2755-837 for other input sources that trigger the decoder. 1. Click the Decoder button from the main Project dialog. 2. Under Triggered By, select Timer from the Input list.

3. Click Save and then Close to return to the main Project dialog.

Publication 2755-6.8

Page 137

Communicating with a PLC-5R over an RS-232 or RS-422 Link

8–9

Configure the Serial Port 1. Click the Serial Port button on the main Project dialog.

2. Verify that Terminal is selected in the Protocol list box. Also verify that the settings match the Channel 0 User settings. In this example, RS232 is selected in the Connection list box. 3. Click the Edit button to open Terminal dialog. 4. Set the attributes as necessary.

5. Click OK to exit the dialog. 6. Click the Save and then the Close button on the Serial Port dialog to return to the Project dialog.

Publication 2755-6.8

Page 138

8–10

Communicating with a PLC-5R over an RS-232 or RS-422 Link

Create a Message The Message dialogs define the format and content of message data sent to the host by the reader when bar codes are decoded. 1. Click the Message button from the main Project dialog. 2. Under Triggered By, check the Enable check box.

3. Under Device, select Bar Code Reader 1. 4. Under Input, select [Decoder]. 5. Click the New button to define a message field.

6. Under Symbol Source, select Bar Code Reader 1. 7. Under Bar Code Labels & Symbols, select Symbol 1. 8. Check (enable) the Match Exactly check box.

Publication 2755-6.8

Page 139

Communicating with a PLC-5R over an RS-232 or RS-422 Link

8–11

9. Click the Edit button to open the Message Field Edit dialog.

10. Under Replacement Strings, type no read in the Fail: field. Bar code data is sent to the controller on a valid read. The Fail string sends the characters “no read” when a no read occurs. 11. Click OK to return to the Message Field dialog. 12. Click OK to return to the Message dialog.

Define the Message Format The format of the message is defined below. 1. Click the Format button from the Message dialog. 2. In the Trailer field, type \r\n (Carriage Return, Line Feed). 3. Under Message Destination, select Serial Port.

4. Click OK to return to the Message dialog. 5. Click the Save button and then the Close button to return to the Project dialog.

Publication 2755-6.8

Page 140

8–12

Communicating with a PLC-5R over an RS-232 or RS-422 Link

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

Publication 2755-6.8

If the AdaptaScan Bar Code Reader is configured correctly and the PLC-5 program is entered as shown in this application example, bar code data or “no read” will be sent to the PLC user port.