BACnet CRC help

A

Thread Starter

Andrew Chiang

Hi,
I was told that the CRC used in BACnet for a Point-to-Point connection is 1+x^7+x^8 for header and 1+x^5+x^12+x^16 for data. I would like to
calculate the data CRC for the following message using the 1+x^5+x^12+x^16 polynomial.

Message1 with 51 octet:
0x01 0x2c 0x00 0x01 0x06 0x00 0xe0 0x29 0x82 0x5f 0xfc 0x00 0x64 0x01
0x0a 0xff
0x02 0x03 0xc6 0x0e 0x0c 0x2c 0xc0 0x00 0x01 0x1e 0x0a 0x04 0x1a 0x0a
0x04 0x1b
0x0a 0x04 0x1f 0x0a 0x04 0x4c 0x0a 0x04 0x50 0x0a 0x04 0x55 0x0a 0x27
0x15 0x0a
0x35 0x53 0x1f
Expected CRC is 0x84 0x06

Message2 with 9 octet:
0x01 0x88 0x00 0x02 0x01 0x15 0x01 0x00 0x02
Expected CRC is 0x6e 0xcd

I've tried all 0 to 0xffff used as a preload value for the CRC calculation and also reversing the data bits for the message and calculated CRC and got the following result:
Message 1 with 51 octet:
1a)length=3D51, preload CRC=3D0x319e, expected CRC=3D0x8406
1b)With bits reversed : preload CRC=3D0xd8c9, expected CRC=3D0x8406

Message 2 with 9 octet:
2a)length=3D9, preload CRC=3D0x3974, expected CRC=3D0x6ecd
2b)With bits reversed : preload CRC=3D0x9b4f, expected CRC=3D0x6ecd

Since these two messages used the same logic in calculating their CRC value so they should have the same preload CRC either for (1a) and (2a) OR same preload CRC for (1b) and (2b); however my result show different value!!!
I wander what is wrong, have I missed out something ? Any help is appreciated.




Andrew ST Chiang
 
C

cüneyt bektas

Hi,
unfortunally , i can help by your problem.
Do you have c-code for Bacnet Protokoll or know
how i can make implemention to ddc controlle with c- code.
Many thanks for your repply.

Regard

Cüneyt
 
F
I am having trouble with a BACNet CRC calculation as well. But I do know that the initial value (or preload as you call it) is all ones. That is 0xFF for the header CRC and 0xFFFF for the data CRC.

Frank Levy.

> I was told that the CRC used in BACnet for a Point-to-Point connection is
> 1+x^7+x^8 for header and 1+x^5+x^12+x^16 for data. I would like to
> calculate the data CRC for the
> following message using the 1+x^5+x^12+x^16 polynomial.

> Message1 with 51 octet:
> 0x01 0x2c 0x00 0x01 0x06 0x00 0xe0 0x29
> 0x82 0x5f 0xfc 0x00 0x64 0x01
> 0x0a 0xff
> 0x02 0x03 0xc6 0x0e 0x0c 0x2c 0xc0 0x00
> 0x01 0x1e 0x0a 0x04 0x1a 0x0a
> 0x04 0x1b
> 0x0a 0x04 0x1f 0x0a 0x04 0x4c 0x0a 0x04
> 0x50 0x0a 0x04 0x55 0x0a 0x27
> 0x15 0x0a
> 0x35 0x53 0x1f
> Expected CRC is 0x84 0x06
>
> Message2 with 9 octet:
> 0x01 0x88 0x00 0x02 0x01 0x15 0x01 0x00
> 0x02
> Expected CRC is 0x6e 0xcd
 
Top