Modbus ASCII Frame & LRC Calculator
Use this Modbus ASCII Frame & LRC Calculator to build complete Modbus ASCII requests, calculate the Longitudinal Redundancy Check (LRC), validate captured ASCII messages and decode slave address, function code, register or coil address, quantity, values and exception responses.
:, represents every binary byte as
two hexadecimal ASCII characters, places the one-byte LRC immediately before
the end, and terminates with carriage return + line feed
(CR LF).
-
-
What Is a Modbus ASCII Frame & LRC Calculator?
A Modbus ASCII Frame & LRC Calculator creates and validates the ASCII serial representation of a Modbus message. Unlike Modbus RTU, which sends message bytes directly in binary form, Modbus ASCII converts every message byte into two readable hexadecimal characters.
The mode also uses a one-byte Longitudinal Redundancy Check rather than the 16-bit CRC used by RTU. This makes captured messages relatively easy to inspect with a terminal or serial monitor.
The calculator builds common read and write requests, generates the correct LRC, shows the complete colon-delimited frame and can decode an existing ASCII message back into its binary Modbus fields.
Modbus ASCII Frame Format
The Modbus Serial Line specification defines a recognizable beginning and end for each ASCII message.
The frame starts with an ASCII colon character. Message bytes are represented using hexadecimal characters 0–9 and A–F. The normal frame terminator is the carriage-return / line-feed pair. :contentReference[oaicite:2]{index=2}
What Is the Modbus LRC?
LRC means Longitudinal Redundancy Check. In Modbus ASCII it provides the message-level error check.
The LRC occupies one binary byte, which is represented by two hexadecimal ASCII characters when inserted into the transmitted ASCII frame.
This behavior is explicitly defined by the Modbus Serial Line specification. :contentReference[oaicite:3]{index=3}
How to Calculate Modbus ASCII LRC
Include slave address, function code and all data bytes, but not the LRC itself.
Sum every byte in the message.
Keep only the least-significant eight bits of the sum.
Negate the 8-bit sum modulo 256 to produce the LRC.
Append those characters immediately before the ending CR/LF.
Modbus ASCII LRC Formula
This is the two’s-complement method described by the Modbus specification. :contentReference[oaicite:4]{index=4}
Modbus ASCII LRC Example
Consider a request to slave 1 using function 03 to read ten holding registers starting at protocol address zero.
Modbus ASCII vs Modbus RTU
| Feature | Modbus ASCII | Modbus RTU |
|---|---|---|
| Message representation | Hexadecimal ASCII characters | Binary bytes |
| Start marker | Colon : | Timing-based |
| End marker | CR LF | Silent interval |
| Error check | 8-bit LRC | 16-bit CRC |
| Characters per message byte | 2 ASCII hex characters | 1 binary byte |
| Human readability | Higher | Lower |
Because every binary byte becomes two ASCII hexadecimal characters, ASCII mode requires more transmitted characters than RTU for equivalent Modbus message content. :contentReference[oaicite:5]{index=5}
Modbus ASCII Function 03 Example
Supported Function Codes
| Hex | Function | Purpose |
|---|---|---|
| 01 | Read Coils | Read one or more coil states |
| 02 | Read Discrete Inputs | Read discrete input states |
| 03 | Read Holding Registers | Read 16-bit holding registers |
| 04 | Read Input Registers | Read 16-bit input registers |
| 05 | Write Single Coil | Write one coil |
| 06 | Write Single Register | Write one holding register |
| 0F | Write Multiple Coils | Write multiple packed coil states |
| 10 | Write Multiple Registers | Write multiple holding registers |
Function 06 Modbus ASCII Example
Suppose slave 1 writes value 3 into protocol register address 1.
Modbus ASCII Character Encoding
Each 8-bit Modbus message byte becomes two ASCII hexadecimal characters.
The LRC is calculated from the binary byte value 0x3A, not from the ASCII codes 0x33 and 0x41 used to transmit the textual representation.
Colon Start Character
A normal Modbus ASCII frame begins with the colon character:
Receivers monitor the serial stream for this character to identify the start of a new ASCII message. :contentReference[oaicite:6]{index=6}
CR LF End of Frame
The standard end-of-frame sequence is:
These terminator characters are not included in the LRC calculation. :contentReference[oaicite:7]{index=7}
How to Validate a Modbus ASCII LRC
When an existing frame is decoded, the calculator treats the final binary byte before CR/LF as the received LRC.
Modbus ASCII Exception Responses
Exception handling follows the normal Modbus application protocol principle. The server sets the high bit of the requested function code and follows it with an exception code.
Common Modbus Exception Codes
| Code | Meaning |
|---|---|
| 01 | Illegal Function |
| 02 | Illegal Data Address |
| 03 | Illegal Data Value |
| 04 | Server Device Failure |
| 05 | Acknowledge |
| 06 | Server Device Busy |
| 08 | Memory Parity Error |
| 0A | Gateway Path Unavailable |
| 0B | Gateway Target Device Failed to Respond |
Why Modbus ASCII Is Slower Than RTU
The application data represented by a single binary RTU byte requires two hexadecimal characters in ASCII mode.
Therefore ASCII mode consumes substantially more serial transmission time at the same line speed. :contentReference[oaicite:8]{index=8}
Modbus ASCII Maximum Frame Size
The Modbus Serial Line guide notes that each binary data byte requires two ASCII characters. To remain compatible with the maximum Modbus application data size, the ASCII data field may therefore contain up to twice the corresponding hexadecimal character count.
The guide specifies a maximum Modbus ASCII frame size of 513 characters. :contentReference[oaicite:9]{index=9}
LRC vs CRC
Modbus ASCII LRC
One-byte longitudinal redundancy check calculated using 8-bit addition and two’s complement.
Modbus RTU CRC
Two-byte cyclic redundancy check calculated using the Modbus CRC-16 algorithm.
They are not interchangeable. An RTU CRC should not be appended to an ASCII frame, and an ASCII LRC should not replace the RTU CRC.
Common Modbus ASCII Mistakes
Including Colon in LRC
The start colon is excluded from the LRC calculation.
Including CR/LF in LRC
The ending CR/LF pair is not included in the LRC.
Calculating Over ASCII Codes
LRC is calculated from binary message bytes before hexadecimal character encoding.
Using RTU CRC
ASCII mode uses the one-byte LRC rather than the RTU CRC-16.
Missing Colon
A correctly framed standard ASCII message begins with a colon.
Odd Number of Hex Digits
Every binary message byte must be represented by exactly two hexadecimal characters.
Modbus ASCII Frame & LRC Calculator FAQs
What is Modbus ASCII?
What character starts a Modbus ASCII frame?
How does a Modbus ASCII frame end?
What is LRC in Modbus?
How is Modbus LRC calculated?
Is the colon included in the LRC?
Are CR and LF included in the LRC?
Is the received LRC one or two bytes?
What is the LRC for 01 03 00 00 00 0A?
What is the difference between LRC and CRC?
Does Modbus ASCII use hexadecimal?
Can Modbus ASCII carry function 03?
Can this calculator validate an existing LRC?
Can this tool decode exception responses?
Why is Modbus ASCII less efficient than RTU?
Can spaces appear inside the transmitted Modbus ASCII frame?
Build and Validate Modbus ASCII Frames
Create Modbus ASCII read and write requests with the correct LRC, or paste an existing ASCII frame to decode message fields, verify the checksum and inspect function, address, quantity and exception information.