LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CRC 32bit

Solved!
Go to solution

@jay0909 wrote:

[...]  The calculated CRC on labview part is wrong. 

[...]
 

Please do attach the VI(s). Without seeing the code, there is not much to help you with.

 

My assumption is: The CRC32 you read from the controller is correct (226F9471 in your original example).

However, you do compute a CRC32 in LV from the frame (1C000000B0B80700040400000000000000) and end up with a different CRC32 (9D0351B5).

So it seems that there is something wrong in your LV implemented CRC32 calculation. Did you implement it yourself or downloaded it from somewhere?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 21 of 46
(2,774 Views)

Hi,

 

        I did not implement i used the IEEE 802.3 CRC 32 vi for calculation. The attached vi contains crc without validation and ieee 820.3 crc 32 

Download All
0 Kudos
Message 22 of 46
(2,766 Views)

There are multiple errors in the CRC vi. It starts that the typecast of the string is invalid: Two characters represent one byte. Your typecast simply transfers each character to a byte (using ASCII table)

 

Here is what you can do (caution: not very well in regard to performance):

CastStringToHexU8Array.PNG

 

Then there is obviously a big mistake in the CRC implementation itself because when correcting the cast, it still results in an incorrect CRC. Where did you get that VI from?

 

Norbert

 

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 23 of 46
(2,762 Views)
0 Kudos
Message 24 of 46
(2,757 Views)

@PalanivelThiruvenkadam wrote:
If it's works fine in python it should also work in LabVIEW.
Check with the way it's implemented in python and in LabVIEW and find the difference
Basic CRC is add all the data other than header .

I have seen some protocols that include the header when calculating the CRC. Have you tried to include header + data in your CRC calcs?

0 Kudos
Message 25 of 46
(2,745 Views)

Yes, I caclculate CRC with header + data

0 Kudos
Message 26 of 46
(2,744 Views)

Try this implementation.

 

While it also casts the string imho incorrectly, it does indeed reveal the same CRC32 as you obviously expect.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 27 of 46
(2,724 Views)

Hi,

 

           For this frame i get a different crc 

 

whole frame : 1C0000009DE50200040400000000000000B6CE2D67

 

CRC : B6CE2D67

 

Calculated CRC : EB48D85C from LV. 

 

If any ideas please let me know

0 Kudos
Message 28 of 46
(2,719 Views)

Using that stated frame (excluded CRC) on this CRC calculator results in the same CRC as LV.

It seems that your controller messed that one up.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 29 of 46
(2,711 Views)

I have attached a c code for calculating the crc. This is the code the uart uses to calculate. HOw is it different from labview implementation?

0 Kudos
Message 30 of 46
(2,676 Views)