A barcode reader on a bench or in a cell is a serial text source once it has decoded the code: open its port, read one line per scan, log the string. Most integrations overthink this step or assume the vendor SDK is required. It is not. This guide shows how to wire an RS-232 reader — or a USB or Ethernet one — into data acquisition software, which port parameters to set, how to frame each scan on its termination character, and how to prove the link before you trust the log. The values below are the ones most industrial readers ship with; where your reader's interface guide differs, set both ends to match it.
What the reader actually sends
A serial barcode reader is a decoder first. It finds the symbology — Code 128, QR, DataMatrix — in the image, decodes it and writes the payload onto the port as ordinary ASCII text. The acquisition software never sees a barcode. It sees characters, one scan per read, normally ending in a carriage return, ASCII 13 (hex 0D); many readers add a line feed, ASCII 10 (hex 0A), after it.
That also settles the encryption question that comes with this task: if the code on the label carries encrypted data, the reader still hands you the ciphertext characters. Decoding the symbology and decrypting the payload are different jobs, and only the first happens inside the reader. For a plain part or lot number, the port delivers plain text — no SDK and no driver beyond the operating system's own serial support is needed to log it. How the characters get framed with prefixes, suffixes and terminations is its own subject: prefix and suffix framing for barcode scanner input.
What you need
- A reader with an RS-232 output, a USB reader whose virtual COM port driver is installed, or a native serial reader plus a USB-to-RS-232 adapter for a portless PC.
- The reader's own host cable: on many industrial models power arrives on a pin of that cable, so a generic DB9 lead can leave the reader dark.
- The reader's programming chart or quick-start card, for baud rate, termination and trigger mode.
- Data acquisition software with a serial channel: a port name, a baud rate and a read timeout are what it will ask for.
- A test label whose payload you know character by character.
Choose the interface path
Native RS-232 is the classic case. Filter the handheld code readers or the fixed code readers by the serial interface in the code reader finder, and the reader behaves as a plain text source exactly as below.
Wired USB is the common bench case. With the vendor's virtual COM port driver installed, the reader appears as a COM port and every step in this guide applies unchanged; left in HID keyboard mode it creates no port at all, which port-based software cannot open. USB barcode scanner data capture in your application covers the enumeration side, and the input methods a barcode scanner can use towards a PLC map the same three options for any host. The shop's wired-USB formats cover bench and fixture:
- Interface
- USB
- Connection
- Wired
- Resolution
- Up to 3 MP
- Shutter
- Global
The LS-CRD-0047 is the fixture version: 1.2 MP through USB 2.0 with a 60-120 mm reading distance, so set the mount height once and the reading zone stays fixed.
Ethernet readers need no driver at all. The acquisition side opens a TCP socket to the reader's address and reads the same ASCII lines with the same framing. The MV-ID3013PM-12M-WBN is a compact fixed reader on Fast Ethernet with a 12 mm lens and a 1.3 MP sensor.
- Interface
- Fast Ethernet
- Resolution
- Up to 3 MP
- Shutter
- Global
- Lens mount
- M12
For a cable-free bench, the LS-HCR-0002 pairs a 1.0 MP global-shutter sensor with an Ethernet interface over a wireless connection — same socket, same framing, no cable to the cell.
- Resolution
- Up to 3 MP
- Shutter
- Global
- Interface
- Ethernet
- Connection
- Wireless
Wire it and set it up, step by step
The settings below are what most serial readers ship with; the steps use them.
| Parameter | Start value | If it fails |
|---|---|---|
| Baud rate | 9600 | Try 19200 or 38400, on both ends |
| Data bits | 8 | — |
| Parity | None | Even, only if the reader's chart says so |
| Stop bits | 1 | 2 on some older readers |
| Flow control | None | Hardware handshake silently blocks a port |
| Read termination | Carriage return, ASCII 13 | Strip a trailing line feed too |
- Confirm the interface and order the matched cable. If the reader powers from its host cable, a generic lead will not do; the reader's accessory cable is the part to buy.
- Wire the DB9. A PC port or adapter is DTE: pin 2 receives, pin 3 transmits, pin 5 is ground. If everything else is right and the port stays silent, fit a null-modem adapter — it crosses pins 2 and 3, and readers ship both ways.
- Add a USB-to-RS-232 adapter if the PC has no COM port. At 9600 baud the link carries 960 characters per second at most, so any listed adapter keeps up. It appears as a new COM port on Windows and as /dev/ttyUSB0 on Linux. RS-232 is rated to 15 m at its 20 kbit/s maximum; at 9600 baud longer runs usually still work, so test the real cable before it goes into a tray.
- Set the acquisition channel to the starting combination. Match the reader's chart first, then change one parameter at a time, on both ends.
- Configure the reader from its programming chart or menu. Set the same baud, parity and stop bits, choose the carriage-return termination, and pick the trigger mode: continuous presentation for a bench, or a host command when the machine decides when to read. Commands that produce no response have their own diagnosis in barcode scanner serial trigger: fix silent host commands.
- Frame each scan on its termination character. Enable the port's read-until-termination mode, terminate on ASCII 13, and strip the return plus any trailing line feed before the string reaches the log or database. Reads sized by timeout alone are the classic cause of truncated lines.
- Prove the path end to end. Scan the known test label: the payload should arrive as one read, within one poll interval. If nothing comes, a loopback plug — pins 2 and 3 bridged on the adapter — echoes whatever the software sends and splits the fault in half: port side or reader side.
Worked example: what one scan costs the port
Ten bits per character is the 8N1 frame: one start, eight data, one stop. Take a 12-character lot code such as A24170889302 plus one carriage return: 13 × 10 = 130 bits. At 9600 baud that is 130 ÷ 9600 = 13.5 ms on the wire; with a trailing line feed, 140 ÷ 9600 = 14.6 ms. Port capacity at 9600 baud is 9600 ÷ 10 = 960 characters per second, so a scan every second spends 13 of those 960 — about 1.4% of the link. If the software polls every 100 ms, it gathers up to 960 × 0.1 = 96 characters per poll, so a full line always completes inside one.
That leaves comfortable headroom: 9600 8N1 is plenty for scan logging, and the baud rate only becomes a real decision when a reader ships images or when dozens of codes land inside the same second.
When the port misbehaves
| Symptom | Most likely cause | Test |
|---|---|---|
| Nothing arrives | Wrong COM number, crossed TX/RX, unpowered reader | Loopback plug first, then a null-modem adapter, then trigger the reader and listen for its read beep |
| Garbage characters | Baud, parity or stop-bit mismatch, or TTL levels on a home-made lead | Set 9600 8N1 on both ends; if it persists, check for a level transceiver |
| Every scan prints twice | CR LF sent and both framed | Terminate on CR and discard the LF |
| Lines cut short | Read sized by timeout, not termination | Enable read-until-termination |
| Port hangs after the first scan | Flow control left on | Set flow control to none |
Garbage that survives every setting change is usually not a setting problem. Garbage characters from a barcode scanner: fix the PLC serial link walks that case further, including the electrical ones.
When serial is the wrong answer
A reader stuck in HID keyboard mode never creates a port, so there is nothing for the acquisition software to open. Either switch it into its virtual COM mode with the vendor driver, or capture the keystrokes instead — the trade-offs are laid out in handheld barcode scanner to a PLC without Ethernet: RS232 or USB?.
An Ethernet reader is not a wrong answer either: point the software at a TCP socket and frame lines identically. For a logging-only sink without a live link, Ethernet barcode reader to CSV for watched-folder imports skips the socket entirely.
And when the logger grows into a controller — interlocks, reject handling, recipe selection — move the link into a PLC. The framing you built here transfers unchanged; the barcode reader to PLC data acquisition setup guide lays out that side of the install.
Checks before you trust the log
- Both ends report the same baud, parity, data and stop bits — a mismatch shows up as silence or garbage, never as a warning.
- Flow control is off — hardware handshake on one side stalls the port after the first buffer.
- Reads terminate on the carriage return — timeout-sized reads truncate lines under load.
- A trailing line feed is stripped before logging — otherwise the payload never matches its pattern.
- The known test label logs character-for-character correct — that is the acceptance test; keep the label with the station.
- A re-plug or power cycle recovers on its own — check whether the port number moves and pin it if it does.
- The cable run is within 15 m, or tested at its real length — the rated RS-232 envelope, not a guess.
When the test label round-trips, point the channel at real production labels and watch a shift of scans land. To pick a reader with the interface your software can actually open, start at the build-a-system configurator, or contact us and the applications team goes through a specific reader's serial output with you before you order. The systems topic page collects the rest of the integration-level guides.
Questions
What serial settings should I try first on a barcode reader?
Start at 9600 baud, 8 data bits, no parity, 1 stop bit, flow control off, with each scan ending in a carriage return (ASCII 13). That combination is the factory default on most serial readers. If the port stays silent or delivers garbage, change one parameter at a time, on both ends, using the reader's programming chart or menu so reader and software always match.
Can a USB barcode scanner show up as a serial port?
Only if the reader offers a USB virtual COM port mode and its driver is installed; the port then sits alongside your native COM ports and every step in the guide applies unchanged. A reader left in HID keyboard mode creates no port at all, so port-based software cannot open it. Switch modes in the reader's settings or choose a model with a virtual COM driver.
Why do I get garbage characters instead of barcode data?
Almost always a parameter mismatch: the software's baud rate, parity or stop bits do not match the reader, or the line carries TTL logic levels where RS-232 levels belong. Set 9600 8N1 on both ends first. If garbage survives on a home-built lead, put an RS-232-to-TTL level transceiver between the DB9 and the low-voltage logic.
How many scans per second can a 9600 baud serial link carry?
An 8N1 frame is 10 bits per character, so 9600 baud carries 960 characters per second. A 13-character line is 130 bits, about 13.5 ms on the wire. A scan every 100 ms therefore uses under 2% of the link, so the real limits come from the reader's decode rate and trigger logic, not the serial port.
Do I need the reader's SDK to log scans in DAQ software?
No. The reader decodes the symbology and sends the payload as ordinary ASCII, so a plain serial read is enough to log scans. The vendor SDK earns its place only when you want images, event metadata, remote configuration or proprietary trigger commands; for capture-and-log, a port, a framing character and a text parse cover it.



