
VFD-M …………..………………………….…… . 71
. CRC
CRC . CRC ,
CRC , .
CRC .
:
Unsigned char* data <- a pointer to the message buffer
Unsigned char length <- the quantity of bytes in the message buffer
The function returns the CRC value as a type of unsigned integer.
Unsigned int crc_chk(unsigned char* data, unsigned char length){int j;
unsigned int reg cre=0xFFFF;
while(length--){
reg_crc ^= *data++;
for(j=0;j<8;j++){
if(reg_crc & 001){ /*LSB(b0)=1 */
reg_crc=(reg_crc>>1) ^ 0xA001;
}else{
reg crc=reg_crc>>1;
}
}
}
return reg_crc;
}
3.5. :
Содержание: Aдрес: Функция:
00nnH nn – Hex ( Pr.100 = 0064H)
00: ;
01: Stop;
Bit 0-1
10: Run;
11: Jog+Run;
Bit 2-3 ;
00: ;
01: FWD;
10: REV;
Bit 4-5
11: ;
2000H
Bit 6-15 ;
2001H ;
Bit 0 1: EF ( ) on;
Bit1 1: ;
2002H
Bit 2-15 ;
Comentários a estes Manuais