![Vectornav VN-100 Скачать руководство пользователя страница 30](http://html2.mh-extra.com/html/vectornav/vn-100/vn-100_user-manual_3752294030.webp)
30
UM001
3.8.3
16-bit CRC
For cases where the 8-bit checksum doesn't provide enough error detection, a full 16-bit CRC is available.
The VN-100 uses the CRC16-CCITT algorithm. The resultant CRC is a 16-bit number and is represented in
the command as four hexadecimal characters. The C function snippet below calculates the correct CRC.
Example C Code
// Calculates the 16-bit CRC for the given ASCII or binary message.
unsigned short
calculateCRC(
unsigned char
data[],
unsigned int
length)
{
unsigned int
i;
unsigned short
crc = 0;
for(i=0; i<length; i++){
crc = (
unsigned char
)(crc >> 8) | (crc << 8);
crc ^= data[i];
crc ^= (
unsigned char
)(crc & 0xff) >> 4;
crc ^= crc << 12;
crc ^= (crc & 0x00ff) << 5;
}
return crc;
}
Содержание VN-100
Страница 1: ...UM001 1 Firmware v2 1 0 0 Document Revision 2 22 VN 100 User Manual Embedded Navigation Solutions...
Страница 9: ...UM001 9 2 Specifications 2 1 VN 100 Surface Mount Sensor SMD Electrical Pin assignments top down view...
Страница 14: ...14 UM001 2 3 VN 100 Surface Mount Sensor SMD Dimensions Measurements are in inches 2 4 VN 100 Rugged Dimensions...
Страница 102: ...102 UM001 8 3 Factory Defaults Settings Name Default Factory Value Magnetometer Calibration Control 1 3 5...
Страница 113: ...UM001 113 9 5 Factory Defaults Settings Name Default Factory Value Velocity Compensation Control 1 0 1 0 01...