![Future Design MCT-MC 4.3 Скачать руководство пользователя страница 147](http://html1.mh-extra.com/html/future-design/mct-mc-4-3/mct-mc-4-3_user-manual_2352024147.webp)
MCT-MC
4.3
Appendix
- 147 -
FDC MCT-MC
Example Cyclical Redundancy Checksum (CRC) Algorithm
unsigned int calc_crc(unsigned char *start_of_packet, unsigned char *end_of_packet)
{
unsigned int crc;
unsigned char bit_count;
unsigned char *char_ptr;
/* Start at the beginning of the packet */
char_ptr = start_of_packet;
/* Initialize CRC */
crc = 0xFFFF;
/* Loop through the entire packet */
do{
/* Exclusive-OR the byte with the CRC */
crc ^= (unsigned int)*char_ptr;
/* Loop through all 8 data bits */
bit_count = 0;
do{
/* If the LSB is 1, shift the CRC and XOR the polynomial mask with the CRC */
if(crc & 0x0001){
crc >>= 1;
crc ^= 0xA001;
}
/* If the LSB is 0, shift the CRC only */
else{
crc >>= 1;
}
} while(bi+ < 7);
} while(c+ < end_of_packet);
return(crc);
}
Содержание MCT-MC 4.3
Страница 1: ...MCT MC 4 3 User Manual MCT MC 4 3 User Manual Rev A February 2018...
Страница 175: ...MCT MC4 3 Appendix 175 FDC MCT MC A 5 Power Supply Specifications DIN Rail Mount Power Supply Specifications...
Страница 176: ...MCT MC4 3 FDC MCT MC 176 Appendix...
Страница 177: ...MCT MC4 3 Appendix 177 FDC MCT MC Open Frame Power Supply Specifications...
Страница 178: ...MCT MC4 3 FDC MCT MC 178 Appendix...
Страница 179: ...MCT MC4 3 Appendix 179 FDC MCT MC A 6 Power On Delay Relay Specifications GE1A C10HA110...
Страница 180: ...MCT MC4 3 FDC MCT MC 180 Appendix...