Your controller offers one serial port and it is a 2-wire RS485. The scanner on the bench speaks RS232. Both carry the same asynchronous serial data, and an RS232-to-RS485 converter bridges the electrical gap — but converter power, half-duplex discipline and bus termination decide whether the first read works or costs you a day. This guide walks the wiring, the serial settings and the power-on checks, then runs the arithmetic that tells you whether termination matters at your cable length and baud rate. It closes with the cleaner alternative when the controller has a spare Ethernet port: a PoE-powered code reader on one cable.
Pick the route before you touch a wire
Commit to one of three routes; they share almost no hardware.
| Route | Hardware | Choose it when |
|---|---|---|
| RS232 scanner through an RS232-to-RS485 converter | converter, twisted pair, 120 ohm end terminations | the controller exposes only an RS485 serial port and the scanner is already chosen |
| Ethernet code reader on PoE | PoE injector or PoE port, one Ethernet run | the controller has a spare Ethernet socket and you want data and power on one cable |
| Serial scanner through a serial-to-Ethernet gateway | serial-to-Ethernet converter box | the controller speaks Ethernet only but the serial scanner must stay |
The first route is worked end to end below. If the choice between scanner interfaces is still open, Barcode scanner interface conversion: USB or RS232 wiring weighs USB against RS232 first, and the gateway route is walked in Barcode scanner serial to ethernet converter into plant data tags.
What the converter actually changes
RS232 sends each bit as a voltage on one wire against ground; RS485 sends the difference between two wires. The differential pair survives hundreds of metres of cable and the electrical noise near drives and contactors, where RS232 is comfortable over a few metres at best.
Two consequences decide your build. First, a 2-wire pair is half duplex: driver and receiver share the same conductors, so the link speaks in turns and nothing transmits while a read is arriving. Second, most inexpensive converters are passive — a 3-wire design with no supply of their own. They draw power from the RS232 port's handshake lines and turn the RS485 driver on from the transitions on TXD. A powered converter with its own supply terminals removes that dependency and is the safer default on an unknown port.
Parts you need
- A scanner with an RS232 serial interface, on a DB9 or bare leads — not USB.
- An RS232-to-RS485 converter; powered type preferred.
- Shielded twisted-pair cable; one pair of a Cat5e run works.
- 120 ohm end-of-line termination, usually a switch setting on the converter and on the controller's RS485 port.
- A 0 V reference conductor between the converter, scanner and controller grounds.
- The scanner's own supply, per its manual.
If the scanner's power-and-I/O connector is an M8 8-pin, the LS-CBL-0300 is the break-out lead for it: M8 8-pin male to eight open cores over 7 m, rated for drag-chain use, so the loose ends land directly on your terminal block.
- Type
- Power and I/O cables
- Length
- 6-8 m
Wire the 2-wire pair
- Name the pair consistently. RS485 terminals are marked A/B or D+/D- — the same two wires under different names. Keep the same conductor on the same label at every end of the run.
- Collapse a 4-wire port onto 2 wires. Converters and ports that expose separate TX+/TX- and RX+/RX- terminals are full duplex by design; jumper TX+ to RX+ and TX- to RX- so both directions share the pair.
- Terminate both physical ends: 120 ohms across the pair at the converter end and at the far end of the cable. Where the hardware offers a termination switch, use it instead of soldering resistors.
- Confirm fail-safe bias. Bias resistors hold a defined differential voltage when no device transmits; converters and RS485 ports usually include them. An unbiassed bus leaves the receiver output chattering while idle.
- Run a 0 V reference conductor alongside the pair so the common-mode voltage stays inside the transceivers' range. Bond the cable shield to ground at one end only, and never use the shield as the reference conductor.
- Route the pair away from motor and drive cables, and cross any unavoidable crossing at right angles.
For the RS232 side of the link — which pin is RX, which is TX, and the null-modem swap between them — RS232 barcode scanner connection to an embedded host walks the pinout.
Set the serial parameters on both ends
- Match the serial format at both ends. The factory default most scanners ship with is 9600 baud, 8 data bits, no parity, 1 stop bit; set the controller port to the same. A mismatch produces framing garbage, not silence.
- Turn hardware handshaking off — RTS/CTS pacing has no meaning on a shared pair. On a passive converter, do the opposite for the handshake lines themselves: assert them so the converter has power.
- Run point to point. One scanner per pair, and disable any multi-drop or device-address mode in the scanner's configuration.
- Agree on the protocol: plain ASCII frames, or Modbus RTU if the controller expects register data — the scanner manual states which it speaks. For the controller side of an RS485 Modbus RTU link, this RS485 barcode scanner Modbus RTU setup guide for PLCs follows the same serial settings from the other end of the wire.
- Frame the data with a preamble or suffix — carriage return and line feed is the common choice — so one read is distinguishable from the next. Barcode scanner capture without a prefix: preamble and serial explains the framing rules.
- Pick the trigger mode. A serial read command works fine over half duplex once you handle the echo, and a hardware trigger input on the scanner's I/O connector avoids the echo entirely; Fixed barcode reader trigger modes: sensor, serial or free-run compares the options.
Worked example: a 9600 baud scanner 100 m down the line
The case: the scanner sits 100 m from the controller, a typical line run, at 9600 baud — the default most scanners ship with. Inputs: length 100 m; rate 9600 bits per second; propagation about 5 ns per metre, typical for twisted pair at a velocity factor near 0.66.
The rule: on an unterminated pair, reflected energy settles within the round-trip delay. Keep the round trip under about a tenth of the bit time and the link works bare; exceed it and termination becomes part of the design.
Arithmetic:
- bit time = 1 / 9600 = 104.2 µs
- round-trip delay = 2 x 100 m x 5 ns/m = 1.0 µs
- share of the bit time = 1.0 / 104.2 = 0.01, about 1 %
One percent, an order of magnitude inside the budget. Reflections are not the limit at this rate and length, and the same budget allows an unterminated run of 0.1 x 104.2 µs / (2 x 5 ns/m) = 1.0 km.
The decision: at 9600 to 19200 baud, fit the 120 ohm terminations the converter and controller offer anyway — two switch positions that remove the length judgement — and keep the run inside the roughly 1200 m guided for low-rate RS485. The budget tightens quickly as the rate climbs: at 115200 baud the bit is 8.68 µs and the tenth-of-a-bit rule allows about 87 m bare, while at 1 Mbps the round trip on 120 m of cable, 10 ns/m x 120 m = 1.2 µs, already exceeds the 1 µs bit — transmission-line territory where termination is not optional.
The cleaner route: an Ethernet reader on PoE
If the controller has a spare Ethernet socket, commit there instead. An Ethernet code reader puts data and — with power over Ethernet — supply on one Cat5e run, needs no converter, no bias and no termination arithmetic, and standard Ethernet segments reach 100 m. 5GBASE-T camera interface: bandwidth, cables and distance goes deeper on cable grades and distance at higher speeds.
Check two things before ordering. Power: match the injector's PoE class to the reader's draw — the classes deliver about 13 W (802.3af), about 26 W (802.3at) and up to 71 W at the powered device (802.3bt). Does my camera support PoE: check the port before you buy walks that port check. Mounting: industrial readers in M10 or M12 mounts bolt straight to a line bracket.
The MV-ID813M-05S-WBN-SR is a 1.3 MP GigE code reader with a 4.9 mm focal length, white light illumination and an M10 mount.
- Interface
- GigE
- Resolution
- Up to 3 MP
- Lens mount
- M10
For bench rigs and short machine runs, the LS-CBL-0117 is an RJ45 data cable with locking studs, 15 m long.
- Type
- Camera data cables
- Length
- 15 m
Both of these Fast Ethernet readers cover typical line-side decode jobs:
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Interface
- Fast Ethernet
- Resolution
- Up to 3 MP
If the controller speaks Ethernet only and the serial scanner must stay, put a serial-to-Ethernet gateway between them; connecting an RS232 barcode scanner to a PLC through a gateway walks that wiring.
Checks before you power on
- Power everything off and measure DC resistance across the pair at the controller end. Two 120 ohm terminations in parallel read (120 x 120) / (120 + 120) = 60 ohm. Near 120 ohm means only one end is terminated; an open circuit means neither is.
- Idle the bus and measure the voltage across A and B. Fail-safe bias should give a clear reading of a few hundred millivolts — receivers resolve a state from a 200 mV differential — so a near-zero or reversed reading points to a swapped pair.
- Send one test character from the controller. Seeing it come straight back is the half duplex working, not a fault; configure echo handling before blaming the scanner.
- Trigger a first read and confirm the suffix delimits the string cleanly in the controller's receive buffer.
- Check the 0 V conductor is continuous between all three grounds and the shield is bonded at one end only.
Where this approach fails
Three dead ends, so you do not burn an afternoon on them. A USB scanner cannot join the pair: USB needs a host stack with drivers for the specific device, and a USB-to-serial adapter is itself just another USB device — USB host OTG barcode scanner on an embedded controller covers what a real USB host must provide. A scanner with a native multi-drop protocol answers only masters that speak its addressing scheme, so it stays silent behind a plain converter. And a scanner that demands RTS/CTS pacing will stall on a shared pair; choose Ethernet for those.
Where to go next
Once the wire works, plan the data path: Barcode reader PLC communication: plan a reliable link covers the handshake, timeouts and retry logic that keep decodes flowing into your controller. Browse the fixed code readers — the shop finder filters them by interface, resolution and shutter — and the cables for break-out and data leads, or step through the system configurator. More integration write-ups sit on the systems topic page, and if a build refuses to cooperate, contact the applications team with the scanner's serial settings and the wiring will get a second pair of eyes.
Questions
Can I attach a USB barcode scanner to the RS485 pair?
No. A USB scanner speaks USB and needs a USB host port with matching drivers; a USB-to-serial adapter is itself another USB device, so nothing in that chain ends in RS485. Choose a scanner with a serial or Ethernet interface, or put a serial-to-Ethernet gateway between the scanner and the network. The converter discussed here translates RS232 levels only, for scanners that already speak RS232.
How many scanners can share one RS485 pair?
Electrically, the classic RS485 segment supports 32 unit loads, and modern transceivers stretch that further. Practically, a barcode scanner protocol is point-to-point: one scanner per pair, because both would answer the same read command at once. For several scanners, run one pair per scanner to separate ports, or move to Ethernet, where every reader has its own address on the network.
Is Cat5e cable acceptable for the RS485 run?
Yes. Use one twisted pair, the blue pair is a common choice, for A and B, a second pair for the 0 V reference, and the drain wire for the shield, bonded at one end. Cat5e's nominal 100 ohm impedance differs from the classic 120 ohm RS485 cable, but at barcode baud rates of 9600 to 115200 the mismatch is not a practical problem; terminate at the ends as usual.
Why do my own transmit characters come back to the controller?
Two-wire RS485 is half duplex: the driver and receiver share the same pair, so every character the controller sends also arrives at its own receiver. Handle it in the receive routine by counting expected characters or dropping input between a command and its response, or gate the receiver off during transmit if the converter or port supports it. The echo is normal behaviour, not a wiring fault.
Does the converter need its own power supply?
A passive converter has no supply terminals: it draws power from the RS232 port's handshake lines, so something must assert them. If neither the controller nor the scanner drives those lines, a powered converter with its own supply terminals is the reliable choice. Check the converter's supply range against the cabinet's 24 V or 5 V rail before ordering.




