User Manual of SY5000 series AC Drive MODBUS communication protocol
~109~
Attachment:
Calculation of check code
1 Check code of ASCII mode
(
LRC Check
)
Check code
(
LRC Check
)
is the total value adding from address to data. E.g.
:
STX
‘:’
Address
‘0’
‘1’
Function
‘0’
‘3’
DATA
Start=ing address
‘2’
‘1’
‘0’
‘2’
Number of data
(count by word)
‘0’
‘0’
‘0’
‘2’
LRC Check
‘D’
‘7’
END
CR
LF
Calculation of check codes of above command:
01H+03H+21H+02H+00H+02H=29H, then take the complement of 29H and get
check code of D7H.
2 Check code of RTU mode
(
CRC Check
)
Check code is the value from Address to Data.
Its calculation rules are as following:
Step 1
:
load a 16-bit register
(
called CRC register
)
=FFFFH.
Step 2
:
first 8-bit byte message command and 16-bit low byte of CRC register
will be treated as Exclusive OR
,
and store the result into CRC register.
Step 3
:
Right move one bit CRC register, fill 0 in high byte.
Step 4
:
Check the value of right move, if 0, store the new value of Step 3 into
CRC register, otherwise exclusive OR A001H and CRC register, store the result
into CRC register.
Step 5
:
Repeat Step
3~
Step
4,
complete all calculation of 8-bit.