Sign in to follow this  
Followers 0
Weld_Man

Barcode Scanners

7 posts in this topic

Hello everybody, I have an application that will require the use of a barcode scanner. I have no experience with them yet, and have been doing as much research as I can. I would like to know if I am getting a good handle on things so far. -Communicate via RS232 with an Omron scu21 Comm unit. Using Omron CJ1M plc -Powered by the RS232 port? (5 VDC) Is this possible? -Able to read code 39, 128 barcodes (no problem) -Fixed mount scanner (when does it know to scan?) I would be scanning the barcode, setting up parameters for the specific code and saving it in a database I will be creating in the PLC. Would also be able to call up the specific parameters when a code is scanned also. Sounds easy huh? I will be using receive and transmit instructions to read the barcode. And be using the string/move instructions to create my database. Am I heading in the right direction at all? Any tips or problems I might encounter? I’ve been looking at Symbol and Datalogic scanners so far. For my application this is more general use bar scanning, no high-speed applications. I can’t find much help out on the web if you guys have any good links let me know. Thanks!

Share this post


Link to post
Share on other sites
Well from past experince with bar code scanners and readers, they will allow an external trigger to let them read the right code, or they can be configured to accept any code that it "sees" as long as that code is legible. I've used scanners to configure machines by product, and prefered to have it do the scan when the product is presented.

Share this post


Link to post
Share on other sites
Possible, but I would run a seperate 5vdc supply. I am pretty sure that Omron do a bar code scanner as well. Also, once you get one, connect it to your computer, run hyper terminal, scan something, and see that you can get the comms going that way... Bar code data has a header of STX and terminator of ETX generally. STX and ETX are ASCII codes so in hyperterminal they might be a smiley face or something. I have attached a sample of the bar code reader protocol. I just looked into the standard system protocols included with CX-protocol and a bar code reader V500 protocol is included... it also has a general read... Assuming that the SCU21 card comes pre installed with the system protocols then you could execute the general read with out having to do any thing else.. Check out the SCU21 manual for further details on the protocol and how to execute a protocol macro from the code.

Share this post


Link to post
Share on other sites
It sounds like you've got a good start in figuring things out. I work for a distribution company handling tech support for SICK, Inc. scanners, so my answers will be based on them. Function-wise, other brands should be similar. Unless a human is hand scanning the barcode, you want fixed mount. Typically, a trigger sensor is used to indicate the reading gate, but SICK scanners can also be triggered serially from the host. Or you could set them up to read all the time, and not use a trigger at all. That could be a problem if the line stops and the scan line is directly over a barcode! As far as programming and functionality goes, you shouldn't have any problem, as long as you get a decent scanner. What you should be more concerned with is reading distances, angles, label type and orientation, product speed, etc.. With that information, you will be able to pick the hardware that can read the barcode. Getting the data to the host is the easy part. I wish I had a good tutorial to send you to, but I did all my learning in manufacturer's training and actual applications. So I'll try to give you a good overview. I'm only going to go into standard 1D barcode. Barcode scanners all operate pretty much the same way. A single laser source and receiver, and a spinning mirror create the scan line. The mirror spins in one direction, so the laser point always moves across the barcode in the same direction. Typically, an eight-sided mirror is used so that you get 8 scans per revolution. The receiver returns an analog signal to the processor, with highs and lows indicating the bars and spaces of the code. The highs and lows occur because the darker bars absorb more light than the lighter spaces. Barcode is generally black and white, because this gives the best contrast ratio. Low contrast barcode (such as code printed directly on cardboard) is almost impossible to read, and takes a special model scanner. The processor translates the analog signal into digital highs and lows with specific widths (the barcode), which it can then decode. I go into this, because the mounting of the scanner makes a big difference to operation. As with photoelectric sensors, you never want the scanner mounted exactly perpendicular to the barcode. This is because in most cases you will get too much light back and dazzle the receiver. This is where it gets confusing, because there are three axes in which to tilt the scanner. One axis is very good, one axis is very bad, and one axis depends on code orientation. The best way to describe this it to imagine that you are point the scanner at a white wall so that the scan line is horizontal to the floor. If you rotate the scanner so that the horizontal line travels up or down the wall, that is skew. That is the good one. You want between 10 and 15 degrees of skew to get the best operation of the scanner. More will probably work. I've tested scanners with as much as 80 degrees of skew, and gotten good results. Back to the wall, if you rotate your body so that the horizontal line travels to the right or left, that is tilt. That is very bad. Because you're dealing with a single laser source and rotating mirror, the further you are from the center of the scan line, the longer the distance between the source and the code. So code elements close to the edges of the scan line look wider to the analog signal going to the processor. The processor knows this and takes that into account. But adding tilt means all bets are off. You want as close to zero tilt as possible. Final trip to the wall. If you twist the scanner so that the horizontal line rotates towards vertical, that is pitch. Whether you want that or not depends on code orientation, which I'll talk about below. The characteristics of the barcode itself is vital to the operation of the scanner. Obviously, there are different codes, but scanners these days can pretty much read all of them. More important is the size, quality, shape, and orientation. Code size is usually measured in mils (thousandths of an inch), and common sizes range from 10 to 40 mils. Barcode is made up of dark and light elements (yes, the spaces are part of the code!), with two, three, or even four different widths. The width of the smallest element (dark or light) is the code size! Code size is important because it drastically affects the reading distance of the scanner. The laser source in the scanner is focused for a particular distance. If a small code is too far away, the light spot is to large to catch the highs and lows properly. As code size goes up, reading distance increases. You also have to watch the other end too. If the code is too close to the scanner, the light spot can be too small, and you can catch printing artifacts as code elements. Use the distance charts in the specs for the scanner! Higher end scanners allow you to adjust the focal distance depending on application, and some even allow you to adjust on the fly using digital inputs or timing. By the way, make sure to take skew into account when calculating reading distance! Code quality is a factor of contrast ratio and the actual print medium of the barcode. Contrast ratio I've mentioned above, and has to do with the colors of the elements. Type of paper is important only as it affects the print quality, unless you're dealing with a highly reflective paper. In those cases skew is especially important. Print quality affects the crispness of the elements. When you measure the size of the smallest element for code size, measure the smallest dark and the smallest light. They are supposed to be exactly the same size, and the closer they are the better the quality. Thermal transfer is the best print job for code. Laser is decent. Inkjet tends to bleed. Dot matrix is usually low resolution, so there's a dot pattern instead of solid dark bars. The worst code I've ever seen was xeroxed, then faxed, then scanned and emailed to me! I don't even know what it looked like when it started! I couldn't read that one... Code shape mainly means the aspect ratio, calculated by code height over length. The larger the ratio, the easier it is to read the code. I look at why in the next section. I would also lump quiet zone in with shape. The quiet zone is the empty area to either side of the code. Except for very special cases (I've never seen one!), the quiet zone must be at least 10 times the width of the first/last element in the code. This is so the scanner knows where the barcode is, and doesn't erroneously include other things printed beside it when decoding. This is especially true when a label has more than one code! Code orientation means what orientation the code is in when moving through the scanner. There are three options: picket fence, ladder, and omnidirectional. Picket fence and ladder simply refers to what the code looks like. If the elements are vertical, the code looks like a picket fence, and if the elements are horizontal, the code looks like a ladder! Omnidirectional is code that could be in any rotation. This is anything that is hand-applied, or in a distribution system that handles many size packages, like airport luggage handling. Omnidirectional takes special scanners, and is unusual in most automation. Ladder orientation is the easiest orientation to deal with. Get a standard line scanner, give a 90 degree pitch, and you're rolling. Scanners get between 600 and 1200 scans per second, so the scanner will see quite a few slices of the code as it rolls past. This is good, because scanners usually need three good scans before they'll output data. That is adjustable, of course, but usually three is minimum. If there is an ink blob in the middle of the code, then the scanner will still be able to read around it and get three good reads. Also, the scanner can handle label placement variation easily. If the label's a little higher, it won't make much difference, because the scan line is longer than the barcode. Most scanners have a 50 degree angle of divergence (25 degrees to either side of center), so that the scan line length is roughly equal to the reading distance. Picket fence is more difficult, especially with a low aspect ratio code. With a standard line scanner and zero pitch, you could be all right, but if there's an ink blob on the code in the wrong spot, it won't work. Also, the label position can't vary much, or you won't see the barcode at all. A little bit of pitch could make a difference, because then the scanner will get a number of unique slices across the code. However, if the code has a low aspect ratio, there isn't much room for movement. The next option is a raster scanner. In a raster scanner, the eight sides of the rotating mirror are tilted at slightly different angles so that instead of one line, the scanner has eight parallel lines very close together. This gives more chance that the scanner hits a good spot on the code, and gives a little more position variation capability. Again a little pitch would help as well, but not too much! Most higher end scanners feature an internal processing feature that can help with this problem. On SICK scanners, it's called SMART, and I can't remember what that stands for! But what is does is to rebuild the code from separate scans, as long as each scan has at least 12 barcode elements (dark and light) in it. This is useful in ladder orientation, because even if the code has a permanent marker strike through it, as long as no elements are completely obliterated the scanner can rebuild the code. But it's even more useful in picket fence orientation, because it allows for more pitch. The scan line no longer has to see the entire code at one shot, just 12 elements at a time. And more pitch means more label position variation capability, though still not as much as a ladder oriented code. The best solution for picket fence is an oscillating mirror scanner. This is a scanner that has a special optical head attached with an oscillation mirror inside that sweeps the scan line up and down. It greatly increases label position variation capability, even with low aspect ratio codes. Line speed is a concern with these, because if the sweep speed is slower than the product, the scanner could miss the code altogether. Also, this is a hardware option, and is more expensive. But for applications where the code is picket fence and position is not tightly controlled, it's often the only option. That's all for now. Let me know if you need any clarifications.

Share this post


Link to post
Share on other sites
Very informative post there JR I'll have to remember this one...

Share this post


Link to post
Share on other sites
Wow, excellent post! Never deal with scanners but this post made me understand roughly how they work and what's important. Especially the skew, tilt and pitch explanation very good for a scanner noob like me.

Share this post


Link to post
Share on other sites
Yes, thanks for the information everybody! Nice work Jeremy! I will look into CX-Protocol then to communicate to the barcode scanner. I will now feel more comfortable setting up the scanner once I get one in my hands. I will let everyone know how this goes. Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0