Home store site map
Bookmark and Share
Video - Connect Bar Code Scanner

Video Transcript

Getting a bar code scanner up and running on some PLC's can be a real hassle. With the Productivity3000 using a Bar Code Scanner is a snap. Let's do it:

Step 1: Plug the scanner into the serial port on the front of the CPU.

Step 2: Hardware configuration: We want to do an ASCII IN – this one right here – but when I go to find the serial port it says there is no ASCII serial port configured. Well, the reason for that is we haven't set it up yet. So let's cancel out of this.

To do that we bring up the hardware configuration. This dialog. We want to read the configuration of the current controller. If this button is not active, check and make sure your controller is in STOP mode – it has to be in STOP mode to read the configuration.

So I'm going to click on the button, and we'll wait a few seconds while the controller does a full auto-discover of the entire system. This dialog is telling me there is a mismatch between my new project and the base. Of course, I know that. And we now have a fully auto-discovered set of hardware.

To view it, I can just click on the local base group. This is the PLC I currently have plugged in. For now, we just want to double click on our processor, which brings up this dialog box. We go over to our serial ports and set them up.

Let's give this one a name – we know we are going to plug our scanner into it – so we'll call it "scanner." The protocol defaults to Modbus RTU. We want to read ASCII so let's change that to an ASCII protocol – make sure you don't miss that one.

This particular scanner operates at 9600 baud. Odd parity, 8 data bits, one stop bit – that's correct. Our serial port is setup. OK out of the port window and close the hardware configuration window.

Now we can go grab the ASCII IN instruction and just fill in the blanks. The Productivity 3000 has already filled in the serial port for us because there are no other serial ports. We want a fixed length message. For this example we want 10 characters – you'll see why in a minute.

And I just need a place to put the answer. So let's call that "ScannerString." And that's it – that's all we need to do to interface to the scanner.

If we hit OK, we see that the software is smart. It sees that we haven't actually created that memory location for the barcode string yet, so it asks us if we want to do that and even suggests what type it should be – a string in this case. This looks pretty good to me, with one exception … I know I want my string to be 10 characters long. You'll see why in just a minute.

So I say OK and in one fell swoop we setup our scanner and we have allocated the memory for the string to go into – a 10 character string.

While we are here, let's do one more thing. Let's send that Scanner String result to the LCD on the processor. That's easy. We just come down here, grab the LCD instruction, and drop it on the next rung and fill in the blanks. On the first line of the LCD, let's just put some TEXT. You can put anything you want, just enclose it in double quotes. Let's say "Bar Code:" Then on the third line – let's skip a line – and on the third line let's tell it to put the contents of the scanner string. If I just start typing the software brings up all the TAGs in the database, so I grab the one I want, and say OK. And that's it.

Step 1 was read the Hardware Configuration and setup the serial port for ASCII.

Step 2 was setup the ASCII IN command to handle the scanner. And...

Step 3 was send the result to the LCD page.

It just doesn't get any easier than that.

Let's turn on our monitor and go ahead and scan a bar code. And as you can see, the message appeared both here in Scanner String and over here on the LCD display of the CPU.

Let me do another one, and we got a new bar code.

So in a matter of seconds we were able to setup a full barcode scanner system with the Productivity 3000.

What if I wanted to connect the Bar Code Scanner to a Remote Rack? Easy. I just connected a remote slave through a Stride Ethernet switch to this base. Well, we just do the exact same thing we did before. Step 1, read the configuration – remember, you have to be in STOP mode for this button to light up, there it is. Read the configuration – it goes out and reads the entire system in one fell swoop, auto discovers all the hardware. It found a new remote base and asks me if I want to add it to the project. I do.

Here are our two bases. Here is our local base and our remote base. I double click on the remote base and I see how it is populated. Double click on his processor, and setup the serial port. Its name is currently RS232. We can do better than that, let's call him "Remote Scanner." We want to make sure his protocol is ASCII. Set him up for the right baud rate: Odd, 8 and one.

So now our remote slave serial port is setup and ready to go. That was step 1.

Step 2 – we go back to our ASCII IN and we said we want the ASCII IN to come from our Remote Scanner, not our local scanner. And while we are at it, let's go ahead and send the scanner result – which is going to appear in Scanner String – to the remote slave LCD.

Well, to do that we just pick the LCD we want. Do we want the CPU LCD or do we want the remote Slave LCD? Everything else is the same, and away we go.

Let's transfer this project to the controller.

I'm going to reach down and flip the switch on the processor back to RUN mode – we can see the status right here change to RUN. And we are ready to go.

I'm going to reach over and scan a bar code. And sure enough that bar code appears here and on the LCD display.

Let's try another one. And how about one more.

Well, that's all there is to using a Bar Code scanner with the Automation Direct Productivity 3000. Both on the local base and a remote base. Be sure to check out the other videos in this series for more ways to get up and running quickly with this controller. And as always, please send us any comments you may have, we appreciate the feedback.

Performance plus Value … That's Productivity.

From AutomationDirect.