Appendix
A - 4
A.2.3 Error check
(1) LRC check
The error check field based on the Longitudinal Redundancy Check (LRC) is included in the message frame in
ASCII mode. The target of LRC calculation is a portion (Device address, Function code, data) except the header
(colon) and the terminator (CR/LF).
A procedure for generating LRC is:
1. Add all bytes in the message, excluding the starting ‘colon’ and ending CRLF. Add them into an 8–bit field, so
that carries will be discarded.
2. Subtract the final field value from FF hex, to produce the ones–complement.
3. Add 1 to produce the twos–complement.
Figure A.2 Calculation procedure of LRC
Ex. ) When coil information is read from the coil address 0000 (16 bits) of a slave (Device No. 08)