Barcode Scanner Interfaces – Popularity Never Fails; Try USB Cables

USB-barcode-connectorEven though you can still buy a computer with both a serial port or a PS/2 port, USB ports are the most popular interface for connecting peripherals to a computer.  Over the last few years, barcode scanners with a USB interface cable have become top sellers. These devices physically connect to the computer’s USB port via a male A connector.  USB cables have become increasingly common over the past years.

The USB cable is the physical connection. Logically, the barcode scanner interfaces to the computer in one of the following two ways:

  1. As a keyboard or HID (human interface device)
  2. As a COM (or serial) device

These two logical interfaces are almost identical to barcode scanners physically connected using a keyboard wedge or serial cable.

Because most barcode scanners support interfaces other than USB, you must ensure that you first configure the scanner to use this connection. You must also decide between the various logical interfaces that a physical USB connection supports: USB keyboard, USB HID, USB COM port, etc.

Like a physical keyboard wedge interface, the operating system (OS) cannot distinguish between data that comes from the keyboard and data that comes from the barcode scanner.  Because of this, an application does not require specific functionality to support a barcode scanner connected via USB keyboard.  If the application allows input from the keyboard, it will accept input from such a barcode scanner.  In fact, the application cannot differentiate between data from the keyboard and the scanner.

Like a physical serial interface, the USB COM interface requires application support to retrieve the scanned data.  One of the benefits of this is the ability of an application to retrieve barcode data even if it is not the foreground application (also called having the focus).  If you will have multiple applications open at the same time and want the barcode data to go to just one application, a USB COM interface can accomplish this.  A USB COM interface differs from a physical serial interface in that you do not (usually) have to configure the parameters of the COM port on either the OS side or the barcode scanner side.

Most barcode scanners connected with a USB cable get their power from the computer’s USB port.  Some USB cables allow for an optional external power supply.  This can serve to either power the scanner or, for cordless barcode scanners, to charge the battery.  You should check the documentation for your device to determine if it requires an external power supply.

As I mentioned, a USB interface is the most widely available of the standard barcode interfaces.  I recommend using it in the following instances:

  1. Your hardware only supports a USB interface.
  2. You want to ensure you can connect your barcode scanner to future computers you may own.
  3. You want the option of switching the logical interface (keyboard or COM port) in the future without having to buy another cable.

By Charlie Waldman

This post is courtesy of L-Tron Corporation.

L-Tron Corporation is a value added reseller and trusted distributor of data acquisition and collection products.  Formed in 1975, L-Tron's product and service offerings have evolved to remain on the cutting edge of global business demands. L-Tron is currently a leading supplier of numerous business solutions and application software offerings.

Other articles on the fundamentals of barcoding can be found under the Learn - Barcoding 101 section:

Good Bar Code Guidelines 931
Bar Code Technical Resources 1086
Printing Barcode Labels? What You Need to Know 2158
Bar Code Quiet Zones Illustrated and Explained 2311
Bar Code Hardware - Bar Code Printers 2291
QR Codes - Everything you always wanted to know* 25118
Resource Page: Scanner Apps for Smartphones & Tablets 4550
How to Choose a Barcode Reader or Barcode Scanner 3060
How to Create a Bar Code in Microsoft Excel 3510
How to Create a Bar Code in Microsoft Word 3913
Choosing a Bar Code Label Printer 5971
RFID Resource Articles 3967
Selecting the Right Bar Code Font for Your Bar Code Label Needs 2692
QR Code Resources 5245
Creating Code 39 Bar Codes for Library Books 3350
Online Bar Code Generators: Find Out How to Make 'Em and Use 'Em 2882
Bar Code Resources 15220