CHV180 series frequency inverter special for elevator Communication protocol
.105.
10.6 CRC check
For higher speed, CRC-16 uses tables. The following are C language source code for
CRC-16.
unsigned int crc_cal_value(unsigned char *data_value,unsigned char data_length)
{
int i;
unsigned int crc_value=0xffff;
while(data_length--)
{ crc_value^=*data_value++;
for(i=0;i<8;i++)
{
if(crc_value&0x0001)crc_value=(crc_value>>1)^0xa001;
else crc_value=crc_value>>1;
} }
return(crc_value);
}
10.7 Example
10.7.1 RTU mode read 2 data from 0004H
The request command is:
START T1-T2-T3-T4 (transmission time of 3.5 bytes)
Node address 01H
Command 03H
High byte of start address 00H
Low byte of start address 04H
High byte of data number 00H
Low byte of data number 02H
Low byte of CRC 85H
High byte of CRC CAH
END T1-T2-T3-T4 (transmission time of 3.5 bytes)
The reply is :
START T1-T2-T3-T4 (transmission time of 3.5 bytes)
Node address 01H
Command 03H
Returned byte number 04H