Delta Electronics AC Motor Drive VFD-G User Manual page 131

Vfd-g series specific ac motor drives for plastic molding and air compressors machinery
Table of Contents

Advertisement

Chapter 4 Parameters|
The following is an example of CRC generation using C language. The function takes two
arguments:
Unsigned char* data
Unsigned char length
The function returns the CRC values as a type of unsigned integer.
unsigned int crc_chk(unsigned char* data, unsigned char length){
int j;
unsigned int reg_crc=0xFFFF;
while(length--){
reg_crc ^= *data++;
for(j=0;j<8;j++){
if(reg_crc & 0x01){ /* LSB(b0)=1 */
}else{
}
}
}
return reg_crc;
}
4-80
Command message:
Data starting address
a pointer to the message buffer
the quantity of bytes in the message buffer
reg_crc=(reg_crc>>1) ^ 0xA001;
reg_crc=reg_crc >>1;
ADR
CMD
Number of data
(word)
CRC CHK Low
CRC CHK High
01H
03H
02H
02H
00H
02H
6FH
F7H
Revision July 2008, EG03, SW V1.06

Advertisement

Table of Contents
loading

Table of Contents