5-68
The RTU Mode:
Inquiry message:
Response message:
Address
01H
Address
01H
Function
06H
Function
06H
Data address
01H
Data address
01H
00H
00H
Data content
17H
Data content
17H
70H
70H
CRC CHK Low
86H
CRC CHK Low
86H
CRC CHK High
22H
CRC CHK High
22H
3.4 The LRC Check of the ASCII Mode
The LRC Check is the added sum from “Address” to “Data Contents”. For example, in
3.3.1, the LRC Check for the inquiry message will be: 01H + 03H + 21H + 02H + 00H +
02H = 29H, then take the complementary of 2, D7H.
3.5 The CRC Check of the RTU Mode
The CRC Check starts from “Address” and ends in “Data Contents”. Its calculation is as
follows:
Step 1: Load the 16-bit register (the CRC register) with FFFFH.
Step 2: Exclusive OR the first 8-bit byte message command with the 16-bit CRC
register of the lower bit, then save the result into the CRC register.
Step 3: Shift the CRC register one bit to the right and fill in 0 to the higher bit.
Step 4: Check the value that shifts to the right. If it is 0, save the new value from
Step 3 into the CRC register, otherwise, Exclusive OR A001H and the
CRC register, then save the result into the CRC register.
Step 5: Repeat Steps 3 and 4 and calculates the 8-bit.
Step 6: Repeat Steps 2~5 for the next 8-bit message command, till all the
message commands are processed. And finally, the obtained CRC
register value is the CRC Check value. What should be noted is that the
CRC Check must be placed interchangeably in the Check Sum of the
message command.
What follows is the calculation example of the CRC Check using the Clanguage:
unsigned char* data
// index of the message command
unsigned char length
// length of the message command
Summary of Contents for S3000 Series
Page 8: ...2 5 DIMENTIONS 2 5...
Page 9: ...2 6 403 216...
Page 10: ...2 7...
Page 11: ...2 8 S3000 IP06...