+ All Categories
Home > Documents > R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Date post: 27-Dec-2015
Category:
Upload: claudiu-gogoseanu
View: 145 times
Download: 6 times
Share this document with a friend
Description:
barcode scanner and plc
Popular Tags:
41
Configuring the CMF500 EtherNet/IP Communications Interface Page 1 6/8/2022
Transcript
Page 1: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Configuring the CMF500 EtherNet/IP Communications Interface

Page 1 4/19/2023

Page 2: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Table of Contents

TABLE OF CONTENTS ......................................................................................................... 2

PREFACE: ............................................................................................................................. 4

EQUIPMENT USED: .............................................................................................................. 4

SOFTWARE REQUIRED: ...................................................................................................... 4

1.CONFIGURE THE CMF500 ETHERNET/IP FIELDBUS GATEWAY ................................. 4

2.CLV SETUP/ SICK BARCODE SCANNER SETUP ......................................................... 13

3. ........... CREATING A “BAREBONES” PLC PROGRAM TO RECEIVE DATA FROM THE CLV430 BARCODE SCANNER. .......................................................................................... 17

4. CREATING A BAREBONES PLC PROGRAM TO SEND AND RECEIVE DATA TO AND FROM A CLV430 BARCODE SCANNER. .......................................................................... 21

APPENDIX A – LISTING OF PLC ROUTINES .................................................................... 27

Page 2 4/19/2023

Page 3: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

TABLE OF FIGURES

Figure 1 - Network Interface Card properties (programming PC).................................5Figure 2 - Configuring the PC’s Network Interface Card IP address.............................6Figure 3 - Ping the CMF500 gateway to confirm proper connection............................6Figure 4 – Homepage of the CMF500 as seen using Internet Explorer......................7Figure 5 – Software revision level /Reboot button..............................................................8Figure 6 - Factory Settings Checkbox and Reboot confirmation...................................8Figure 7 - Gateway resetting (takes about 30 seconds before it returns to the

homepage).................................................................................................................................9Figure 8 - Serial Device Configuration page link..................................................................9Figure 9 - Port 1 configuration link..........................................................................................10Figure 10 - Serial Port settings screen of the CMF500 gateway must match Host

Port settings of the CLV4xx barcode scanner.............................................................10Figure 11 – CMF500 Serial Port Settings...............................................................................11Figure 12 – Serial Packet ID Settings......................................................................................11Figure 13 – PLC Specific Settings.............................................................................................12Figure 14 – EtherNet/IP Settings...............................................................................................12Figure 15 – CLV430 Default Host Interf. Screen Serial Comm. Settings..................14Figure 16 – To connect to the CLV barcode scanner through the CMF500 via

TCP/IP for configuring the scanner using CLV setup, change two settings in the “Application TCP Connection Configuration” section.......................................14

Figure 17 – Connected to scanner over EtherNet TCP/IP................................................15Figure 18 – Trigger Parameters Screen.................................................................................16Figure 19 - CLV Setup Terminal Screen <F7> Trigger On, <F8> Trigger Off.........16Figure 20 – Good barcode data. Read triggered by serial command.........................17Figure 21 – Drill into the Controller Tag Database and copy all tags into your new

project.........................................................................................................................................18Figure 22 - Com1_RxData is the tag where the raw barcode data coming from

the CMF500 will be written into the PLC.......................................................................18Figure 23 - Received data tag Com1_RxData expanded to view the contents of

the individual elements.......................................................................................................19Figure 24 – Two rungs of logic used to manually clear the received data registers

in the PLC..................................................................................................................................19Figure 25 - This screen shot shows the result of triggering the scanner but not

reading a barcode, the error message “NO READ” is displayed starting at element (4)...............................................................................................................................20

Figure 26 - A good 20 character barcode read. Note that the incoming data always starts at element (4) of the tag.........................................................................21

Figure 27 – Copy the User Defined Data Type and the Controller Tags...................22Figure 28 – Cut-and-paste the rungs of logic......................................................................22Figure 29 – Check configuration of MSG instruction.........................................................23Figure 30 - Command transmit tag TxDataStruct_1.........................................................24

Page 3 4/19/2023

Page 4: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 31 – Browse to the EtherNet module and/or manually enter the communications path...........................................................................................................24

Figure 32 – Scanner command strings are configured and stored in STRING tags.......................................................................................................................................................25

Figure 33 - The STRING value for the End_of_Reading_Gate command string......25

Page 4 4/19/2023

Page 5: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Preface:This instruction is meant to aid those who are trying to configure EtherNet/IP communications between a SICK CLV4xx barcode scanner and an Allen Bradley/Rockwell Automation Logix Family of Programmable Automation Controllers.

Equipment Used: PC running Windows XP and functioning EtherNet Network Interface Card

(NIC) HTML browser (e.g. Internet Explorer) 4-port EtherNet Hub CMF500-1000 EtherNet/IP gateway

P/N 1041179 ; installed in CDM420 connection box with power supply connectedor P/N 7122797 ; standalone EtherNet/IP communications module with power supply connected

CDM420 Connection Box for barcode scanner connectivity CLV430 barcode scanner connected to CDM420 using high density 15-pin

connector Allen Bradley Control Logix PLC with 1756-ENBT communications module or Allen Bradley Compact Logix PLC with embedded EtherNet/IP communications

port

Software Required: CLV Setup v4.3 or later Web browser RSLogix 5000 v16 EtherNetIP_RxData.ACD EtherNetIP_TxRxData.ACD

Physically connect the PC, CMF500, and PLC to the EtherNet Hub with standard EtherNet cabling using RJ45 connectors. Apply power to all three. NOTE: configure the PLC EtherNet /IP port with an IP address of 192.168.250.1 (this will be used later).

1. Configure the CMF500 EtherNet/IP Fieldbus Gateway1.1. Configure the IP address of the gateway and the PC

1.1.1.The factory default IP address of the CMF500 is:192.168.250.250. 1.1.2.Check the programming PC’s network interface card IP address and

subnet mask (Figure 1). Change the IP address of the NIC to “fixed

Page 5 4/19/2023

Page 6: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

address” and enter 192.168.250.10 for the address of the PC. Change the subnet mask to 255.255.255.0. This will put the PC on the same local network as the CMF500 (see Figure 2). Leave the default gateway setting blank. Click OK.

1.1.3.Once the NIC IP address settings are saved, open up a terminal window and ping the CMF500 gateway to test for proper connection (see Figure 3).

Page 6 4/19/2023

Page 7: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

1.1.4.To summarize: at this time the IP addressing should be as follows:

CMF500 – 192.168.250.20

PC - 192.168.250.10

PLC - 192.168.250.1 (need to configure per Allen Bradley)

Subnet mask (for all) 255.255.255.0

Figure 1 - Network Interface Card properties (programming PC).

Page 7 4/19/2023

Page 8: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 2 - Configuring the PC’s Network Interface Card IP address.

Figure 3 - Ping the CMF500 gateway to confirm proper connection.

Page 8 4/19/2023

Page 9: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

1.1.1. If the ping fails, double check cabling, connections, and all the addressing completed in steps 1.2 - 1.3. Once a connection to the gateway is made (successful Ping), open a browser such as Internet Explorer and type in the default IP address (e.g.:192.168.250.250) of the gateway to get to the homepage of the device (see Figure 4).

Figure 4 – Homepage of the CMF500 as seen using Internet Explorer.

1.1.2.Back at the homepage of the gateway check to be sure that the Software is “EtherNet/IP 3.01” or later (Figure 5).

1.1.3.Click on the “Reboot” button (see Figure 5).1.1.4.Check the box to “Set configuration for all ports to factory default

settings” (Figure 6).1.1.5.Click on “Yes: Reboot” button (Figure 6). It takes about 30 seconds

to complete the reboot process. When complete, the homepage should reappear.

Page 9 4/19/2023

Page 10: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 5 – Software revision level /Reboot button.

Figure 6 - Factory Settings Checkbox and Reboot confirmation.

Page 10 4/19/2023

Page 11: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 7 - Gateway resetting (takes about 30 seconds before it returns to the homepage).

1.2. Configure the Serial Device Settings1.2.1.Next, back at the home screen, click on the “Serial Device

Configuration” link (Figure 8).

Figure 8 - Serial Device Configuration page link.

Page 11 4/19/2023

Page 12: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

1.2.2.Once the Serial Device Configuration page comes up, click on the “Port 1” link to change the settings of the serial port (Figure 9). The “Edit Serial Port 1 Configuration” screen should come up.

Figure 9 - Port 1 configuration link.

1.2.3.Once the “Edit Serial Port 1 Configuration” screen comes up, check to make sure that the “Serial Configuration” settings displayed match those that exist in the scanner by comparing them to the CLV Setup “Host Interf” screen shown in Figure 15

Page 12 4/19/2023

Page 13: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 10 - Serial Port settings screen of the CMF500 gateway must match Host Port settings of the CLV4xx barcode scanner.

1.2.4.Change the settings to match those shown below for the Serial Device Configuration (Figure 11). These settings should match the CLV4xx scanner host port serial communications settings.

Serial Device ConfigurationServer Configuration HomeEtherNet Device ConfigurationCommunication StatisticsPLC Interface Diagnostics

Port 1Serial Port SettingsMode: RS-232Baud: 57600Parity: noneData Bits: 8Stop Bits: 1Flow: noneDTR: offRx Timeout Between Packets: 200

Figure 11 – CMF500 Serial Port Settings

1.2.5.Next, change the Serial Packet settings to match Figure 12.

Serial Packet ID SettingsSTX Rx Detect: one byte

Page 13 4/19/2023

Page 14: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

STX Rx: 2ETX Rx Detect: one byteETX Rx: 3Discard Rx Pkts With Errors: yes

Figure 12 – Serial Packet ID Settings

1.2.6.Change the PLC specific settings to match those shown in Figure 13. No changes to the “Application Specific Settings” section are necessary unless it is desired to communicate via EtherNet TCP/IP to the scanner using CLV setup software.

PLC Specific SettingsSTX Tx Append: one byteSTX Tx: 2ETX Tx Append: one byteETX Tx: 3Strip Rx STX/ETX Chars: yes

Figure 13 – PLC Specific Settings

1.2.7.Change the EtherNet/IP Settings to match those shown in Figure 14. No further changes to the factory default settings are necessary.

EtherNet/IP SettingsRx (To PLC) Transfer Method: Write to Tag/FilePLC IP Address: 192.168.250.10PLC Controller Slot Number: X (i.e. 0) NOTE: Must agree with the actual physical setup of your system.Maximum PLC Update Rate (msec): 40Rx Produced Data Tag/File Name: Com1_RxData

Figure 14 – EtherNet/IP Settings

1.2.8.The PLC IP Address in the “EtherNet/IP Settings” section (Figure 14) should match the IP address of the 1756-ENBT EtherNet IP bridge residing in the Allen Bradley ControlLogix backplane or the EtherNet port of the CompactLogix processor.

1.2.9.The “PLC Controller Slot Number” is the slot number that the ControlLogix or CompactLogix processor occupies.

1.2.10. The “Rx (To PLC) Produced Data Tag/File Name:” is a tag created in the PLC controller tag database for receiving the data coming from the gateway/scanner(s). In this test case, the name “Com1_RxData” was used for the SINT array tag.

Page 14 4/19/2023

Page 15: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

1.2.11. Once all the settings match those shown above, click on the “Submit” button at the bottom of the “Edit Serial Port 1 Configuration “ page and then “Reboot.”

After clicking on the “Reboot” button at the bottom of the page, you are finished with the CMF500 settings (NOTE: be sure to Uncheck the “Set configuration for all ports to factory default settings” box before rebooting!). The gateway will reboot. Wait for the homepage to reappear.When the homepage of the gateway comes back up (if it doesn’t come back up after about 20 seconds, then just enter the IP address of the device back into the address field of the browser to get back to the homepage), double check the settings by going to the “Serial Device Configuration” page and scrolling down. This is just to make sure that the intended settings were all saved to the gateway properly. No other settings need to be changed unless it is desired to connect to the scanner via an EtherNet TCP/IP connection (for configuration and programming of the barcode scanner with a PC using the CLV setup software configured for TCP/IP communications).

2. CLV Setup/ SICK barcode scanner setupIn this instruction a CLV430 is configured for communicating over the CMF500 EtherNet/IP communications gateway configured in Part 1.

2.1. Connect the 15 pin connector on the end of the scanner cable to the 15 pin scanner port on the CDM420.

2.2. To configure the scanner through a serial communications connection, connect to the CLV430 scanner from the serial port of the PC through the 9-pin D-sub Aux port provided on the CDM420 with the serial programming cable (p/n 7021851 straight-thru serial cable). NOTE: must be connected to the 9-pin external Aux. port on the side of the CDM420 or through a null modem connection directly to the 9-pin Aux. port inside the CDM420 on the main circuit board.

2.3. Connect a 9-pin straight-thru serial cable (p/n 7021851) between the Host port of the CDM420 and the 9-pin serial port on the CMF500.

2.4. Power up the scanner by turning on the switch S1 in the CDM420.

2.5. Start up the CLV Setup software. Establish a serial connection and upload the scanner parameters.

Page 15 4/19/2023

Page 16: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

2.6. In CLV Setup go to the “Host Interf.” Screen and check the settings. They should match those of the “Port 1 Serial Port Settings” of the CMF500 (Section 1.2.4).

Figure 15 – CLV430 Default Host Interf. Screen Serial Comm. Settings

2.7. If you would prefer to connect to the scanner using TCP/IP over your EtherNet network, instead of using a serial connection, go back to the homepage of the CMF500. Click on the “Serial Device Configuration” link again. When the “Serial Device Configuration” screen comes up, click on the “Port 1” link. Scroll down to the section entitled “Application TCP Connection Configuration” settings. Check the box to enable and check the box to Listen (NOTE: Listen port = 8200). Submit the new settings.

Page 16 4/19/2023

Page 17: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 16 – To connect to the CLV barcode scanner through the CMF500 via TCP/IP for configuring the scanner using CLV setup, change two settings in the “Application TCP Connection Configuration” section.

2.8. In the CLV setup software, go to the “Options” selection on the menu bar. Select “Interface”. Click on the radial button next to “TCP/IP”. Type in the IP address of the CMF500 and port 8200. Click on OK and the software should connect via TCP/IP. You may now upload and download to the scanner just as if you had established a serial connection instead.

Figure 17 – Connected to scanner over EtherNet TCP/IP

Page 17 4/19/2023

Page 18: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

2.9. For new scanners coming out of the box no changes need to be made to the factory default settings. NOTE: the default setting for triggering the scanner assumes that a photoeye with a pnp output is connected to pins 37,38,39 of the CDM420. If no photoeye is connected, then go to the “Reading Trigger Parameters” screen and select “Serial Interface” to control the triggering via software. If, on the other hand, the plan is to utilize a photoeye for triggering, now might be a convenient time to wire it in.

Figure 18 – Trigger Parameters Screen

2.10. To trigger the scanner from within CLV Setup (software control/no photoeye): open up a terminal screen from inside CLV Setup. Once the screen is up, the scanner laser should turn on when the <F7> button is pushed. Turning the laser off by pushing <F8> ends the reading gate and the data read by the scanner is sent out the host port of the scanner (configured earlier).

2.11. You are finished configuring the scanner for testing the EtherNet/IP communications.

Page 18 4/19/2023

Page 19: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 19 - CLV Setup Terminal Screen <F7> Trigger On, <F8> Trigger Off

2.12. Check that the scanner is functioning properly by triggering the scanner (either by serial command or by photoeye) with the CLV setup terminal screen interface. When the scanner is triggered, the laser should turn on. Once the triggering is stopped, data is sent and that data should appear on the terminal screen. Next we will attempt to receive data into the PLC tag database.

Figure 20 – Good barcode data. Read triggered by serial command

Page 19 4/19/2023

Page 20: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

3. Creating a “barebones” PLC program to receive data from the CLV430 barcode scanner.

For this section, you will need the RSLogix 5000 project file - EtherNetIP_RxData.ACD. This file should be downloaded from the SICKusa.com Web site.

3.1. Close all software that is running except for RSLogix 5000.

3.2. Create a new RSLogix 5000 project for the specific processor and backplane that you are using (from the Compact Logix or Control Logix family of controllers).

3.3. Configure the PLC’s EtherNet /IP module (e.g. 1756-ENBT) with the IP address assigned in step1.2.7.

3.4. Configure the PLC hardware to correspond to your physical setup in the I/O configuration of the new RSLogix 5000 project. Double check for agreement with settings specified in step 1.2.7.

3.5. While keeping the new RSLogix project you created open (don’t forget to save your work), launch another instance of RSLogix 5000 and open the file EtherNetIP_RxData.ACD that you downloaded from the SICK Web site.

3.6. Drill into the Controller Tag Database (Edit Tab). Cut and paste all of these tags (Figure 21) into the Tag Database of the new project that you created.

Page 20 4/19/2023

Page 21: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 21 – Drill into the Controller Tag Database and copy all tags into your new project

Figure 22 - Com1_RxData is the tag where the raw barcode data coming from the CMF500 will be written into the PLC

Page 21 4/19/2023

Page 22: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 23 - Received data tag Com1_RxData expanded to view the contents of the individual elements.

3.7. Open the Main Routine of the EtherNetIP_RxData.ACD project and cut and paste the two rungs of logic into the routine. These rungs are only used to manually clear the received data registers.

Figure 24 – Two rungs of logic used to manually clear the received data registers in the PLC

Page 22 4/19/2023

Page 23: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

3.8. There is actually no programming of the PLC required to transfer incoming data into the tag. As mentioned earlier, the logic added to the Main Routine was just to allow manual clearing of the received data registers. This makes it easier to confirm that fresh data has arrived for testing purposes. So, let’s move on and check to make sure that everything is working properly. Download this “skeleton” project into the PLC.

3.9. Once the project is downloaded to the controller put the controller into Run mode and be sure that the barcode scanner, CMF500, PLC, and PC are all powered up and communicating on the network. Ping each of the devices (CMF500 and the PLC) from the PC through the EtherNet hub to be sure your network is configured, wired, and communicating.

3.10. Next, trigger the scanner and check and see if data populated the tag elements beginning at element (4). Bytes 0 and 1 give the “Produced data sequence number.” This is basically a counter that can be used to confirm that new data has arrived. Bytes 2 and 3 specify the data length in bytes. See Figure 25 and 26.

Figure 25 - This screen shot shows the result of triggering the scanner but not reading a barcode, the error message “NO READ” is displayed starting at element (4).

Page 23 4/19/2023

Page 24: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 26 - A good 20 character barcode read. Note that the incoming data always starts at element (4) of the tag.

4. Creating a barebones PLC program to SEND and RECEIVE data to and from a CLV430 barcode scanner.

Sometimes it is desirable to configure/control the scanner from the PLC. In order to do this, you must send control and configuration command strings to the scanner using a MSG instruction in the PLC. This could be useful, for example, to configure the scanner to look for a specific barcode or matchcode. For demonstration purposes we will develop a small PLC program that will send two commands to the scanner Turn ON (code = “22” ASCII) and Turn OFF (code = “23” ASCII). The process of sending command strings (strings of structured alpha-numeric characters) to the scanner is similar for all command strings. The same MSG instruction is used, but the content of the command string changes as necessary to execute different functions. A listing of the CLV command strings and their data structure is available on the Web.

4.1. Create another new RSLogix project, for your hardware platform. Give it a name. For the purposes of this document we will use the name “EtherNetIP_TxRxDataCopy.” Keep this project open. You will cut-and-paste into this project from the file EtherNetIP_TxRxData.ACD.

4.2. Open up the RSLogix file EtherNetIP_TxRxData.ACD downloaded from the SICKUSA Web site. Drill into the project tree and copy the User Defined Data Structure – TxDataStruct . Paste this User Defined Data Type

Page 24 4/19/2023

Page 25: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

into the User Defined Data Type section of the project tree for the newly created project.

4.3. Go back to the project EtherNetIP_TxRxData.ACD. Drill into the Controller Tags database. Click on the Edit Tags tab and select all the tags. Copy-and-paste all these tags into the new project that you created - EtherNetIP_TxRxDataCopy.

Figure 27 – Copy the User Defined Data Type and the Controller Tags

4.4. Open up the Main Routine in EtherNetIP_TxRxData.ACD. Select all the rungs of logic and cut-and-paste them all into the new project EtherNetIP_TxRxDataCopy.ACD.

Page 25 4/19/2023

Page 26: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 28 – Cut-and-paste the rungs of logic.

4.5. Once the logic has been pasted into the new project you will need to drill into the MSG instruction on rung 7. Click on the ellipses and double check that the settings agree with those of Figure 29.

Figure 29 – Check configuration of MSG instruction

Page 26 4/19/2023

Page 27: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

4.5.1. The Source Length value is adjustable depending upon the number of bytes that need to be transmitted for a particular command string.

4.5.2.The tag named “TxDataStruct_1” is the memory space that will contain the command that should be sent to the barcode scanner. Even though there might be several different commands that will be sent to the scanner (at different times), the TxDataStruct_1 must contain the command that should be transmitted during the next scheduled corresponding transmission event.

Figure 30 - Command transmit tag TxDataStruct_1

4.6. Click on the Communication tab and fill in the communications path field by browsing to the EtherNet module (shown as sickENBT in Figure 31).

Page 27 4/19/2023

Page 28: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 31 – Browse to the EtherNet module and/or manually enter the communications path.

4.7. Enter the remaining characters to complete the communications path. The ”,2,” is needed after the local EtherNet module name (sickENBT). Follow the “,2,” with the IP address of the CMF500 module as shown below in Figure 30. In the end, the path should be comprised as “localEtherNetIPmodule,2, IP address of CMF500.”

4.8. For each command that is to be sent to the scanner a STRING tag needs to be created and the command string string needs to be typed in for storage until ready to transmit. Four of these tags have already been created: (i) Reading_Mode, (ii)Start_of_reading_gate, (iii) End_of_reading_gate, (iv) Parameterize_Mode

Page 28 4/19/2023

Page 29: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Figure 32 – Scanner command strings are configured and stored in STRING tags

4.9. For each one of these tags the corresponding serial command string, consisting of two numeric ASCII characters, has already been typed in:

Reading_Mode = 11 Parameterize_Mode = 13 Start_of_reading_gate = 21End_of_reading_gate = 22

Figure 33 - The ASCII value for the End_of_Reading_Gate command string

4.10. The controller tag named txMSG (of type MESSAGE) was created for the message instruction block in rung 7 (it should have been copied over with the cut-and-paste done earlier).

Page 29 4/19/2023

Page 30: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

4.11. Click OK and then Save and Download the project into the controller.Put the controller into Run mode.

4.12. Go to rung 0 of the PLC program and toggle the LaserON tag on and then off. This should turn on the laser.

4.13. Go to rung 1 of the PLC program and toggle the LaserOFF tag on and then off. This should turn the laser off and cause it to send data (trigger configured for end of reading gate in CLV setup). Check for new received data in the Com1_RxData tag.

4.14. Go to rung 2 and toggle the bit “clearTxDataStruct.” This will clear the contents of both TxDataStruct_1 and Com1_RxData. Repeat steps 4.12 and 4.13.

4.15. Now that you are familiar with the fundamental building blocks of the communications interface, you should be able to utilize them in the way that you want for your particular application.

Page 30 4/19/2023

Page 31: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

APPENDIX A – LISTING OF PLC ROUTINES

Page 31 4/19/2023

Page 32: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Page 32 4/19/2023

Page 33: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Page 33 4/19/2023

Page 34: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Page 34 4/19/2023

Page 35: R5 Instruction for Interfacing CLV430 Barcode Scanner With Allen Bradley Control Logix

Page 35 4/19/2023


Recommended