HRX-OM-W069
Chapter 3 Serial communication
3.10
Checksum calculation method
HRL Series
3-10
No
Classification
Contents
calculation result
1
LRC message for
calculation
0106004000EA
-
2
Calculation
Added for each 8Byte
01h+06h+00h+40h+00h+EAh=131h
31h
3
complement of 2
31h
→CEh→CFh
CFh(LRC)
4
Sending message
[:]0106004000EACF[CR][LF]
-
3.10.2
CRC(RTU)
CRC checks the content of the message. The sending side calculates
the data every 2 bytes (16 bits). The receiving side calculates CRC
based on the received message, and compares the calculation result
with the received CRC. The received message is deleted if the
calculated CRC is different from the received CRC.
Calculation procedure
(1)
Preload “FFFFh” (set 0xFFFF as initial value ).
(2) Exclusive OR the first byte of the transmitted message with the value in (1).
(3) Shift the result of (2) by one bit toward the least significant bit, and fill a zero
into the most significant bit position.
(4)
If the least significant bit was a 1, exclusive OR the result of (3) with “A001h”.
(Example 1). If the least significant bit was a 0, no exclusive OR takes place.
(5) Repeat (3) to (5) until eight shifts have been performed.S
(6) After eight shifts, exclusive OR the result of (5) with the next 1-byte
(2nd. byte).
(7) The processes (3) to (6) are repeated for all the remaining bytes of the
message.
(8) The 2-byte data of the result of (7) is the CRC value
(Example 1) The least significant bit was a 1.
(Example 2) The least significant bit was a 0.
0
0
0
0
0
0
0
0
0
0
0
0
…
0
0
0
0
0
…
Add
0
to the top
If it is
0
, do not ExOR
…
1 bit shift in the lowest direction
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
…
…
1 bit shift in the lowest direction
Add
0
to the top
Execute ExOR if 1
Содержание HRL100-A
Страница 10: ...HRX OM W069 Chapter 1 Read before using 1 4 Touch panel flow HRL Series 1 6...
Страница 55: ......