User Manual

Table Of Contents
Setup and Configuration 5-8
SmartPoint Module for the Elster A3 Meter ECMTM40000
WORD crc16_lsb(BYTE *pData, WORD length)
{
BYTE i;
WORD data, crc;
crc = 0xFFFF;
if (length == 0)
return 0;
do
{
data = (WORD)0x00FF & *pData++;
crc = crc ^ data;
for (i = 8; i > 0; i--)
{
if (crc & 0x0001)
crc = (crc >> 1) ^ 0x8408;
else
crc >>= 1;
}
}
while (--length);
crc = ~crc;
return (crc);
}
For example, a Status Request command:
1b ff 91 00
Would generate the following CRC:
1c 39
The complete message would be as follows:
1b ff 91 00 1c 39