Mitsubishi Electric MELSEC iQ-R Series User Manual page 543

Serial communication module
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Ex.
The calculation example of 16-bit CRC (for MODBUS)
Packet example:
Station number
02H
Calculation method of 16-bit CRC (for MODBUS) for the above packet example
CRC error checking procedure
(Load a 16-bit register whose bits are all '1')
02H (Station number)
Exclusive OR (XOR)
Shift 1
Generator polynomial
Exclusive OR (XOR)
Shift 2
Generator polynomial
Exclusive OR (XOR)
Shift 3
Shift 4
Generator polynomial
Exclusive OR (XOR)
Shift 5
Shift 6
Generator polynomial
Exclusive OR (XOR)
Shift 7
Shift 8
Generator polynomial
Exclusive OR (XOR)
07H (Function code)
Exclusive OR (XOR)
Shift 1
Generator polynomial
Exclusive OR (XOR)
Shift 2
Generator polynomial
Exclusive OR (XOR)
Shift 3
Generator polynomial
Exclusive OR (XOR)
Shift 4
Shift 5
Generator polynomial
Exclusive OR (XOR)
Shift 6
Shift 7
Shift 7
CRC value
Function code
07H
16-bit register (MSB)
1111 1111
-
1111 1111
0111 1111
1010 0000
1101 1111
0110 1111
1010 0000
1100 1111
0110 0111
0011 0011
1010 0000
1001 0011
0100 1001
0010 0100
1010 0000
1000 0100
0100 0010
0010 0001
1010 0000
1000 0001
-
1000 0001
0100 0000
1010 0000
1110 0000
0111 0000
1010 0000
1101 0000
0110 1000
1010 0000
1100 1000
0110 0100
0011 0010
1010 0000
1001 0010
0100 1001
0010 0100
0001 0010
12H
Appendix 5 Operation Image and Data Structure of Predefined Protocol
16-bit CRC
41H
Flag
1111 1111
-
0000 0010
1111 1101
1111 1110
1
0000 0001
1111 1111
1111 1111
1
0000 0001
1111 1110
1111 1111
0
1111 1111
1
0000 0001
1111 1110
1111 1111
0
1111 1111
1
0000 0001
1111 1110
0111 1111
0
0011 1111
1
0000 0001
0011 1110
0000 0111
-
0011 1001
1001 1100
1
0000 0001
1001 1101
0100 1110
1
0000 0001
0100 1111
0010 0111
1
0000 0001
0010 0110
0001 0011
0
0000 1001
1
0000 0001
0000 1000
0000 0100
0
1000 0010
0
0100 0001
0
41H
-
12H
Calculating
procedure
1 to 2
3 to 4
5
6
7
8
APPENDICES APPENDIX
541
A

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents