Jump to content

CRC checksum calculation


Recommended Posts

Posted

I have a Marstek Venus3 Home battery that communicates with a Marstek CT003 netpower meter. I intercepted a data package with Wireshark from Venus to CT003.

If I send this captured data package to the CT003 with UDP in Labview I receive a good answer from CT003. No problem so far. But if I want replicate how they calculate the CRC checksum from that package, I don't get the right CRC checksum in Labview. See VI. The last 2 bytes in package are the CRC checksum.

In the VI is the Python code the I found at Github, to see how they calculate the CRC checksum and replicate that in Labview.

Question what am I doing wrong. 

CT003 CRC checksum.vi

Posted

You should replace the Type Cast with a String To Byte Array. It turns the type cast into a NoOp under the hood and is just a lot easier to read.

I also highly recommend you turn on the Display Style for all of your string controls and indicators (Right-Click->Visible Items->Display Style). This is a way of making sure you know how your data is encoded and eliminate a lot of confusion.

CT003 CRC checksum.vi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.