C.7 Message Format
234
YASKAWA ELECTRIC
TOEP C710687 02B FSDrive-MV1000 Instructions
Calculate the CRC-16 checksum using the following steps:
1.
The starting value is FFFFH.
2.
Perform an XOR operation of this value and the slave address.
3.
Right shift the result.
4.
When the overflow bit of the shift operation becomes 1, perform an XOR operation of the result from step 3
above and the fix value A001H.
5.
Repeat steps 3 and 4 until eight shift operations have been performed.
6.
After eight shift operations, perform an XOR operation with the result and the next data in the message (function
code, register address, data). Continue with steps 3 to 5 until the last data has been processed.
7.
The result of the last shift or XOR operation is the checksum.
shows the CRC-16 calculation of the slave address 02H and the function code 03H, yielding
the result D140H.
Note:
This example does not show the calculation for a complete MEMOBUS/Modbus command. Normally data would follow in the
calculation.
Table C.4 CRC-16 Checksum Calculation Example
n
Response Data
To be sure that the data is valid, perform a CRC-16 calculation on the response message data as described above.
Compare the result to the CRC-16 checksum that was received within the response message. Both should match.
Description
Calculation
Overflow
Description
Calculation
Overflow
Initial Value (FFFFH)
1111 1111 1111 1111
Function Code 03H
0000 0000 0000 0011
Address 02H
0000 0000 0000 0010
XOR w result
1000 0001 0011 1101
XOR w initial value
1111 1111 1111 1101
Shift 1
0100 0000 1001 1110
1
Shift 1
0111 1111 1111 1110
1
XOR w A001H
1010 0000 0000 0001
XOR w A001H
1010 0000 0000 0001
XOR result
1110 0000 1001 1111
XOR result
1101 1111 1111 1111
Shift 2
0111 0000 0100 1111
1
Shift 2
0110 1111 1111 1111
1
XOR w A001H
1010 0000 0000 0001
XOR w A001H
1010 0000 0000 0001
XOR result
1101 0000 0100 1110
XOR result
1100 1111 1111 1110
Shift 3
0110 1000 0010 0111
0
Shift 3
0110 0111 1111 1111
0
Shift 4
0011 0100 0001 0011
1
Shift 4
0011 0011 1111 1111
1
XOR w A001H
1010 0000 0000 0001
XOR w A001H
1010 0000 0000 0001
XOR result
1001 0100 0001 0010
XOR result
1001 0011 1111 1110
Shift 5
0100 1010 0000 1001
0
Shift 5
0100 1001 1111 1111
0
Shift 6
0010 0101 0000 0100
1
Shift 6
0010 0100 1111 1111
1
XOR w A001H
1010 0000 0000 0001
XOR w A001H
1010 0000 0000 0001
XOR result
1000 0101 0000 0101
XOR result
1000 0100 1111 1110
Shift 7
0100 0010 1000 0010
1
Shift 7
0100 0010 0111 1111
0
XOR w A001H
1010 0000 0000 0001
Shift 8
0010 0001 0011 1111
1
XOR result
1110 0010 1000 0011
XOR w A001H
1010 0000 0000 0001
Shift 8
0111 0001 0100 0001
1
XOR result
1000 0001 0011 1110
XOR w A001H
1010 0000 0000 0001
Perform operations with next data (function code)
XOR result
1101 0001 0100 0000
CRC-16
1101 0001 0100 0000
D 1 4 0
(upper) (lower)
Continue from here with next data.
Содержание FSDrive-MV1000 Series
Страница 8: ...8 YASKAWA ELECTRIC TOEP C710687 02B FSDrive MV1000 Instructions...
Страница 38: ...1 4 Component Names and Configurations 38 YASKAWA ELECTRIC TOEP C710687 02B FSDrive MV1000 Instructions...
Страница 106: ...3 9 Wiring Check 106 YASKAWA ELECTRIC TOEP C710687 02B FSDrive MV1000 Instructions...
Страница 136: ...4 9 Checking and Saving Parameter Default Values 136 YASKAWA ELECTRIC TOEP C710687 02B FSDrive MV1000 Instructions...
Страница 210: ...6 7 Spare Parts 210 YASKAWA ELECTRIC TOEP C710687 02B FSDrive MV1000 Instructions...
Страница 222: ...B 1 European Standards 222 YASKAWA ELECTRIC TOEP C710687 02B FSDrive MV1000 Instructions...