A handheld code reader reads every label on the bench through its USB cable, then the machine it must feed turns out to offer only a 9-pin serial port. Or you fitted a USB-to-RS232 adapter in between and the port never sees a byte. This guide is for controls engineers and integrators wiring handheld and fixed-mount code readers into PLCs, HMIs and embedded hosts. It separates what physically cannot convert from what converts by design, walks the wiring and the line-time arithmetic for the serial side, and ends with the decision for each case: the maker's interface cable, a small converter node, or a different interface chosen at order time.
The symptom and the causes, most likely first
The failure always looks like one of three things: the port stays silent, the port fills with nonsense, or the scanner enumerates on USB but never on serial after a cable swap. Ranked by how often each cause shows up:
- A passive adapter between two USB device ends. The scanner's USB cable and a USB-to-RS232 adapter both present device sides. Neither enumerates the other, so nothing moves in either direction.
- The interface was never switched. The scanner is multi-interface, but it still runs its USB profile while the RS232 cable is fitted, because the model needs the host interface changed or a defined cable-fit sequence.
- TX and RX are not crossed, or the signal common is missing. The port then sees framing errors or nothing at all.
- Baud or framing mismatch. Bytes arrive, but as garbage characters from a barcode scanner, and that fix walks the whole serial link down step by step.
- Level mismatch. A TTL-level serial output wired into a true RS232 input, or the reverse.
Each cause has a short test: remove the adapter, read the interface setting, follow the pinout drawing, send one known code and inspect the bytes, and check the electrical spec line. The sections below take them in order.
Why a plug adapter cannot do the job
USB and RS232 differ in three ways, and every one of them rules out a passive adapter.
Protocol. USB is negotiated. A host enumerates each device, assigns it an address and polls it; a device never sends data into a port that is not actively hosting it. RS232 is the opposite: the scanner pushes bytes out of its TX line at the agreed baud rate, and any listening receiver captures them. There is no enumeration to fail — just wire and timing.
Which side the adapter serves. A USB-to-RS232 adapter is a USB device on one side and a serial port on the other. Its USB side must plug into a host such as a PC. The scanner's USB cable makes the scanner a USB device too. Device into device enumerates nothing, so the adapter cannot bridge the two.
Signalling. USB drives a differential pair, D+ and D-, with small swings around a bias voltage; RS232 swings a single-ended line negative, from -3 V down to -15 V for a mark, and positive, from +3 V up to +15 V for a space. They share nothing at the connector.
So the conversion has to happen inside a device that speaks both languages: the scanner itself, or a small host you add. When the scanner does speak serial, the conversion becomes pure cable work, and a USB-to-RS232 wiring conversion for PLCs shows that cable path end to end.
The conversion that works: an interface selected by cable
Many industrial handheld scanners are multi-interface by design. The decoder supports several host interfaces — USB keyboard, USB serial emulation, RS232, sometimes keyboard wedge — and the scanner runs the one the fitted cable wires up. Some models detect the cable automatically at power-up; others need the host interface switched to serial with a configuration code or a setup-menu setting.
The pins show why no plug trick can substitute. On one typical hybrid host connector, the USB interface cable lands D+ and D- on pins 2 and 3, while the RS232 cable for the same socket lands TX on pin 4 and RX on pin 6. Same socket, different conductors, different signals. That is also why the maker publishes one interface cable part number per interface, with one pinout drawing per cable.
The fix, in order:
- Pull the scanner model's interface documents and the list of interface cables for that model.
- Order the RS232 interface cable for your exact model, not a generic patch cable.
- Fit it and switch the host interface to serial if the model requires it; power up and confirm with one scan.
- Wire the free end to the host per the drawing: scanner TX to host RX, scanner RX to host TX, commons joined.
For the PLC side of that hookup in detail, this RS232 scanner-to-PLC interface guide covers the host wiring step by step.
Worked example: putting a cable-selected scanner onto a 9600 baud PLC serial port
Inputs. A multi-interface handheld code reader with its RS232 interface cable fitted; the example interface drawing gives TX on host-connector pin 4, RX on pin 6, and the cable's common conductor — the kind of values every maker's drawing prints, so check yours against it. The host is a PLC serial port on a 9-pin D-sub connector wired as DTE, the standard arrangement: RX on pin 2, TX on pin 3, signal common on pin 5. The payload is a 12-character serial number plus a CR terminator, 13 characters in total. The line runs 9600 baud, 8 data bits, no parity, 1 stop bit (8N1), the factory default most serial devices ship with.
Rule. Cross TX to RX, join the commons, and the line time for one code is characters × bits per frame ÷ baud. Asynchronous 8N1 framing costs 10 bits per character: 8 data plus 1 start plus 1 stop.
At 38400 bit/s the same code takes 130 ÷ 38400 = 3.4 ms.
| Scanner cable conductor | PLC 9-pin D-sub (DTE) |
|---|---|
| TX — pin 4 in the example drawing | Pin 2 — RX |
| RX — pin 6 | Pin 3 — TX |
| Signal common | Pin 5 — signal common |
| Cable power lead, if the cable has one | The supply the datasheet rates, never the port |
Result and decision. The whole code is on the wire 13.5 ms after the scanner starts transmitting, so 9600 8N1 is comfortable for a handheld confirm-and-go station: the line idles between reads, and scan cycle time, not line time, sets the pace. Start both ends at 9600 8N1 and move to 38400 bit/s only for fixed-mount, high-rate reading, once both devices list that rate. If the port stays silent with this wiring, the cause sits upstream of framing — interface selection or power.
Serial-side checks that decide success
Run these in order once the maker's RS232 cable is on the scanner:
- Interface selection. The host interface is set to serial, or the model's cable auto-detect is confirmed. A scanner still selected for USB transmits nothing on the serial conductors.
- Crossed pair and common. TX to RX, RX to TX, commons joined. DTE and DCE confusion is the classic silent-port cause, and when the scanner ends in a round connector rather than bare wires, this M12 5-pin to DB9 RS232 wiring map shows how each conductor lands on the host plug.
- Signal level. True RS232 swings between -3 V and -15 V on the mark and +3 V and +15 V on the space. Some handhelds emit TTL-level serial, roughly 0 V to 5 V, and their interface cables carry any level conversion that is needed. A TTL output into a true RS232 input reads marginal or not at all; the electrical spec line in the interface datasheet settles which one you have.
- Framing. Identical baud, data bits, parity and stop bits at both ends. A mismatch does not silence the link; it fills the receive buffer with nonsense.
- Terminator and trigger. Set the suffix the PLC expects — CR is the common default — and the trigger mode the station needs. Serial-trigger models hold their data until the host commands a read, and a silent host command has its own fix: barcode scanner serial trigger.
- Power. RS232 conductors carry signal, not scanner power. Serial interface cables usually bring a separate power lead; run it from the supply the datasheet rates.
When the scanner is genuinely USB-only
If the model's interface list carries no serial cable, no wiring makes it speak RS232. Three options remain, in the order most benches should consider them.
Option 1: connect to a host that has a USB port
Benches and many HMI panels have USB host ports. A wired USB handheld code reader such as the one below presents itself to that port, and from there the HID keyboard mode or serial port decision on a PLC HMI and the focus behaviour of keyboard wedge barcode readers settle how the code lands in your entry field.
- Interface
- USB
- Connection
- Wired
Option 2: put a small host in between
An embedded controller or compact PC that reads the scanner on USB and re-emits the data over RS232 or Ethernet solves it without touching the scanner. The USB host OTG route on an embedded controller and the RS232 connection from a barcode scanner to an embedded host describe the two halves. Keep the node's job simple — read a line, frame it, forward it — because a converter that buffers more than one code is where duplicates and losses start.
Option 3: order the interface the machine needs
Past about 15 m — the serial standard's planning figure at 20 kbit/s, generous at 9600 baud on decent cable but a sound design limit — serial stops being the right answer, while Ethernet carries 100 m per segment and plugs into the plant network directly. Fast Ethernet readers take over from there:
- Interface
- Fast Ethernet
- Connection
- Wired
- Interface
- Fast Ethernet
- Connection
- Wired
And where the operator walks the aisle instead of returning to a fixed point, a wireless handheld reader package removes the cable question entirely:
- Connection
- Wireless
Checks before you order or strip a wire
- Inventory the machine's ports first: COM port, USB host, Ethernet. The host decides the interface; the cable drawer does not.
- Pull the model's interface documents: the cable list with one part number per interface, the pinout drawing, and the electrical line that says true RS232 or TTL-level serial.
- Confirm how the model selects its interface — automatic on cable fit, or a host-interface setting you change yourself.
- Plan scanner power for the serial cable, because the 5 V a USB cable carries does not follow a serial cable.
- Fix the line defaults at commissioning on both ends at once: 9600 baud, 8N1, CR suffix, trigger mode.
- For the parts around these readers — covers, light boards, I/O boxes — the code reader accessories category is the shelf to check.
The decision, per case
- Serial-only host, multi-interface scanner. Order the maker's RS232 interface cable for that exact model, wire TX and RX crossed with commons joined, start both ends at 9600 8N1 with a CR suffix. The conversion is passive and takes minutes.
- Serial-only host, USB-only scanner. An adapter will never bridge it. Add the small USB-to-serial converter node, or replace the reader — the handheld barcode scanner to a PLC without Ethernet: RS232 or USB comparison compares the two from the machine side.
- Host with a USB port. Skip serial entirely; USB with the entry field holding focus is the lower-risk path, and the serial, USB and Ethernet input paths into a PLC map all three before you commit.
- Long distance or plant network. Choose the Ethernet model and abandon the serial run; a PoE reader also picks its power up over the network cable, so no separate supply drop at the scanner.
To pick the reader and its interface in one pass, start at the handheld code readers category or the code reader finder; more serial-link fixes sit on the code reading topic page. If a link still will not close, send the scanner model and the port you have through the contact page and we will check the fit.
Questions
Can I cut open a USB cable and an RS232 cable and join them to convert the scanner?
No. The USB cable's D+ and D- land on different conductors than the serial cable's TX and RX on the same scanner, the USB cable carries 5 V bus power that has no place in a serial port, and the scanner only runs the interface its selection logic has chosen. Joining cables merges incompatible signals and can damage both ends. The documented cable per interface is the supported path.
How far can an RS232 barcode scanner cable run?
Plan on about 15 m, the serial standard's conservative figure at 20 kbit/s. At the 9600 baud rates scanners usually use, longer runs with good cable often work, but they depend on cable quality and electrical noise, so treat 15 m as the design limit and move to Ethernet — 100 m per segment — beyond it.
What settings should a scanner-to-PLC serial link start at?
9600 baud, 8 data bits, no parity, 1 stop bit, with CR as the suffix on both ends. That combination is the common factory default and matches the worked example above; the whole code then takes about 13.5 ms on the wire. Change settings only when the receiving device demands it, and change one end at a time so a mismatch never hides another one.
Does the RS232 cable power the barcode scanner?
No. RS232 conductors carry signal levels only, which is why serial interface cables usually bring a separate power lead for the scanner's rated supply. USB works differently: a USB cable carries 5 V on its power pin, so a USB-cabled scanner can appear self-powered. Keep the two supplies separate — never back-feed a serial port from the scanner's supply.
Why does my scanner work on USB but send nothing on RS232?
Almost always interface selection: the scanner is still running its USB profile while a serial cable is fitted, because the model needs its host interface switched or its defined power-up sequence with the serial cable. Check that first, then the crossed TX/RX pair and the joined common, then identical baud and framing. Silent means selection or wiring; garbage means framing.



