Omron KP**G-OD Series Communications Manual page 42

Grid connect photovoltaic inverter
Table of Contents

Advertisement

4 MODBUS
Example of CRC-16 Calculation
A message is processed 1 byte at a time in a 16-bit processing register called the CRC register.
1
An initial value of FFFF hex is set in the CRC register.
2
An XOR is taken of the contents of the CRC register and the 1st byte of the message, and the
result is returned to the CRC register.
3
The contents of the CRC register is shifted 1 bit to the right, and 0 is placed in the MSB.
4
If the bit shifted from the LSB is 0, step 3 is repeated (i.e., the contents of the register is shifted
1 more bit).
If the bit shifted from the LSB is 1, an XOR is taken of the contents of the CRC register and
A001 hex, and the result is returned to the CRC register.
5
Steps 3 and 4 are repeated until the contents of the register have been shifted 8 bits to the right.
6
If the end of the message has not been reached, an XOR is taken of the next byte of the CRC
register and the message, the result is returned to the CRC register, and the procedure is
repeated from step (3).
7
The result (the value in the CRC register) is placed in the lower byte of the message.
Example of Appending the Result
If the calculated CRC value is 1234 hex, this is appended as follows to the command frame:
Slave
Function
address
code
1
1
CRC-16 calculation range
4-4
Data
CRC-16
Low
High
H'34
H'12
2
Grid Connect Photovoltaic Inverter KPG/KPL Communication Manual

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Kp**l seriesKp*l-od seriesKp40gKp100g

Table of Contents