OBID
i-scan
®
Manual
ID ISC.PRHD102
FEIG ELECTRONIC GmbH
Page 18 of 125
H71101-2e-ID-B.doc
3.2. CRC16 Calculation Algorithm
Polynom:
x
16
+ x
12
+ x
5
+ 1
⇒
CRC_POLYNOM = 0x8408;
Start Value:
0xFFFF
⇒
CRC_PRESET = 0xFFFF;
C-Example:
unsigned int crc = CRC_PRESET;
for (i = 0; i < cnt; i++)
/* cnt = number of protocol bytes without CRC */
{
crc ^= DATA[i];
for (j = 0; j < 8; j++)
{
if (crc & 0x0001)
crc = (crc >> 1) ^ CRC_POLYNOM;
else
crc = (crc >> 1);
}
}
Summary of Contents for OBID i-scan ID ISC PRHD102
Page 77: ...OBID i scan Manual ID ISC PRHD102 FEIG ELECTRONIC GmbH Page 77 of 125 H71101 2e ID B doc...
Page 78: ...OBID i scan Manual ID ISC PRHD102 FEIG ELECTRONIC GmbH Page 78 of 125 H71101 2e ID B doc...
Page 79: ...OBID i scan Manual ID ISC PRHD102 FEIG ELECTRONIC GmbH Page 79 of 125 H71101 2e ID B doc...
Page 80: ...OBID i scan Manual ID ISC PRHD102 FEIG ELECTRONIC GmbH Page 80 of 125 H71101 2e ID B doc...