59
Calculating Checksums (IDCHK, IHCHK)
IND100077-259
IDCHK with two data fields (2 bytes).
DATA1 DATA2 IDCHK
Calculating IDCHK while having two data fields (or more) is almost the same as single data field. Sum the two data
fields, subtract 1 for every time you exceed 255 and start from 0.
Example of 2 data bytes:
Data field 1:
55
or as HEX
0x37
Data field 2:
230
or as HEX
0xE6
Add all the data fields together.
230 + 55 = 285
Subtract 255 until the summed data value is below
255
.
285
-
255
= 30
Subtract 1 for every time subtracted
255
above.
30 - 1 = 29
Subtract 29 based on decimal values from the binary table on previous page until you reach 0:
29
-
16 - 8 - 4 - 1
= 0
Which gives us binary number (by using explanations on previous page).
0001
1101
inverted is (by using explanations on previous page).
1110
0010
Convert 1110 0010 to decimal is
226
or as HEX
0xE2
Attention Address
CMD
CMD
CMD
Length
IHCHK
55
230
226
IDCHK with three data fields (3 bytes).
DATA1 DATA2 DATA3 IDCHK
Example using 3 data bytes:
Data field 1:
233
or as HEX
0xE9
Data field 2:
229
or as HEX
0xE5
Data field 3:
228
or as HEX
0xE4
Add all the data fields together.
233 + 229 + 228 = 690
Subtract
255
until the summed data value is below
255
.
690 - 255 = 435
435 - 255 = 180
Subtract 2 for every time subtracted
255
above.
180 - 2 = 178
Subtract 178 based on decimal values from the binary table on previous page until you reach 0:
178
-
128 - 32 - 16 - 2
= 0
Which gives us binary number (by using explanations on previous page).
1011
0010
inverted is (by using explanations on previous page).
0100
1101
Convert 0100 1101 to decimal is
77
or as HEX
0x4D
Attention Address
CMD
CMD
CMD
Length
IHCHK
233
229
228
77