Online Toolbox
switching mode
tool collection
put it on the desktop
inclusion application
tool search
start generating

LRC check tool Introduction

lrc verification knowledge

longitudinal redundancy check (lrc) is a commonly used form of verification in communication, also known as lrc check or vertical check. it is an error detection method that generates check bits from a specific bit string on a longitudinal channel. in row-column formats (such as tape), lrc is often used with vrc, which will check the code for each character. the algorithm is adopted in the industrial field of modbus protocol ascii mode

the specific algorithm is as follows:

1. summarize a hexadecimal value for the data (2n characters) that need to be checked in two pairs.

2. modify the sum result with 256

3. subtract the obtained mod value with 256 to the verification result (another method: inverse the mod value bitwise and then add 1)

for example hexadecimal data: 01 a0 7c ff 02

(hexadecimal calculation) sum: 01 + a0 + 7c + ff + 02 = 21e modification: 21e % 100 = 1e calculation: 100 - 1e = e2

(decimal calculation) sum: 01 + 160 + 124 + 255 + 02 = 542 modification: 542 % 256 = 30 calculation: 256 - 30 = 226

Internet Business Promoter