Barcode Scanner Integration Guide
This guide provides documentation, examples, software, and source code for the integration of hand-held USB and keyboard wedge barcode scanners. Using these guidelines, handheld scanners may be easily integrated with existing or custom applications as automation, input, and verification devices.
Overview & Information About RS232 Scanners
- RS232 (serial port) barcode scanners have been commonly used as input devices for several decades. RS232 scanners work very well with their legacy applications, although their implementation is complex because it requires that the application monitor and access the RS-232 API. In addition, some new computer systems on the market today do not contain RS232 ports and the serial port is a slow communication device. USB and keyboard wedge barcode scanners overcome these limitations by emulating the keyboard so that anything scanned appears at the cursor as if it had been typed in from the keyboard. The guidelines presented here offer several implementation options.
Scanning Data Directly into the Field on the Form
- Scanning data directly into a field is the easiest of all implementations. The cursor is placed in the appropriate field that is to receive the data from the scan and the trigger is pressed on the scanner. After the trigger is pressed, the data appears at the cursor as if it had been typed from the keyboard. This method may also be automated to include functions such as tabs and returns - even in web browsers and custom applications.
Program the App to Monitor for Specific Characters
- With this implementation, the cursor may be anywhere on the form.
The application is programmed to respond to a specific character that is not frequently used. In this example, Visual Basic 6 is used to respond to the tilde "~" character. However, applications may be programmed to respond to any character that is not used for any other purpose in the application.
To implement this example in Visual Basic 6, KeyPreview must be set to True so the scanned data is evaluated:
Private Sub Form_Load()The code is then placed in the application that will respond to the specific character when scanned. ASCII 126 (the tilde key) is used to start the process in this example. The tilde key may also be entered from the keyboard to manually start the process.
Scanner_Activation_Form.KeyPreview = True
Private Sub Form_KeyPress(KeyAscii As Integer)After the data is scanned, the return function in the barcode chooses the "OK" button after the data is automatically entered into the text box. The character that triggers the process may either be encoded in a barcode (as in the examples below) or added as a preamble character in the scanner.
If KeyAscii = 126 Then
KeyAscii = 0
ScannedData.Text = InputBox("Enter Data:")
Testing the Trigger Process
- The trigger process may easily be tested with a barcode scanner and
sample application. If the
sample application example fails to execute, the
runtime files may need to be installed. Scan the barcodes below
with the application open for an implementation example. The bar-codes
below encode a tilde at the beginning. Most modern scanners, such as
IDAutomation SC5 USB Barcode Scanner, automatically send a return
function by default after the data is scanned. Therefore, a return function
at the end of the barcode may not need to be encoded. The barcodes below
may be reproduced with any of IDAutomation's
barcode font tools
and barcode components including
online barcode image generator.
- Code 128 barcode: Created by encoding
~TESTDATA into code 128. With Code 128 auto selected and ApplyTilde
enabled, a return function may be added to the end of the barcode by
(This image was created with IDAutomation's free on-line barcode image generator)
Code 39 barcode: Created by encoding %STESTDATA into Code 39. When using the Code 39 Barcode Font, *%STESTDATA* may be used. A return function may be added to the end of the barcode by encoding %STESTDATA$M.
(Note: Extended code 39 must be enabled in the scanner for the tilde and return functions to work)
(This image was created with IDAutomation's free on-line barcode image generator)
Program a Preamble Specific Character in the Scanner
- Most modern scanners, such as the IDAutomation SC5 USB Barcode Scanner, have the ability to encode preamble characters. IDAutomation recommends using the GS character, which is ASCII 29 for this operation. Normally, these characters are not visible unless an application is used such as IDAutomation's Barcode Scanner ASCII String Decoder.
- Program the application to respond to this character
as mentioned above, for example:
Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 29 Then KeyAscii = 0 ScannedData.Text = InputBox("Enter Data:") End If End Sub
Program Scanner to Emulate Pressing a Function Key
- Very few Keyboard Wedge or USB Scanners can simulate pressing a function key from the keyboard. However, if this operation is needed, the IDAutomation SC5 USB Barcode Scanner can emulate all function keys as well as other keys such PgUp, PgDn, Backspace, Tab, Enter, Esc, Insert, Delete, Home and End. To activate this ability, simply enable "Function Key Emulation Mode" by scanning the appropriate barcode in the manual. Using this method, lower ASCII codes in a Code 128 barcode will simulate pressing a key on the keyboard. For example, an ASCII 23 (0x17 in the manual) digit encoded in a bar-code will send the same codes to a computer as if the F7 function key was pressed. Because the scanner manual only lists hexadecimal numbers, it may be necessary to refer to the ASCII chart for conversions.
Barcode Scanner ASCII String Decoder
- IDAutomation's Free Barcode Scanner ASCII String Decoder is a software
application that decodes and reveals hidden, non-printable ASCII characters
and commands from keyboard emulation devices, such as
Scanners. The application is compatible with Windows®
95 and greater, including Vista and Windows 7. Because certain commands
are not normally revealed when the barcode is scanned, this application
is useful in verifying commands such as FS, RS, GS, and EOT when they are
encoded in barcodes. Symbols that include these characters include
UPS MaxiCode and
This product is easy to use. After installing the application, ensure the cursor is in the top text box. When the cursor is in this field, any input from keyboard emulation devices is duplicated in the lower text box. Information that is not normally visible is displayed between greater-than and less-than signs according to its ASCII function or value.
Automate Scanning with Functions such as Tabs & Returns
- Scanning may be automated to include functions such as tabs and returns - even in web browsers and custom operating systems. Tabs and returns may offer additional automation possibilities. For example, a single barcode may enter data in one field, tab to another, enter more data and choose the default button (a return) to perform a record lookup. The functions may be programmed into the barcode scanner or encoded directly in the barcode itself. Information about encoding tabs and returns into barcodes is available in the Code 39 FAQ and the Code 128 FAQ.
- Free support for hardware may be obtained by contacting the appropriate vendor of the scanner. Many other problems and solutions are provided at IDAutomation's support site and by searching resolved public forum threads. Priority phone, email and forum support is provided up to 30 days after a purchase of a software product. Additional priority phone, email and forum support may be obtained if the Priority Support and Upgrade Subscription is active for a software product.
Hand Held & USB Barcode Scanners Available
IDAutomation offers many easy-to-use handheld and USB barcode scanners including:
- IDAutomation SC5 USB Barcode Scanner
- IDAutomation Wireless Barcode Scanner
- IDAutomation 2D Barcode Scanner with PQA
- USB Barcode Scanners
- Barcode Wands (wands scan wider barcodes, up to 60 characters)
- Laser Barcode Scanners
- Complete Scanner Index
Barcode Printing Software Available
IDAutomation offers many products that print and/or create barcodes including:
- Barcode ActiveX Controls - easy to use add-ins for Microsoft Access, Excel, VB and C++.
- .NET Barcode Forms Controls - create and print barcodes from Microsoft Visual Studio.NET applications. Also generates images that can be saved to a file.
- ASP Barcode Server for IIS - add barcodes to any web application with this component for Microsoft IIS.
- ASP. NET Barcode Web Controls - for creating barcodes in VB.NET or C#.NET web applications.
- Barcode Fonts - allow easy creation of barcodes in several different applications.
- Barcode Label Design Software - allows easy printing of barcodes with database support.
- Hosted Barcode Services - allow dynamic creation of barcodes without installing any software.
- Barcode Image Generators - easily create barcode images for almost any Windows application.
- Java Servlets, JavaBeans, Class Libraries & Applets - create barcodes on any operating system with a JVM.