# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## CRC-16-DNP Calculation Trouble

Having trouble implementing a Labview version of a CRC calculation performed in our FW. This is for a 16 bit DNP protocol. I have implemented a very simple VI that I believe is true to the code implementation, but I am not coming up with the same results.

Test message is

05 64 0b c4 01 00 40 00

with a proper CRC of

A72E

I however get a CRC calculation of D158. Not sure where I have gone wrong. Any help would be greatly appreciated.

Matt Kraus
Message 1 of 6
(2,227 Views)

## Re: CRC-16-DNP Calculation Trouble

My only guess at the moment is that you make a mistake in the table.  I just do not have the time to check all 256 elements.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(2,189 Views)
Solution
Accepted by topic author 14gipper

## Re: CRC-16-DNP Calculation Trouble

Looks like you might have missed one last step from the calculation. After googling CRC-DNP, the final step is to take the complement and swapping bytes to get the final answer.

Feel free. Contact me for anything more,
Pang

You too can be LabVIEW Awesome!
Message 3 of 6
(2,159 Views)

## Re: CRC-16-DNP Calculation Trouble

Rube!  There is a primitive called Swap Bytes that you can use instead of the Separate Numbers and Join Numbers.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6
(2,150 Views)

## Re: CRC-16-DNP Calculation Trouble

That did it. Thanks for the catch. Banged my head against the monitor all day over that.

Matt Kraus
Message 5 of 6
(2,118 Views)

## Re: CRC-16-DNP Calculation Trouble

Finished VI attached for the next lost soul searching for DNP CRC.

Matt Kraus
Message 6 of 6
(2,113 Views)