Modbus ASCII Protocol Guide (2026): Frame Structure, LRC & Testing
While Modbus RTU dominates high-speed RS-485 loops, Modbus ASCII remains widely deployed in legacy temperature controllers, Delta VFDs, analytical instrumentation, and telemetry modems where 7-bit serial framing and relaxed inter-character timing are required.
Unlike binary RTU frames that rely on silent 3.5-character gaps, Modbus ASCII frames are human-readable hex strings delimited by : and CR/LF. You can test both Master and Slave Modbus ASCII sessions directly on Windows 10/11 using ModbusSimulator (free 30-day trial).
1. Modbus ASCII Frame Anatomy (Wire Format)
Every binary byte in the Modbus PDU plus Slave Address is split into two ASCII characters (0–9, A–F). That doubles the wire length compared to RTU, but ensures every character falls within standard printable 7-bit ASCII.
| Field | Length | Example ASCII | Wire Bytes (Hex) |
|---|---|---|---|
| Start Delimiter | 1 char | : | 3A |
| Slave Address | 2 chars (1B) | 01 | 30 31 |
| Function Code | 2 chars (1B) | 03 | 30 33 |
| Data Payload | 2 × N chars | 00000002 | 30 30 30 30 30 30 30 32 |
| LRC Checksum | 2 chars (1B) | FA | 46 41 |
| End Delimiter | 2 chars | \r\n (CR LF) | 0D 0A |
Example full request to read 2 holding registers starting at 40001 (offset 0x0000) from Slave ID 1:
:010300000002FA\r\n
2. Calculating the LRC (Longitudinal Redundancy Check)
Modbus ASCII replaces RTU’s 16-bit CRC with an 8-bit LRC computed across the raw binary bytes (never the ASCII character codes), excluding : and CR/LF:
- Sum the raw bytes:
0x01 + 0x03 + 0x00 + 0x00 + 0x00 + 0x02 = 0x06. - Take modulo 256 (
0x06 & 0xFF = 0x06). - Compute two’s complement:
(256 - 6) = 250 = 0xFA. - Transmit ASCII
'F'(0x46) followed by'A'(0x41).
def modbus_ascii_lrc(payload: bytes) -> int:
total = sum(payload) & 0xFF
return (-total) & 0xFF
# Example: Slave 01, FC 03, Addr 0000, Qty 0002
frame_bytes = bytes.fromhex("010300000002")
lrc = modbus_ascii_lrc(frame_bytes)
print(f":{frame_bytes.hex().upper()}{lrc:02X}\\r\\n")
# Output: :010300000002FA\r\n
3. Serial Port Framing: 7-Bit vs 8-Bit Traps
The official Modbus Serial Line specification defines Modbus ASCII with 7 data bits (typically 7E1 — 7 data bits, Even parity, 1 stop bit; or 7N2 with 2 stop bits when no parity is used). By contrast, Modbus RTU requires 8 data bits (8E1 or 8N1).
- Why timeouts happen: Leaving a USB-to-RS485 adapter on
8N1while a legacy controller expects7E1corrupts the MSB parity bit on every ASCII byte, causing silent frame drops or UART framing errors. - Inter-character timing advantage: Modbus ASCII permits up to 1 second between characters within the same message, making it resilient over slow cellular modems, radio bridges, and software-buffered USB hubs.
Test Modbus ASCII, RTU & TCP in One Windows Simulator
Avoid flaky legacy freeware like ModRSsim2 and Radzio Modbus Simulator—inspect raw :...CR/LF frames and LRC checksums live in ModbusSimulator.
Frequently Asked Questions
What is the Modbus ASCII frame format?
Every frame begins with : (0x3A), encodes Slave ID, Function Code, Data, and LRC as pairs of uppercase hex ASCII characters, and terminates with CR + LF (0x0D 0x0A).
How is the Modbus ASCII LRC checksum calculated?
Add all binary message bytes (excluding : and CR/LF), mask to 8 bits, and take the two’s complement ((-sum) & 0xFF). Any mismatch causes the slave to discard the frame silently.
When should I choose Modbus ASCII over Modbus RTU?
Choose Modbus ASCII when integrating legacy 7-bit instruments or links with variable byte latency (radio/GPRS modems) where RTU’s strict 3.5t gap timer fails.
How can I simulate Modbus ASCII Master and Slave devices on Windows 10/11?
Download ModbusSimulator and select Modbus ASCII in Master or Modbus Slave Simulator mode—free for 30 days alongside Modbus TCP Simulator support.