Chapter 6 Applied Instruction 2. LRC check code: The values starting from the communication address to the data are added up. The two’s complement of the sum gotten is the LRC check code. Example: 16#01+16#03+16#21+16#02+16#00+16#02=16#29 The two’s complement of 16#29 is 16#D7. 6-413 STX ‘:’ The start-of-text character is ‘:’ (16#3A). Address Hi ‘ 0 ’ Communication address: The 8-bit address is composed of two ASCII codes. Address Lo ‘ 1 ’ Function Hi ‘ 0 ’ Function code: The 8-bit function code is composed of two ASCII codes. Function Lo ‘ 3 ’ ‘ 2 ’ Data: The n×8-bit data is composed of 2n ASCII codes. ‘ 1 ’ ‘ 0 ’ DATA (n-1) ‘ 2 ’ …….
‘ 0 ’ DATA 0 ‘ 0 ’ ‘ 0 ’ ‘ 2 ’ LRC CHK Hi ‘ D ’ LRC check code: The 8-bit check code is composed of two ASCII codes. LRC CHK Lo ‘ 7 ’ END Hi CR End-of-text character: END Hi=CR(16#0D),END Lo=LF(16#0A) END Lo LF