Herunterladen Inhalt Inhalt Diese Seite drucken

Wenglor weCat3D MLSL-Serie Betriebsanleitung Seite 148

2d-/3d-profilsensoren
Inhaltsverzeichnis

Werbung

bCRCTableInitialize
register unsigned short int
register unsigned int
for
(i
= 0; i<256; i++)
{
crc_accum
for
{
}
uiCRCTable[i] = crc_accum;
}
}
for
(j
= 0; j<data_blk_size; j++)
{
=
((int)(crc_accum
i
crc_accum
}
return
crc_accum;
}
Anwendungsbeispiel:
/*!
* ucBuffer is a pointer to the data of the container tag
* uiBuffer is the size of the container tag
*/
unsigned int uiCalculatedCRC
148
= true;
crc_accum;
=
((unsigned
(j
= 0;
< 8; j++)
j
if
(crc_accum
crc_accum
else
crc_accum
>> 24) ^ *data_blk_ptr++) & 0xFF;
=
(crc_accum
<< 8) ^ uiCRCTable[i];
= CalculateCRC(-1, ucBuffer, uiBuffer - 4);
i, j;
<< 24);
int)i
& 0x80000000L)
=
(crc_accum
=
(crc_accum
<< 1) ^ CRCPOLYNOMIAL;
<< 1);
TCP/IP Socket Interface

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis