![Veikong VFD700 Series Скачать руководство пользователя страница 93](http://html1.mh-extra.com/html/veikong/vfd700-series/vfd700-series_operation-manual_3864500093.webp)
Appendix
86VFD700 AC Drive Getting Started Guide
0x99, 0x59, 0x58, 0x98, 0x88, 0x48, 0x49, 0x89, 0x4B, 0x8B,
0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C,
0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42,
0x43, 0x83, 0x41, 0x81, 0x80, 0x40
} ;
/* CRC Generation for Modbus messages */
// The function returns the CRC as a unsigned short type
unsigned short CCRC_ModbusRTUCRC16 (unsigned char *puchMsg, short usDataLen )
{
unsigned short ReturnValue;
// high byte of CRC initialized
unsigned char uchCRCHi = 0xFF;
// low byte of CRC initialized
unsigned char uchCRCLo = 0xFF;
// will index into CRC lookup table
unsigned char uIndex;
// pass through message buffer
while (usDataLen--)
{
// calculate the CRC
uIndex
= uchCRCHi ^ *+;
uchCRCHi
= uchCRCLo ^ auchCRCHi[ uIndex ];
uchCRCLo
= auchCRCLo[ uIndex ];
}
ReturnValue = uchCRCHi;
ReturnValue <<= 8;
ReturnValue |= uchCRCLo;
return ReturnValue;
}