Appendix C Communication Protocol Shenzhen Hpmont Technology Co., Ltd
―170― HD30 Series Inverters User Manual
It takes a comparatively long time to online calculate the CRC checksum of each byte, but it will
save program space. Code of online calculating CRC is shown below:
unsigned int crc_check(unsigned char *data,unsigned char length)
{
int i;
unsigned crc_result=0xffff;
while(length--)
{
crc_result^=*data++;
for(i=0;i<8;i++)
{
if(crc_result&0x01)
crc_result=(crc_result>>1)^0xa001;
else
crc_result=crc_result>>1;
}
}
return (crc_result=((crc_result&0xff)<<8)|(crc_result>>8));
}
10. Application case
Remarks: Please verify all the hardware equipments are connected well before controlling the
inverter via communication. In addition, please preset the communication data format, baud rate
and communication address
1. To read the maximum output frequency of Slave 2 (to read the command frame of F00.06)
Address Parameter Register address Word no. of read Checksum
0x02 0x03 0x00 0x06 0x00 0x01 0x64 0x38
Corresponding answer frame (F00.06=50.00):
Address Parameter Answer byte Register content Checksum
0x02 0x03 0x02 0x13 0x88 0Xf1 0x12
2. To read the DC bus voltage of Slave 2 (to read status parameter)
Address Parameter Register address Word no. of read Checksum
0x02 0x03 0x33 0x19 0x00 0x01 0x5a 0xba