LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CRC-16 M-Bus

Solved!
Go to solution

I am unable to get the CRC calculator going off the C examples I have found.  Can one of you gurus help me out on this one.

 

Standard Polynomial 0x3D65

Reverse Polynomial 0xA6BC

Initial Remainder 0x0000

 

Polynomial: X^16+X^13+X^12+X^11+X^10+X^8+X^6+X^5+X^2+X^0

 

Example Data (hex): A5 0F 06 90 05 00 00 00

CRC: B3 38

 

https://stackoverflow.com/questions/43052658/how-to-calculate-the-crc16-for-wireless-m-bus-messages

Kenny

0 Kudos
Message 1 of 2
(2,894 Views)
Solution
Accepted by topic author Kenny_K

I think this may work. I'll leave it up to you to decide.

crc snippet.png

 

It works on the "live data" from the link you provided.

first live.PNG Correct

second live.PNG Correct

 

But not on the first set of hex/crc data in that link. Website gives 0xB92F as the correct CRC

first hex.PNG Wrong

 

This is what I get using your example data. When comparing the calculated CRC to your expected value, the bytes are swapped. 0x38B3 vs.0xB338

your exemplar.PNG Bytes Swapped

 

Do you have any more data to try?? It would be an easy fix in the above VI to swap the byte order.

0 Kudos
Message 2 of 2
(2,862 Views)