Barcode Scanner Configuration: Prefixes, Suffixes & Parsing
Configuring barcode scanners for your application — programming barcodes, prefix/suffix settings, keystroke emulation, and data parsing rules.
Scanner Configuration & Data Parsing
Barcode scanners are configurable devices whose behavior depends on firmware settings, interface modes, and data formatting rules. Proper configuration ensures scanned data arrives at your application in the expected format, ready for processing.
Interface Modes
Scanners connect to host systems through several interfaces:
- Keyboard wedge (HID): Scanner emulates keyboard input. The scanned data appears as keystrokes in whatever application has focus. Simple but limited: no way to distinguish scan data from typed input
- Serial (RS-232/USB COM): Scanner sends data as a serial stream. The application reads from a COM port. Provides precise control but requires serial programming
- USB HID POS: A specialized USB mode where the scanner presents as a POS device. The OS routes data to your barcode-aware application exclusively
- Bluetooth SPP: Wireless serial connection for mobile scanners
Data Formatting
Scanners can modify the raw barcode data before transmission:
Prefix and suffix: Add characters before or after the scanned data. Common configurations:
- Add a prefix character to identify the scanner (e.g., S1: for scanner 1)
- Add a carriage return (CR) or line feed (LF) suffix to terminate the data
- Add a CR+LF suffix for Windows applications
AIM identifiers: Prepend a 3-character code identifying the symbology (e.g., ]C1 for Code 128, ]E0 for EAN-13, ]d2 for Data Matrix). This lets your parser know which barcode type was scanned.
Data editing: Some scanners can strip characters, insert characters, or reformat data. For example, stripping the leading zero from a 13-digit EAN-13 scan to produce a 12-digit UPC.
GS1 Data Parsing
When scanning GS1-128 or gs1-datamatrix-term/" class="glossary-term-link" data-term="GS1 DataMatrix" data-definition="Data Matrix with GS1 AIs for pharma and food traceability." data-category="2D & Matrix Symbologies">GS1 DataMatrix barcodes, the raw data contains Application Identifiers concatenated with their values, separated by FNC1 (transmitted as GS, ASCII 29):
Raw scan: ]C10109506000134352172512311 0ABC123
Parsing steps:
1. Identify the symbology prefix (]C1 = GS1-128)
2. Read AI (01), which is fixed-length (14 digits): 09506000134352
3. Read AI (17), which is fixed-length (6 digits): 251231
4. Read AI (10), which is variable-length, terminated by GS or end-of-data: ABC123
Configuration Methods
- Programming barcodes: Scan special barcodes from the scanner's manual to change settings. Most common method for basic configuration
- Management software: Use the manufacturer's utility (Zebra 123Scan, Honeywell EZConfig, Datalogic Aladdin) for detailed settings
- Remote management: Enterprise scanner management platforms push configurations to all scanners centrally
- API commands: Send SSI (Simple Serial Interface) or OPOS commands programmatically
Common Configuration Issues
| Problem | Cause | Solution |
|---|---|---|
| Missing characters | Keyboard wedge too fast | Slow inter-character delay |
| Garbled data | Wrong character encoding | Match scanner charset to application |
| GS character missing | Scanner strips FNC1/GS | Enable GS transmission in scanner config |
| Wrong symbology decoded | Scanner decodes similar symbology | Disable unneeded symbologies |
| Double scans | No scan delay configured | Set minimum rescan interval |
Testing Scanner Configuration
Before deploying scanners in production:
- Scan test barcodes of every symbology you will use
- Verify the exact character sequence received by your application
- Confirm GS/FNC1 characters are transmitted for GS1 barcodes
- Test scanning speed under realistic conditions
- Verify behavior when scanning damaged or low-quality barcodes