181 
 
register data, the drive configures consecutive data. The length of the data depends on the 
command details.   
The Modbus register always consists of a data length of two bytes. Data written into the 
register must also consist of a length of two bytes. Register data read out from the drive will 
always have two bytes. 
11.5.6 Error Check 
The drive check data validity using CRC scheme.   
11.5.7 Command Data     
When the drive receives data, it checks for errors. To do so, the drive calculates the CRC and 
compares it to the CRC-16 value received in the message. The command will not be processed 
if these two values do not match. 
Use the default value of FFFFH (i.e., all 16 bits equal 1) to caculate CRC-16 in Modbus. Calculate 
the CRC-16 checksum using the following steps: 
 
(1).  The starting value of a 16-bit register value is FFFFH (all 16 bits equal 1).   
(2).  Perform an exclusive OR of this value and the slave address. Then save the result in 
the register.   
(3).  Right shift the result, put 0 to the left of the high-order byte and check the CRC 
register value.   
(4).  If the value is 0, save the result from step (3) above in the CRC register.   
If the value is not 0, perform an exclusive OR of the result from stop (3) and the value 
A001h(1010 0000 0000 0001). Then save the result in the CRC register. 
(5).  Repeat step (3) and (4) until 8-bit operations are all performed.   
(6).  Repeat step (2) to (5). Recive next 8-bit command data until all the command data 
are caculated. The result of the last shift is the CRC checksum. Send the low-order 
byte before the high-order byte when sending the CRC checksum. For an example of 
CRC checksum 1241hex, the high-order byte of CRC-16 must be set to 41hex, and 
the low-order byte must be set to 12hex. 
  CRC Calculation: 
UWORD ch_sum ( UBYTE long , UBYTE *rxdbuff ) { 
    BYTE i = 0; 
    UWORD wkg = 0xFFFF; 
    while ( long-- ) { 
    wkg ^= rxdbuff++; 
   for ( i = 0 ; i < 8; i++ ) {