This is an example of a how to program a PLC5 Controller and, 2760-RB Module to read data from a Barcode Scanner

This is an example of a how to program a PLC5 Controller and, 2760-RB Module to read data from a Barcode Scanner Hardware One 1771 I/O Chassis ( Loca...
Author: Debra Joseph
173 downloads 0 Views 92KB Size
This is an example of a how to program a PLC5 Controller and, 2760-RB Module to read data from a Barcode Scanner

Hardware One 1771 I/O Chassis ( Local Chassis ) One 1785-L40B PLC5/40 Controller ; series E ; Rev H01; FW B.3 One 2760-RB Module; series A ; firmware revision L ; One Barcode Scanner ( Dumb Terminal Ascii Device ) One RS232 Null Modem cable In this case the PLC5 Controller and, 2760-RB Module are seated in a Local Chassis. The backplane of the Local Chassis and, the 2760-RB Module is configured for One Slot Addresing. The Barcode Scanner is connected to Port 1 of the RB Module . The Barcode Scanner is sending data into Port 1 of the RB Module with a Trailer attached. The Trailer type is a Carriage Return ( d ), Line Feed ( a ). ( For assistance with configuring the Addressing Modes for the 2760-RB Module and, PLC5 Controller refer to example in Technote G18423 (1) ; 2760-RB Module's User's Manual publication# 2760-ND001 ; Chapter 3 ; Enhanced PLC5 User Manual publication# 1785-6.5.12 chapter 23 ); Besides the Addressing Mode setting, no other switch settings in this case are required for the RB Module;

Barcode Scanner Communication Parameters Baudrate Parity Mode Number of Stop Bits Number of Data Bits

9600 NONE 1 8

____________________________________________________________ (

2760-RB Module Information After gaining access to the 2760-RB Module's Configuration Screen, Screen 3 is selected to configure Port 1 of the 2760-RB Module for use with a 2760-SFC1 Protocol Cartridge

Since the 2760-RB Module is communicating with an RS232 Dumb Termianl ( ASCII ) Device Port 1 is configured for 2760-SFC1 DT ( Dumb Terminal )

Screen 21 is selected to configure Port 1 of the 2760-RB Module as "Dumb Terminal Unspecified Protocol, 13 hf "

Since the Barcode Scanner is connected to Port 1 of the 2760-RB Module, Port 1 is configured as

2760-RB Module's Port 1 Configuration

The Bits per Second parameter for Port 1 of the 2760-RB Module is configured for 9600 because, the Bits per Second ( Baudrate ) of the Barcode Scanner is 9600 The Bits and, Parity parameter for Port 1 of the 2760-RB Module is configured for 8 and, None because, the Barcode Scanner Bits and, Parity are 8 and, None Port 1 of the 2760-RB Module is configured for RS232 because, the Barcode Scanner attached to Port 1 is a RS232 Device The Receiving Matrixing parameter for Port 1 of the 2760-RB Module is configured for "Disable" so that the data will be sent directly to the PLC5 Controller . The Byte Swapping parameter for Port 1 of the 2760-RB Module is configured for "Disable" . The HDR/TLR parameter for Port 1 of the 2760-RB Module is configured for "Enable" because, the data being received at Port 1 of the 2760-RB Module from the Barcode Scanner has a Trailer attached The Trailer Byte Length parameter for Port 1 of the 2760-RB Module's port configuration is configured for " 2 " because, the Trailer equals 2 bytes where Carriage Return ( d ) is onsidered as one byte and, Line Feed ( a ) is considered as one byte The Trailer Data 0 parameter for Port 1 of the 2760-RB Module is configured in this case for the letter "d "because, the letter "d "in this case represents a "Carriage Return " in Hexadecimal The Trailer Data 1 parameter for Port 1 of the 2760-RB Module is configured for the letter " a" because, the letter "a" in this case represents " Line Feed" in Hexadecimal The Min Data Byte Length parameter for Port 1 of the 2760-RB Module is configured for "zero" because, the Min Data Byte Length parameter is not considred when a Trailer parameter is configured

The Max Data Byte Length parameter for Port 1 of the 2760-RB Module is configured for "zero" because, the Max Data Byte Length parameter is not considered when a Trailer parameter is configured The Default Destination parameter for Port 1 of the 2760-RB Module is configured for "5 "because, the data from Port 1 of the 2760-RB Module is being read through the backplane of the Local Chassis to the PLC5 Controller The Default Source parameter for Port 1 of the 2760-RB Module is configured for '1 " because, the Barcode Scanner is connected to Port 1 of the 2760-RB Module . The Default Address in this case is not configured _______________________________________________________________________

PLC5 Controller A PLC5 Controller's Block Transfer Read ( BTR ) instruction is used to read data from Port 1 of the 2760-RB Module.

The Module Type parameter of the PLC5 Controller's Block Transfer Read instruction is configured for "Generic Block Transfer"

The Rack parameter of the PLC5 Controller's Block Transfer Read instruction in this case is configured for " 00" because, the Rack number of the chassis where the 2760-RB Module is seated in is Rack 0 The Group parameter of the PLC5 Controller's Block Transfer Read instruction in this case is configured for "1" because, the left side of the 2760-RB Module is seated in slot 1 of the chassis The Module parameter of the PLC5 Controller's Block Transfer Read instruction in this case is configured for "0." The Control Block parameter of the PLC5 Controller's Block Transfer Read instruction in this case is BT99:0/EN The Data File parameter of the PLC5 Controller's Block Transfer Read instruction in this case is N7:30. Data File N7:30 is where the data is stored when read from Port 1 of the 2760-RB Module . The Length parameter of the PLC5 Controller's Block Transfer Read instruction is configured for " 0." The Continuous parameter of the PLC5 Controller's Block Transfer Read instruction is configured for "No "

Input Input instruction __________________________

I: Rack Group / Bit I: 00 1 / 13 I of the PLC5 Controller's Input instruction represents the Input instruction 00 of the PLC5 Controller's Input instruction represents the "Rack Number "where the 2760-RB Module is seated in the chassis 1 of the PLC5 Controller's Input instruction represents the "Slot " where the left side of the 2760-RB Module is seated in the chassis 13 of the PLC5 Controller's Input instruction is the Bit ( Bit 13 ) which is triggered in the PLC5's Input Table. When Bit 13 is triggered the PLC5 Block Transfer Read instruction reads the data from Port 1 of the 2760RB Module into Data File N7:30. To view the data in Data File N7:30 set the Radix to "ASCII"

If the data appears " backwards" in the PLC5 Controller's Block Transfer Read Data File 1. ENBLE " Byte Swapping " in the port configuration 2. Swap d and, a in the port configuration 3. Save information