5Data Size 3
B16
Data Length 3
00 7F
Size of 6
Note: Error when 80 to FF hex codes are included.
6Data
Bn - Bm Data
XX
No Data in some cases
Bn = B16 +1
Bm = B16 +Total Data Length
7Check SUM
Bm +1 Check Sum
XX
Check sum of Data from 2 to 6
(Calculate the XOR of the Data from 2 to 6)
XOR is the exclusive OR.
It is as follows when calculated by 1 bit.
Taking A XOR B = C;
A | B | C |
0 | 0 | 0 |
1 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 0 |
<Example of Calculation>
When 0XA5 (165) and 0XA5 (165) are calculated by XOR;
A5 10100101 (165)
A5 10100101 (165)
Answer 00000000 (0)
When 0XA5 (165) and 0X5A (90) are calculated by XOR; Answer
A5 10100101 (165)
5A 01011010 (90)
Answer 11111111 (255)
8End Condition
Bm +2 END Code
5A
Indicates the last packet
5 |