B&R Serial Communication Diagnostics — Complete Reference
Serial communication (RS232 and RS485) remains pervasive on legacy B&R machines, connecting the PLC to drives, scales, barcode readers, operator terminals, and other devices. When serial communication fails, the symptoms can range from intermittent data corruption to complete device unresponsiveness — and the original device specifications are almost never available. This document covers how to sniff serial traffic between the PLC and serial-connected devices, common B&R serial protocol patterns, how to decode the data streams, and how to replace or reconfigure serial connections when the original setup is unknown. Cross-references: cp1584-hardware-ref.md for RS232/RS485 hardware details, io-sniffing.md for general sniffing techniques, and modbus-gateway.md for Modbus serial gateway configuration.
Table of Contents
- Overview of B&R Serial Communication
- B&R Hardware Platforms and Serial Capabilities
- Serial Interface Modules: System 2003 / 2005
- Serial Interface Modules: X20 System
- Wiring and Pinouts for RS232 and RS485
- Baud Rate, Parity, and Stop Bit Configuration
- Flow Control and Handshake Issues
- B&R Software Libraries for Serial Communication
- How to Sniff Serial Traffic Between PLC and Serial-Connected Devices
- Tools for Serial Sniffing
- How to Decode Serial Data
- Protocol Analysis: MODBUS RTU Over Serial
- Protocol Analysis: Custom ASCII and Binary Protocols
- Reconfiguring or Replacing Serial Connections When Specs Are Unknown
- Serial-to-Ethernet Conversion Options
- Common Serial Communication Failures and Debugging
- Troubleshooting Matrices
- References and Further Reading
1. Overview of B&R Serial Communication
B&R Automation (Bernecker + Rainer) industrial controllers use serial communication (RS232, RS485, RS422) extensively for connecting to third-party devices — sensors, drives, HMIs, barcode readers, weigh scales, temperature controllers, and more. Understanding how to diagnose, sniff, and decode serial traffic is critical when commissioning systems, troubleshooting intermittent failures, or reverse-engineering undocumented connections.
B&R serial communication spans three major hardware families:
- System 2003 — compact DIN-rail controllers with integrated or plug-in serial modules
- System 2005 — modular rack-based controllers with interface modules (IF260, IF671, IF622, etc.)
- X20 System — modular I/O with base modules providing integrated serial, plus dedicated communication interface modules (X20CS1020, X20IF1030, X20IF1082, etc.)
On the software side, two primary libraries handle serial I/O:
- DV_Frame — general-purpose raw serial frame I/O (user-defined protocols, ASCII, binary)
- DRV_mbus — Modbus RTU master/slave with automatic CRC and function code handling
2. B&R Hardware Platforms and Serial Capabilities
2.1 X20CP1584 / X20CP1585 / X20CP1586
The X20CP158x series are compact X20 CPUs with integrated serial and Ethernet:
| Interface | Type | Connection | Max Distance | Max Rate |
|---|---|---|---|---|
| IF1 | RS232 | 12-pin terminal block X20TB12 | 15 m | 115.2 kbit/s |
| IF2 | Ethernet (10/100/1000) | RJ45 | 100 m | 1 Gbit/s |
IF1 RS232 Pinout on X20TB12 terminal block:
| Terminal | Signal | Direction |
|---|---|---|
| 9 | TxD (Transmit Data) | Output from PLC |
| 10 | RxD (Receive Data) | Input to PLC |
| 11 | GND (Signal Ground) | Reference |
| 12 | Shield / FE (Functional Earth) | Chassis/shield |
The RS232 interface is not electrically isolated from the PLC logic on most X20CP158x models. Use shielded cable with shield bonded at one end only to prevent ground loops.
2.2 X20CP1484 / X20CP1485 / X20CP1486
Similar to the 158x series but with Ethernet limited to 10/100 Mbit/s on IF2. IF1 is RS232 via the same X20TB12 terminal block pinout.
2.3 X20CP0482 / X20CP0484
Entry-level X20 CPUs. The serial interface is provided by the base module (X20BB52) and exposed on the power supply module’s (X20PS9600) terminal block. IF1 = RS232 at up to 115.2 kbit/s.
2.4 CP476 (System 2003)
Compact controller with integrated serial port. Uses DB9 connector for RS232:
- Pin 2: TXD (Transmit)
- Pin 3: RXD (Receive)
- Pin 5: GND (Signal Ground)
Supports both RS232 and RS485 depending on model variant. Programmed using the DV_Frame library.
2.5 Base Modules with Integrated Serial (X20 System)
A critical architectural detail: on the X20 system, the integrated serial interface lives on the base module, not on the power supply module:
| Base Module | Integrated Serial | Interface Type | Max Rate |
|---|---|---|---|
| X20BB52 | COM1 (RS232) | RS232 | 115.2 kbit/s |
| X20BB62 | None | Power feed only | — |
| X20BB72 | COM1 (RS232) | RS232 | 115.2 kbit/s |
| X20BB82 | COM1 (RS232/RS422/RS485) | Software-selectable | 115.2 kbit/s |
The X20PS9600 power supply module passes the RS232 signals from the base module to its terminal block. A second X20PS9600 will not provide a second serial port — each X20 segment allows exactly one PS module.
3. Serial Interface Modules: System 2003 / 2005
3.1 IF260 — Programmable Interface Module
The IF260 (3IF260.60-1) is a System 2005 interface module that can function as either a CPU or as a programmable interface processor. The module auto-detects its operating mode from the slot position:
- Slot 0 — operates as a CPU
- Other slots — operates as a programmable interface processor
This allows the IF260 to offload serial communication processing from the main CPU. It runs its own Automation Basic program and can handle multiple serial protocols independently.
3.2 IF622 — Triple Serial Interface (1×RS232, 2×RS485/RS422)
The IF622 (3IF622.9) provides:
- IF1: 1× RS232 interface
- IF2, IF3: 2× RS485/RS422 interfaces
All interfaces are electrically isolated. Used in System 2005 racks for expanding serial connectivity beyond what the CPU provides natively.
3.3 IF671 — Triple Communication Module (RS232, RS485/RS422, CAN)
The IF671 (3IF671.9) provides three isolated communication interfaces on a single module:
- IF1: RS232
- IF2: RS485/RS422
- IF3: CAN bus
This is the most versatile serial interface module for System 2005, covering RS232 point-to-point, RS485 multi-drop, and CAN bus in one card.
3.4 IF261 / IF262 / IF3xx Series
- IF261 — CPU module variant for System 2003/2005
- IF262 — Interface processor for serial protocols
- IF3xx series — Various interface modules for specific fieldbus protocols (Profibus DP, CANopen, DeviceNet) with optional serial sub-interfaces
3.5 CP260 — Serial + CAN Interface Module
The CP260 (3CP260.60-1) provides:
- 1× RS485/RS422 interface
- 1× CAN interface
Used as a compact interface processor or standalone communication node.
4. Serial Interface Modules: X20 System
4.1 X20CS1020 — RS232/RS422/RS485 Communication Module
| Parameter | Value |
|---|---|
| Interface standard | EIA-232-F / EIA-422 / EIA-485 |
| Configuration | Software selectable (no DIP switches) |
| Max baud rate | 115.2 kbit/s |
| Handshake | RTS/CTS or XON/XOFF (RS232 mode) |
| Bus connection | X2X Link to local controller |
| Electrical isolation | Yes |
Device name in Automation Studio: CS1020_IF1
This is the standard choice for adding a second serial port to an X20 controller when the base module’s integrated port is already in use.
4.2 X20IF1030 — RS232 Interface Module
| Parameter | Value |
|---|---|
| Interface standard | EIA-232-F |
| Max baud rate | 115.2 kbit/s |
| Connector | 9-pin D-Sub female |
| Electrical isolation | No |
Designed for point-to-point RS232 serial connections. Note: The X20IF1030 is RS232 only — do not confuse it with the X20IF1031 (RS422/RS485) or X20IF1041 (RS422/RS485 isolated). For multi-drop RS485 networks, use X20IF1031 or X20IF1041. See modbus-gateway.md for the complete serial module comparison.
4.3 X20IF1082 — Configurable RS232/RS485
Single configurable channel supporting either RS232 or RS485 communication. Software-configurable interface standard.
4.4 X20IF1072 — RS485 Interface Module
Dedicated RS485 interface for the X20 system. Used for serial remote connection of complex devices.
4.5 X20PS9600 — Power Supply (Serial Pass-Through)
Not a serial module itself — the X20PS9600 passes RS232 signals from the base module (e.g., X20BB52) to its terminal block:
| Terminal | Signal | Direction |
|---|---|---|
| 1 | +24 VDC | Input (field supply) |
| 2 | 0 VDC | Input (field return) |
| 9 | TxD (RS232) | Output |
| 10 | RxD (RS232) | Input |
| 11 | GND | Signal ground |
| 12 | Shield / FE | Functional Earth |
5. Wiring and Pinouts for RS232 and RS485
5.1 RS232 DB9 Standard Pinout (Male Connector, DTE Side)
| Pin | Signal | Abbreviation | Direction (DTE) |
|---|---|---|---|
| 1 | Data Carrier Detect | DCD | Input |
| 2 | Received Data | RXD | Input |
| 3 | Transmitted Data | TXD | Output |
| 4 | Data Terminal Ready | DTR | Output |
| 5 | Signal Ground | GND | — |
| 6 | Data Set Ready | DSR | Input |
| 7 | Request To Send | RTS | Output |
| 8 | Clear To Send | CTS | Input |
| 9 | Ring Indicator | RI | Input |
5.2 RS232 Wiring: Straight-Through vs Null-Modem
Straight-through cable (PC/PLC to modem/peripheral):
DTE (PLC) DCE (Device)
Pin 3 (TXD) → Pin 2 (RXD)
Pin 2 (RXD) ← Pin 3 (TXD)
Pin 5 (GND) — Pin 5 (GND)
Null-modem cable (PLC to PLC, or PLC to PC configured as DTE):
Device A Device B
Pin 3 (TXD) → Pin 2 (RXD) (crossed)
Pin 2 (RXD) ← Pin 3 (TXD) (crossed)
Pin 5 (GND) — Pin 5 (GND) (straight)
Pin 7 (RTS) → Pin 8 (CTS) (crossed)
Pin 8 (CTS) ← Pin 7 (RTS) (crossed)
5.3 RS485 Wiring
RS485 uses differential signaling (A/B or +/−) and supports multi-drop (up to 32 devices on a single bus):
120Ω
Master ──── A ───────────────── A ──── Slave 1
│ │
└──── B ───────────────── B ─┘
│ │
GND GND
120Ω (at far end)
RS485 connection rules:
- Use twisted pair cable (e.g., 1 pair of Cat5e or dedicated RS485 cable)
- 120 Ω termination resistors at both ends of the bus
- Common ground connection recommended but keep ground currents minimized
- Maximum cable length depends on baud rate (EIA-485 standard, twisted-pair cable, 120 Ω termination):
- 115.2 kbit/s → max ~200 m (conservative: 100 m in noisy environments)
- 19.2 kbit/s → max ~1000 m
- 9600 baud → max ~1200 m
5.4 B&R X20 Terminal Block Serial Wiring
For X20CP1584 and similar CPUs using X20TB12:
- TxD connects to terminal 9
- RxD connects to terminal 10
- GND connects to terminal 11
- Shield connects to terminal 12 (FE)
Use shielded twisted pair cable (LiYCY 3×2×0.14 mm²). Bond shield to FE at the cabinet entry only — do not ground both ends.
5.5 RJ45 to DB9 RS232 Adapter (Common for B&R Field Wiring)
Some B&R installations use RJ45 connectors for serial field wiring. A common mapping:
| RJ45 Pin | DB9 Pin | Signal |
|---|---|---|
| 1 | 8 (CTS) | Clear To Send |
| 2 | 6 (DSR) | Data Set Ready |
| 3 | 2 (RXD) | Receive Data |
| 4 | 20 (DTR) | Data Terminal Ready |
| 5 | 3 (TXD) | Transmit Data |
| 6 | 5 (GND) | Signal Ground |
| 7 | 7 (RTS) | Request To Send |
| 8 | 4 (DTR) | Data Terminal Ready |
Note: RJ45-to-serial pinout varies by manufacturer. Always verify with a multimeter before connecting.
6. Baud Rate, Parity, and Stop Bit Configuration
6.1 Standard Configuration Parameters
| Parameter | Standard Values | Common Industrial Setting |
|---|---|---|
| Baud rate | 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 | 9600 (most common), 19200, 38400 |
| Data bits | 7, 8 | 8 |
| Parity | None, Even, Odd, Mark, Space | None or Even |
| Stop bits | 1, 2 | 1 (or 2 with parity=Even at 9600 → “9600-8-E-1”) |
6.2 Common Configurations
| Notation | Baud | Data | Parity | Stop | Use Case |
|---|---|---|---|---|---|
| 9600-8-N-1 | 9600 | 8 | None | 1 | Most common default; Modbus RTU, generic sensors |
| 19200-8-N-1 | 19200 | 8 | None | 1 | Faster sensors, HMIs |
| 9600-8-E-1 | 9600 | 8 | Even | 1 | Modbus RTU with error detection |
| 9600-7-E-1 | 9600 | 7 | Even | 1 | Legacy serial devices |
| 115200-8-N-1 | 115200 | 8 | None | 1 | High-speed serial, programming ports |
6.3 Configuring in B&R Automation Studio
In the IO Configuration view, set the serial port properties:
| Parameter | Automation Studio Setting |
|---|---|
| Device name | IF1, CS1020_IF1, etc. |
| Baud rate | Integer (9600, 19200, etc.) |
| Data bits | 8 (or 7) |
| Parity | dvPARITY_NONE, dvPARITY_EVEN, dvPARITY_ODD |
| Stop bits | 1 (or 2) |
| Handshake | dvHANDSHAKE_NONE, dvHANDSHAKE_RTSCTS |
In code (DV_Frame):
openInfo.baudrate := 9600;
openInfo.dataBits := 8;
openInfo.parity := dvPARITY_EVEN;
openInfo.stopBits := 1;
openInfo.handshake := dvHANDSHAKE_NONE;
In code (DRV_mbus for Modbus RTU):
openInfo.baudrate := 9600;
openInfo.parity := dvPARITY_EVEN; (* Modbus RTU commonly uses Even parity *)
6.4 Maximum Baud Rates by B&R Hardware
| Hardware | Max Baud Rate |
|---|---|
| X20CP1584 IF1 (RS232) | 115.2 kbit/s |
| X20CS1020 | 115.2 kbit/s |
| X20IF1030 (RS232) | 115.2 kbit/s |
| IF622, IF671 | 115.2 kbit/s |
| System 2003 CP modules | 115.2 kbit/s |
7. Flow Control and Handshake Issues
7.1 Types of Flow Control
| Type | Method | Use Case |
|---|---|---|
| None | No flow control | Most industrial devices, short cables, well-matched speeds |
| Hardware (RTS/CTS) | PLC asserts RTS when ready to receive; device asserts CTS when ready | High-speed links, large data transfers, printers |
| Software (XON/XOFF) | Embedded control characters (0x11/0x13) in data stream | Legacy systems, avoid in binary protocols |
| DSR/DTR | Peripheral signals ready state | Modems, some legacy equipment |
7.2 Common Handshake Problems
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| RTS/CTS not connected | Partial data, truncated frames | Missing handshake lines in cable | Add RTS/CTS wires or disable handshake |
| CTS held low | No data transmitted | Device not asserting CTS | Check device ready state, disable RTS/CTS |
| RTS/CTS polarity mismatch | Data flow stops | Some devices use inverted RTS/CTS | Use null-modem adapter with crossed handshake lines |
| XON/XOFF in binary data | Communication corruption | Binary data contains 0x11/0x13 bytes | Disable XON/XOFF; use hardware handshake or none |
7.3 B&R-Specific Flow Control Notes
- X20BB52 base module exposes RTS and CTS on the PS9600 terminal block (check exact pin assignment in datasheet)
- X20CS1020 supports RTS/CTS and XON/XOFF in RS232 mode
- For Modbus RTU over RS485, flow control is typically None — the protocol handles framing via 3.5 character silent intervals
- When using DV_Frame with
dvHANDSHAKE_RTSCTS, the library manages RTS automatically
8. B&R Software Libraries for Serial Communication
8.1 DV_Frame Library
The DV_Frame library is the primary general-purpose serial communication library for B&R controllers. It provides raw frame-level access to serial ports.
Key Functions:
| Function | Purpose |
|---|---|
DV_FrameOpen | Open serial port with configuration (baud, parity, data bits, stop bits, handshake) |
DV_FrameWrite | Write raw bytes to serial port |
DV_FrameRead | Read bytes with configurable terminators (CRLF, timeout, length) |
DV_FrameClose | Close serial port and release handle |
DV_FrameIoctl | Ioctl-level control (line status, buffer flush, break signal) |
Modes:
dvFRAME_MODE_RAW— raw byte I/O, no protocol framing- Terminator options:
dvFRAME_TERMINATOR_CRLF,dvFRAME_TERMINATOR_LF, custom delimiter
Example — Opening a Serial Port:
VAR
fbFrame : DV_FrameOpen_Type;
openInfo : DV_FrameOpen_Info_Type;
rxBuffer : ARRAY[0..63] OF USINT;
rxLen : UDINT;
handle : UDINT;
END_VAR
openInfo.deviceName := 'IF1';
openInfo.mode := dvFRAME_MODE_RAW;
openInfo.baudrate := 9600;
openInfo.dataBits := 8;
openInfo.parity := dvPARITY_NONE;
openInfo.stopBits := 1;
openInfo.handshake := dvHANDSHAKE_NONE;
openInfo.rxBufferSize := SIZEOF(rxBuffer);
openInfo.rxBuffer := ADR(rxBuffer);
DV_FrameOpen(fbFrame, openInfo);
IF fbFrame.status = 0 THEN
handle := fbFrame.handle;
END_IF
Example — Sending a Query:
VAR
fbWrite : DV_FrameWrite_Type;
query : USINT := 16#52; (* 'R' = ASCII 0x52 *)
END_VAR
DV_FrameWrite(fbWrite, handle, ADR(query), 1);
Example — Reading a CRLF-Terminated Response:
VAR
fbRead : DV_FrameRead_Type;
END_VAR
DV_FrameRead(fbRead, handle, ADR(rxBuffer), SIZEOF(rxBuffer), rxLen,
dvFRAME_TERMINATOR_CRLF);
IF fbRead.status = 0 THEN
(* rxBuffer[0..rxLen-1] contains the response *)
END_IF
8.2 DRV_mbus Library (Modbus RTU)
The DRV_mbus library provides Modbus RTU master and slave functionality with automatic CRC-16 handling.
Key Functions:
| Function | Purpose |
|---|---|
DRV_mbusOpen | Open Modbus RTU channel (master or slave mode) |
DRV_mbusReadReg | Read holding registers (FC03) or input registers (FC04) |
DRV_mbusWriteReg | Write single register (FC06) or multiple registers (FC16) |
DRV_mbusClose | Close Modbus channel |
Example — Modbus RTU Master:
VAR
fbMbus : DRV_mbusOpen_Type;
fbRead : DRV_mbusReadReg_Type;
openInfo : DRV_mbusOpen_Info_Type;
regValue : UINT;
END_VAR
openInfo.deviceName := 'IF1';
openInfo.mode := dvMBUS_MODE_RTU_MASTER;
openInfo.baudrate := 9600;
openInfo.parity := dvPARITY_EVEN;
openInfo.timeout := 500; (* ms *)
DRV_mbusOpen(fbMbus, openInfo);
IF fbMbus.status = 0 THEN
DRV_mbusReadReg(fbRead, fbMbus.handle,
slaveAddr := 1,
funcCode := dvMBUS_FC04_INPUT,
regAddr := 16#0001,
regQty := 1,
pData := ADR(regValue),
dataLen := SIZEOF(regValue));
END_IF
8.3 Choosing Between DV_Frame and DRV_mbus
| Criterion | Use DV_Frame | Use DRV_mbus |
|---|---|---|
| Protocol | Custom/proprietary, ASCII, binary | Modbus RTU |
| CRC handling | Manual | Automatic |
| Frame delimiters | Configurable | 3.5 char silent interval |
| Complexity | Higher (you build the protocol) | Lower (function call API) |
9. How to Sniff Serial Traffic Between PLC and Serial-Connected Devices
9.1 Why Sniff Serial Traffic?
- Determine unknown protocol parameters (baud rate, parity, framing)
- Capture request/response patterns for reverse engineering
- Debug intermittent communication failures
- Verify PLC program behavior against expected protocol
- Identify timing issues, bus contention, or signal integrity problems
9.2 Methods for Sniffing
Method 1: Hardware Tap (Non-Intrusive — RS232 Only)
For RS232 point-to-point connections, insert a Y-cable or hardware tap between the PLC and the device:
PLC TXD ────────────────────── Device RXD
│
└──── Sniffer RXD
PLC RXD ────────────────────── Device TXD
│
└──── Sniffer TXD
Hardware needed:
- Passive RS232 monitor Y-cable (3-plug DB9)
- Or build one: connect sniffer’s RXD to both TXD lines (with diodes for isolation)
Limitations: RS232 only (voltage levels must be compatible). Cannot easily tap RS485 mid-bus without disturbing differential signaling.
Method 2: RS485 Tap (Intrusive but Low-Impact)
For RS485 multi-drop buses:
- Connect the sniffer as an additional node on the bus with a high-impedance RS485 transceiver
- The sniffer listens only (never transmits) to avoid disturbing bus traffic
- Ensure proper 120 Ω termination is maintained
Method 3: Oscilloscope / Logic Analyzer (Non-Intrusive)
Connect probes to the TXD/RXD (RS232) or A/B (RS485) lines. This is the best method because:
- No electrical loading of the bus
- Captures exact timing and signal integrity
- Can detect electrical noise, reflections, and voltage levels
- Works for both RS232 and RS485
Method 4: Software Sniffer (Windows PC)
If the serial traffic passes through a PC (e.g., USB-to-serial adapter):
- Install a serial port monitor driver that intercepts IOCTL calls
- Tools: HHD Serial Port Monitor, COM Sniffer, Serial Port Monitor (eltima)
- These capture all read/write operations at the driver level
- Non-intrusive to the application but requires the traffic to pass through the monitored PC
9.3 Sniffing B&R PLC Serial Traffic
B&R PLCs run their own real-time OS, so software-based sniffing directly on the PLC is not possible with standard tools. To sniff traffic from a B&R controller:
- Hardware approach (recommended): Use a logic analyzer or oscilloscope on the serial lines
- Y-cable approach (RS232): Insert a passive tap between PLC and device, connect to a PC running serial terminal software
- B&R diagnostic approach: Add logging in the PLC program using DV_Frame to echo both TX and RX data to a second serial port or to Ethernet
- Modbus diagnostic: Use DRV_mbus built-in error counters to track CRC errors, timeouts, and exception codes
10. Tools for Serial Sniffing
10.1 Software Tools
| Tool | Platform | Key Features | Best For |
|---|---|---|---|
| HHD Serial Port Monitor | Windows | Non-intrusive driver-level sniffing, multiple view modes (table, dump, terminal), Modbus RTU/ASCII decoding, session recording | General RS232/RS485 debugging on PC |
| Serial Port Monitor (eltima) | Windows | COM port interception, data filtering, IRP/IOCTL tracking, Modbus RTU decode | Deep protocol analysis on Windows |
| COM Sniffer | Windows | Logs data, IOCTLs, and signals; works on ports already in use | Monitoring already-open COM ports |
| SerialTool | macOS/Linux/Windows | COM sniffer with multi-platform support, data logging | Cross-platform serial monitoring |
| Free Serial Analyzer | Windows | Non-intrusive RS232/RS422/RS485 packet sniffer | Budget option |
| PuTTY / TeraTerm | Windows/Linux | Terminal emulation for raw serial monitoring | Simple connect-and-observe |
| RealTerm | Windows | Serial terminal with hex display, logging, macro scripting | Binary protocol debugging |
10.2 Hardware Tools
| Tool | Key Features | Best For |
|---|---|---|
| Saleae Logic / Logic 2 | 8–16 channel digital logic analyzer with async serial protocol decode, Modbus RTU analyzer, export to CSV | Timing analysis, protocol decode, baud rate verification |
| Sigrok / PulseView | Open-source logic analyzer software supporting many hardware probes | Budget logic analysis, open-source workflow |
| PicoScope | Oscilloscope with serial protocol decoding (RS232, RS485, Modbus, CAN) | Signal integrity + protocol decode in one tool |
| Bus Pirate | Multi-protocol tool supporting UART, SPI, I2C, raw binary; can sniff and inject | Reverse engineering, protocol exploration |
| RS232 / RS485 breakout box | Inline connector with LEDs for TXD/RXD/CTS/RTS status | Quick visual verification of signal activity |
| USB-to-Serial adapter + software sniffer | FTDI/CH340 adapter to capture traffic on PC | Software-level monitoring when traffic routes through PC |
10.3 Saleae Logic Analyzer for Serial Protocol Decode
Saleae Logic analyzers (Logic 4, Logic 8, Logic Pro 8/16) can read and decode RS232, RS485, and RS422 signals up to ±25V:
Setup steps:
- Connect ground probe to circuit ground
- Connect channel probes to TXD and RXD (RS232) or A and B (RS485 differential pair)
- For RS232: Use the “Async Serial” analyzer with correct baud rate, parity, stop bits
- For RS485: May require RS485-to-TTL receiver chip to convert differential to logic levels
- Set up “Modbus RTU” analyzer on top of the async serial decode for Modbus devices
What you get:
- Decoded hex/ASCII data in real time
- Timing measurements between frames
- Protocol-level decode (Modbus function codes, register addresses, CRC)
- Export to CSV, JSON, or screenshot for documentation
11. How to Decode Serial Data
11.1 Step-by-Step Decode Process
Step 1: Capture Raw Data
Use a logic analyzer or serial sniffer to capture the raw bitstream. Record:
- All bytes in hex format
- Timestamps between bytes
- Direction (TX vs RX)
Step 2: Determine Baud Rate
If baud rate is unknown:
- Measure bit duration with oscilloscope: Connect to TXD line, trigger on falling edge, measure one bit width. Baud rate = 1 / bit_width_seconds.
- Common baud rates to try: 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
- Auto-detect approach: Set logic analyzer to each common baud rate and see which produces valid ASCII or consistent framing
- Bit-width reference table:
| Baud Rate | Bit Duration (μs) | Character Time (10 bits) |
|---|---|---|
| 300 | 3333 μs | 33.3 ms |
| 1200 | 833 μs | 8.33 ms |
| 2400 | 417 μs | 4.17 ms |
| 4800 | 208 μs | 2.08 ms |
| 9600 | 104 μs | 1.04 ms |
| 19200 | 52 μs | 0.52 ms |
| 38400 | 26 μs | 0.26 ms |
| 57600 | 17.4 μs | 0.174 ms |
| 115200 | 8.68 μs | 0.087 ms |
Step 3: Determine Frame Format
Standard UART frame: [Start bit (0)] [5-9 data bits] [Parity bit (optional)] [1-2 Stop bits (1)]
If the data looks garbled, try:
- 8-N-1 (most likely)
- 8-E-1 (common for Modbus RTU)
- 7-E-1 (legacy devices)
- 8-O-1, 7-N-2
Step 4: Identify Protocol Type
| Indicators | Protocol Type |
|---|---|
| Readable ASCII text (letters, numbers, CR, LF) | ASCII/text protocol |
| Hex bytes with fixed-length blocks and checksum | Binary protocol |
Byte patterns: [addr][FC][data][CRC_lo][CRC_hi] | Modbus RTU |
| Fixed header + length byte + payload + checksum | Custom binary protocol |
<STX>...<ETX><LRC> | Start/stop delimited protocol |
$GP...*CS<CR><LF> | NMEA 0183 (GPS, marine) |
Step 5: Analyze Message Structure
For each captured message:
- Identify the master request (PLC sends) and slave response (device replies)
- Look for fixed patterns in the first few bytes (address, command)
- Look for repeating structures in the data payload
- Look for the last 1-2 bytes — often a checksum (CRC-16, LRC, sum)
- Note timing between request and response
Step 6: Verify Checksums
Common checksum algorithms:
- CRC-16 (Modbus): Polynomial 0x8005, init 0xFFFF — used in Modbus RTU
- LRC (Longitudinal Redundancy Check): XOR of all bytes — used in Modbus ASCII
- Sum checksum: Add all bytes, take lower byte
- CRC-CCITT (0x1021): Used in various industrial protocols
Use an online CRC calculator or embedded code to verify.
11.2 Example: Decoding a Custom ASCII Protocol
Captured hex dump (PLC → Sensor):
52 0D 0A
Decoded: R\r\n (ASCII “R” + CRLF) — this is a read request.
Captured hex dump (Sensor → PLC):
2B 32 33 2E 34 35 20 43 0D 0A
Decoded: +23.45 C\r\n — temperature reading in ASCII.
11.3 Example: Decoding a Binary Protocol
Captured hex dump (PLC → Device):
01 03 00 00 00 0A C5 CD
Decoded as Modbus RTU:
01= Slave address (1)03= Function code (Read Holding Registers)00 00= Starting register address (0x0000)00 0A= Quantity of registers (10)C5 CD= CRC-16 (Modbus)
12. Protocol Analysis: MODBUS RTU Over Serial
12.1 Modbus RTU Frame Structure
┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐
│ Address │ Function │ Data │ Data │ CRC Low │ CRC High │
│ (1 byte) │ (1 byte) │ (N bytes)│ (N bytes)│ (1 byte) │ (1 byte) │
└──────────┴──────────┴──────────┴──────────┴──────────┴──────────┘
- Address: Slave device address (1–247)
- Function code: Operation type (01–06, 15–16 most common)
- Data: Register address, quantity, write values
- CRC-16: CRC-16/Modbus (polynomial 0x8005, initial value 0xFFFF)
12.2 Common Function Codes
| FC | Name | Direction | Data Bytes |
|---|---|---|---|
| 01 | Read Coils | Master → Slave → Master | Addr (2) + Qty (2) → Coil status (N) |
| 02 | Read Discrete Inputs | Master → Slave → Master | Addr (2) + Qty (2) → Input status (N) |
| 03 | Read Holding Registers | Master → Slave → Master | Addr (2) + Qty (2) → Register values (2×N) |
| 04 | Read Input Registers | Master → Slave → Master | Addr (2) + Qty (2) → Input register values (2×N) |
| 05 | Write Single Coil | Master → Slave → Master | Addr (2) + Value (2) |
| 06 | Write Single Register | Master → Slave → Master | Addr (2) + Value (2) |
| 15 | Write Multiple Coils | Master → Slave → Master | Addr (2) + Qty (2) + Outputs (N) |
| 16 | Write Multiple Registers | Master → Slave → Master | Addr (2) + Qty (2) + Values (2×N) |
12.3 Modbus RTU Timing
The end of a Modbus RTU frame is defined by a 3.5 character silent interval on the bus:
| Baud Rate | 3.5 Char Time |
|---|---|
| 9600 (11 bits/char) | ~4.0 ms |
| 19200 (11 bits/char) | ~2.0 ms |
| 38400 (11 bits/char) | ~1.0 ms |
| 115200 (11 bits/char) | ~0.3 ms |
The inter-frame delay must be at least this long. The inter-character delay must be less than 1.5 character times or the frame is considered incomplete.
12.4 Modbus Exception Response
If a slave cannot process a request, it returns an exception response:
┌──────────┬──────────┬──────────┬──────────┬──────────┐
│ Address │ FC + 0x80│Exception │ CRC Low │ CRC High │
│ (1 byte) │ (1 byte) │ Code │ (1 byte) │ (1 byte) │
└──────────┴──────────┴──────────┴──────────┴──────────┘
Common exception codes:
| Code | Meaning |
|---|---|
| 01 | Illegal Function |
| 02 | Illegal Data Address |
| 03 | Illegal Data Value |
| 04 | Server Device Failure |
12.5 Analyzing Modbus RTU with B&R DRV_mbus
When using DRV_mbus, the library handles CRC and framing automatically. To debug:
- Monitor
fbRead.statusafter eachDRV_mbusReadRegcall - Check for CRC errors:
dvMBUS_ERR_CRCindicates electrical noise or baud rate mismatch - Check for timeouts:
dvMBUS_ERR_TIMEOUTmeans the slave didn’t respond - Check for exception codes: Non-zero slave response with error code indicates addressing or register problems
- Log all reads/writes: Echo the request parameters and responses to a log file or HMI for pattern analysis
12.6 Tools for Modbus RTU Analysis
| Tool | Type | Capabilities |
|---|---|---|
| QModMaster | Free Windows GUI | Modbus RTU master/slave simulator, register read/write |
| PicoScope + Modbus decode | Oscilloscope | Physical-layer decode with timing analysis |
| Saleae Logic 2 + Modbus RTU analyzer | Logic analyzer | Protocol-level decode with function code parsing |
| HHD Serial Port Monitor | Software sniffer | Driver-level capture with Modbus RTU decoding overlay |
| CAS Modbus Scanner | Free scanner | Scans slave addresses and registers on a serial bus |
Python pyModbus | Scripting | Programmatic Modbus RTU scanning and testing |
13. Protocol Analysis: Custom ASCII and Binary Protocols
13.1 ASCII Protocols
Many industrial sensors use simple ASCII request/response patterns:
Pattern 1: Command-Response (read request)
PLC sends: "R\r\n" (request reading)
Device: "+23.45 C\r\n" (response with value)
Pattern 2: Addressed Multi-Drop
PLC sends: "$01RD\r\n" (address 01, read command)
Device 01: "!01+23.45\r\n" (addressed response)
Pattern 3: Set-Command
PLC sends: "SET 100\r\n" (set value to 100)
Device: "OK\r\n" (acknowledgment)
Analysis approach for ASCII:
- Capture traffic and view as ASCII text
- Identify request vs response by direction
- Look for delimiters (CR, LF, CRLF, semicolon, comma)
- Identify data format (decimal, hex, scientific notation)
- Map command set by observing different PLC operations
13.2 Binary Protocols
Binary protocols use structured byte sequences with headers, addresses, commands, data, and checksums:
Typical structure:
┌───────┬───────┬───────┬───────┬───────┬──────────┐
│ STX │ ADDR │ CMD │ LEN │ DATA │ CHECKSUM │
│ 0x02 │ (1B) │ (1B) │ (1B) │ (nB) │ (1-2B) │
└───────┴───────┴───────┴───────┴───────┴──────────┘
Analysis approach for binary:
- Capture multiple transactions and align them by frame boundaries
- Look for fixed byte values in position 0 (start marker: 0x02, 0xAA, 0x55)
- Look for the length field — count data bytes to confirm
- Verify the checksum against candidate algorithms
- Correlate known values (e.g., if you know a sensor reads 25.3°C, find 0x0199 or 0x9919 in the data)
- Determine byte order (big-endian vs little-endian) by comparing known values
13.3 Mixed Protocols
Some devices use a mix of ASCII commands and binary data (e.g., text headers with binary payloads). Look for transitions between printable and non-printable byte ranges.
14. Reconfiguring or Replacing Serial Connections When Specs Are Unknown
14.1 Systematic Approach to Unknown Serial Connections
When you inherit a system with undocumented serial connections:
Phase 1: Physical Investigation
- Identify the hardware: Locate the serial module (IF1, CS1020, IF622, etc.)
- Trace the wiring: Follow cables from the PLC serial port to the connected device
- Identify the connector type: DB9, terminal block, RJ45
- Note the cable type: Shielded/unshielded, twisted pair count
- Check for RS485 termination: Look for 120 Ω resistors on the bus ends
Phase 2: Capture Traffic
- Use a logic analyzer to capture raw serial data
- Determine baud rate by measuring bit width (see Section 11)
- Determine frame format (8-N-1, 8-E-1, etc.)
- Save hex dumps of multiple request/response cycles
Phase 3: Protocol Identification
- Check if the traffic matches Modbus RTU (address + FC + data + CRC pattern)
- Check for ASCII patterns (readable text, CR/LF delimiters)
- Check for known vendor protocols (Mitsubishi MC Protocol, Siemens S7, Omron Host Link, Allen-Bradley DF1)
- Search online for the connected device’s protocol documentation
Phase 4: Replication
- Once the protocol is understood, implement it in B&R using DV_Frame (custom) or DRV_mbus (Modbus)
- Test with the captured device to verify matching behavior
- Document the protocol for future maintenance
14.2 Common Vendor Serial Protocols Found in B&R Installations
| Protocol | Vendor | Detection Pattern |
|---|---|---|
| Modbus RTU | Many vendors | [addr][FC 01-16][data][CRC-16] |
| Modbus ASCII | Many vendors | Colon start :, LRC end, CRLF |
| DF1 | Rockwell/Allen-Bradley | ACK 0x06, NAK 0x15, DLE 0x10 escape |
| MC Protocol | Mitsubishi | [ENQ][station][PC][command][data][SUM] |
| Host Link | Omron | @xx[cmd][data][FCS]*\r\n |
| S7-200 PPI | Siemens | Start 0x10, dest/src address, function, CRC |
| CompoWay/F | Omron | [STX 0x02][station][SID][data][ETX 0x03][FCS] |
14.3 Practical Tips for Unknown Protocol Reverse Engineering
- Start with the defaults: Try 9600-8-N-1 first (covers ~80% of industrial devices)
- Leverage the device manual: Even partial documentation helps identify the protocol family
- Correlate with known I/O: If you know what the PLC is controlling (e.g., a drive speed), look for that value in the captured data
- Use pattern matching: Many binary protocols use fixed headers or sync bytes (0x55AA, 0x0243, etc.)
- Test with a Bus Pirate: Send known bytes and observe the device response to build a command set
- Check B&R source code: If you have the Automation Studio project, search for DV_Frame or DRV_mbus calls to understand the current implementation
14.4 Migrating from Serial to Ethernet
When replacing a serial connection:
- Keep the serial link operational during migration
- Install serial-to-Ethernet converters (see Section 15)
- Configure the converter for the exact serial parameters (baud, parity, etc.)
- Test Ethernet-side connectivity before cutting over
- Update the B&R PLC program to use TCP/UDP or Modbus TCP instead of serial
15. Serial-to-Ethernet Conversion Options
15.1 Why Convert Serial to Ethernet?
- Extend serial device reach beyond 1200 m (RS485) or 15 m (RS232)
- Centralize serial devices on an Ethernet network for SCADA/PC access
- Replace aging serial infrastructure while keeping legacy devices
- Enable remote monitoring of serial traffic over IP
- Add redundancy and easier troubleshooting via network tools
15.2 Serial-to-Ethernet Device Servers
Moxa NPort Series (Industry Standard)
| Model | Ports | Serial Types | Features |
|---|---|---|---|
| NPort 5110 | 1 | RS232 | Basic, cost-effective |
| NPort 5150 | 1 | RS232/422/485 selectable | Software selectable |
| NPort 5210 | 2 | RS232/422/485 | Multi-port |
| NPort 5250 | 2 | RS232/422/485 | Industrial-grade |
| NPort 6110 | 1 | RS232 | Basic |
| NPort 6250 | 2 | RS232/422/485 | Advanced |
| NPort DE-211 | 1 | RS232/422/485 | Compact |
Operating modes:
- Virtual COM mode: Presents serial ports as virtual COM ports on a remote PC — transparent to existing software
- TCP Server mode: Device server listens for TCP connections — PLC or PC initiates connection
- TCP Client mode: Device server initiates TCP connection to a specified IP:port
- UDP mode: Connectionless datagram mode for low-latency applications
- Pair connection: Two device servers form a transparent serial tunnel
Other Manufacturers
| Manufacturer | Product Line | Notes |
|---|---|---|
| Lantronix | XPort, UDS1100 | Compact embedded solutions |
| Digi International | PortServer, ConnectPort | Wide range of port counts |
| Perle | IOLAN | Industrial-grade, DIN-rail mount |
| Silex Technology | SX-DS Series | Cost-effective alternatives |
| USR IOT | USR-TCP232 | Budget-friendly |
15.3 B&R-Specific Integration
B&R X20 controllers can communicate with serial-to-Ethernet converters using:
| Method | Library | Configuration |
|---|---|---|
| Modbus TCP → Modbus RTU conversion | NPort in “Modbus Gateway” mode | Configure NPort to translate Modbus TCP to Modbus RTU; PLC uses Modbus TCP library |
| TCP Socket (raw) | B&R Socket libraries (AsTCP, AsUDP) | B&R opens TCP connection to NPort in TCP Server mode; sends/receives raw serial data |
| Virtual COM (Windows) | DV_Frame via USB/COM port | If B&R Gateway PC is used, NPort creates virtual COM; PC software uses COM port |
15.4 Serial-to-Serial Conversion
When the PLC has the wrong serial type:
| Converter | Converts | Notes |
|---|---|---|
| RS232 → RS485 converter | Single-ended to differential | Enables RS485 multi-drop from RS232 port |
| RS485 → RS232 converter | Differential to single-ended | Isolates RS485 device from RS232 PLC |
| RS422 → RS232 converter | Differential to single-ended | For RS422 sensors |
| RS485 → Ethernet (Moxa) | Serial to IP | Full protocol conversion |
15.5 Configuration Considerations
When setting up serial-to-Ethernet converters:
- Match serial parameters exactly: Baud rate, parity, data bits, stop bits, flow control must match the device
- Set TCP timeouts: Configure idle timeout, connection retry, and reconnection behavior
- Latency: Add inter-character delay if the converter sends too fast for the serial device
- Buffering: Configure FIFO size for burst data
- Termination: If converting RS485, maintain proper 120 Ω bus termination
- Network redundancy: Use dual-NIC converters (e.g., Moxa NPort 6000 series) for redundant Ethernet
16. Common Serial Communication Failures and Debugging
16.1 Physical Layer Problems
| Failure | Symptoms | Cause | Debug Method |
|---|---|---|---|
| No signal on TXD | No response from device | Port not opened, wrong device name, hardware fault | Probe TXD with oscilloscope; check DV_FrameOpen status |
| Garbled data | Random/wrong characters | Baud rate mismatch, parity mismatch | Try all common baud rates; check parity settings |
| Intermittent failures | Communication works sometimes | Loose connector, noise, ground loop, cable too long | Reseat connectors; add ferrite chokes; check shielding |
| No signal on RXD | Device sends but PLC doesn’t receive | RXD/TXD swapped, cable fault, wrong pinout | Verify pin-to-pin mapping; swap TXD/RXD; test with null-modem |
| Signal reflection / corruption | Errors increase with cable length | Missing termination resistors on RS485 | Add 120 Ω resistors at both ends of RS485 bus |
| Ground loop | Erratic behavior, equipment resets | Shield grounded at both ends | Ground shield at one end only; use isolated serial modules |
16.2 Protocol Layer Problems
| Failure | Symptoms | Cause | Debug Method |
|---|---|---|---|
| Timeout errors | dvFRAME_ERR_TIMEOUT or dvMBUS_ERR_TIMEOUT | Device not responding, wrong slave address, wiring fault | Verify device power; check slave address; probe bus activity |
| CRC errors | dvMBUS_ERR_CRC | Parity mismatch, electrical noise, baud rate error | Set correct parity; add termination; reduce cable length |
| Framing errors | Wrong byte values | Baud rate close but not exact (e.g., 4800 vs 9600) | Verify baud rate precisely with oscilloscope |
| Buffer overrun | dvFRAME_ERR_OVERRUN | PLC not reading fast enough, high baud rate | Increase read frequency; lower baud rate; increase buffer size |
| Wrong register values | Device responds but data is wrong | Incorrect register address, wrong data type, byte order | Verify register map; check big/little endian interpretation |
16.3 Configuration Problems
| Failure | Symptoms | Cause | Fix |
|---|---|---|---|
| Port won’t open | DV_FrameOpen returns error | Port already in use by another task | Check for duplicate open calls; close unused ports |
| Wrong device name | Cannot open serial port | Incorrect device name string | Verify name in IO configuration: IF1, CS1020_IF1 |
| PS9600 red overload LED | Segment power fault | Overvoltage, short circuit, second PS module | Check 24 V supply; inspect for shorts; remove duplicate PS |
| Second serial port not working | Only one port active | Added second PS9600 instead of CS1020 | Replace second PS9600 with X20CS1020 |
| Flow control mismatch | Partial data transfer | RTS/CTS enabled on one side only | Set flow control to None on both sides, or wire all handshake lines |
16.4 Environmental Problems
| Problem | Impact | Mitigation |
|---|---|---|
| EMI/RFI interference | Corrupted frames, CRC errors | Use shielded cable; route away from VFDs and motors; add ferrite chokes |
| Temperature extremes | Intermittent failures, connector corrosion | Use industrial-rated connectors; proper cabinet ventilation |
| Vibration | Loose connections, intermittent open circuits | Use screw terminals with lock-washers; avoid relying on friction-fit connectors |
| Moisture | Short circuits, corrosion | Use IP-rated enclosures; sealed connectors; desiccant in cabinet |
17. Troubleshooting Matrices
17.1 Quick Diagnostic Flowchart
Serial Communication Failure
│
├─ No data at all?
│ ├─ Probe TXD with oscilloscope → No signal?
│ │ ├─ Check DV_FrameOpen / DRV_mbusOpen status
│ │ ├─ Verify device name (IF1 vs CS1020_IF1)
│ │ └─ Check if port is already open by another task
│ │
│ └─ TXD active but no response?
│ ├─ Verify RXD wiring (swap TXD/RXD)
│ ├─ Check device power
│ ├─ Verify slave address (Modbus)
│ └─ Check signal ground connection
│
├─ Garbled/wrong data?
│ ├─ Try 9600-8-N-1 (most common)
│ ├─ Try 9600-8-E-1 (Modbus RTU)
│ ├─ Try 19200-8-N-1
│ ├─ Measure bit width with oscilloscope for exact baud rate
│ └─ Check parity on both sides
│
├─ Intermittent failures?
│ ├─ Check RS485 termination (120 Ω at both ends)
│ ├─ Check for ground loops (shield grounded at both ends)
│ ├─ Inspect connectors for looseness
│ ├─ Measure cable length vs baud rate limits
│ └─ Check for EMI sources near cable run
│
└─ CRC / framing errors?
├─ Verify parity matches on both sides
├─ Reduce baud rate
├─ Replace cable with shielded twisted pair
├─ Add RS485 termination if missing
└─ Check for signal reflections with oscilloscope
17.2 B&R-Specific Troubleshooting Matrix
| Symptom | Likely Root Cause | Action |
|---|---|---|
| No characters on TxD (terminal 9) | DV_FrameOpen/DRV_mbusOpen never reached status 0 | Check function block status in watch window; verify IO config of COM port |
| Garbage characters | Baud rate / parity mismatch | Compare device DIP/settings with IO config; measure bit width |
dvFRAME_ERR_TIMEOUT | No response from device | Swap TXD/RXD; verify GND; check shield termination; verify device power |
dvFRAME_ERR_OVERRUN | Baud rate too high or noisy cable | Lower baud rate; use shielded twisted pair cable |
| DRV_mbus CRC error | Parity mismatch or electrical noise | Set parity to Even; add 120 Ω termination on RS485 legs |
| PS9600 red overload LED | Overvoltage or short on bus | Check 24 V supply; inspect terminals for shorts |
| Second PS9600 fitted | Bus conflict (one PS per segment) | Remove second PS9600; install X20CS1020 for additional serial |
| Intermittent communication | Ground loop from double-grounded shield | Ground shield at cabinet entry only |
17.3 Field Commissioning Checklist
| # | Step | Expected Result | Pass Criteria |
|---|---|---|---|
| 1 | Power segment with 24 VDC | PS green LED solid | No red overload LED |
| 2 | Measure +24 V on PS terminals | 23.5–28.0 VDC | Within input spec |
| 3 | Verify TxD idle voltage | -5 V to -12 V (RS232) | RS232 spec compliant |
| 4 | Send test byte; probe RxD at device | Correct byte on scope | Signal polarity matches |
| 5 | Trigger query; capture response on RxD | Expected data pattern visible | No framing errors |
| 6 | Run cyclic program | Values update correctly | Status = 0 in watch window |
| 7 | Run for 1 hour | No intermittent errors | Error counter remains 0 |
18. References and Further Reading
B&R Documentation
- B&R Automation Help Portal: https://help.br-automation.com — DV_Frame library reference, DRV_mbus library reference, X20 system manuals
- X20CP158x / X20CP358x Datasheet: Available from br-automation.com — IF1/IF2 interface specifications and pinouts
- X20 System User’s Manual: Comprehensive X20 hardware and configuration guide
- B&R Automation Studio Online Help: Integrated in IDE; covers IO configuration, serial port setup, library functions
- System 2005 User’s Manual: Covers IF260, IF622, IF671 interface modules
Serial Communication References
- TIA-232-F (RS-232) Standard: Official electrical specification
- TIA-485 (RS-485) Standard: Differential multi-point serial specification
- Modbus Protocol Specification: https://www.modbus.org — Free download of Modbus RTU/TCP specification
- Saleae Logic Analyzer Documentation: Protocol decode guides, async serial analyzer setup
- PicoScope Modbus Decoding Guide: https://www.picotech.com/library/knowledge-bases/oscilloscopes/modbus-serial-protocol-decoding
Tools and Software
- HHD Serial Port Monitor: https://hhdsoftware.com/serial-port-monitor
- Saleae Logic Analyzer: https://www.saleae.com
- COM Sniffer: https://comsniffer.com
- Moxa NPort Configuration Guide: https://www.moxa.com
- QModMaster (free Modbus tool): Available on SourceForge
- RealTerm (serial terminal): https://realterm.sourceforge.io
- PuTTY (terminal emulator): https://www.putty.org
Community Resources
- B&R Community Forum: https://community.br-automation.com — Search for serial communication topics
- PLCtalk.net: https://www.plctalk.net — Industrial automation forums with B&R discussions
- EEVblog Forum: https://www.eevblog.com/forum — Reverse engineering and protocol analysis discussions
- Stack Overflow / Electronics Stack Exchange: Serial protocol debugging Q&A
Cross-References
- io-sniffing.md – general IO traffic sniffing approaches
- physical-layer-sniffing.md – RS-485 physical layer probing
- cp1584-forensics.md – first-contact diagnostic procedures
- modbus-gateway.md – Modbus RTU communication (serial-based)
- config-file-formats.md – serial port configuration files
- diagnostic-workstation.md – serial tap hardware and RS-232/485 adapters
- plc-to-plc.md – inter-PLC serial communication discovery
- grounding-emc.md – serial cable shielding and EMC considerations
- program-reverse-engineering.md – understanding serial protocol implementations
Document covers B&R serial communication diagnostics for System 2003, System 2005, and X20 platforms. Compiled from B&R official documentation, community forums, and industrial automation reference materials.
Key Findings
- B&R serial interfaces (IF1030/IF1041/IF1051) are standard RS232/RS485 — any serial sniffer or protocol analyzer can capture the traffic. The challenge is decoding the application-layer protocol, not the physical layer.
- The RS232 interface (IF1) factory default is 57600 bps, not 115200 bps — always try 57600 first when connecting to an unknown PLC. The baud rate can be configured higher but the default must be assumed.
- Non-invasive serial tapping requires a Y-cable or tap adapter — never break the serial connection on a running machine. Use a 3-port RS232/RS485 tap that monitors traffic passively. See diagnostic-workstation.md for hardware recommendations.
- B&R has no proprietary serial protocol documentation for serial-connected devices — the protocol implementation is in the PLC program (which you don’t have). Reverse-engineer the protocol by capturing traffic and correlating with known device behavior.
- Serial baud rate auto-detection is feasible using statistical analysis — capture raw byte traffic at a high sample rate and use Python to identify the most likely baud rate by analyzing inter-byte timing patterns.
- Modbus RTU over RS485 is the most common serial protocol on B&R systems — if the OEM used Modbus RTU, standard Modbus tools can decode the traffic immediately. See modbus-gateway.md for details.