08-18-2024 11:22 AM - edited 08-18-2024 11:25 AM
Dear All,
I hope you all are doing well.
Basically, I want to implement a 16-bit checksum technique.
Data Received = 15 Bytes
AA55 0102 0B21 1101 3E00 0000 0001 7E
01 7E is the Checksum
All data is in HEX format.
I want a cumulative sum from Byte 1 to Byte 13.
Checksum is 16-bit.
I am facing issue in LabVIEW as my end result is showing me 8-bit result where as I've chosen the format as U16.
File is attached for your reference.
Please guide I want the calculated checksum and received checksum to be same.
08-18-2024 12:40 PM
Hello,
I have modified your code to check the checksum. Please try to use the snippet.
Don't forget to mark as solution, if you feel that the code helped you complete the task.
Kudos are welcome.
Atul G.
India
08-18-2024 01:43 PM
Dear Atul,
Thanks for your kind response and the time you've given to modify the file.
I have compatibility issues while opening the file. I am using LabVIEW 2017. Can you please share the compatible version?
Thanks!
08-18-2024 01:53 PM
Yes. PFA
08-18-2024 03:53 PM
Dear Atul,
Thanks for your time.
Unfortunately, it's the same as mine.
See the checksum shown here is just 7E
whereas the actual checksum is 01 7E.
01 is missing again.
It's just showing the LSB of the checksum i.e. 7E
MSB of checksum is missing i.e 01.
Please modify the below file.
Version: 2017
08-18-2024 07:20 PM - edited 08-18-2024 07:20 PM
This worked for me. The real trick is to make sure you are adding U16 instead of U8. When adding U8, you will get a rollover.
08-19-2024 08:04 AM
Looking at your data, I'm guessing that the "data" are 13 8-bit quantities, and the Checksum is a 16-bit sum of the preceding 8-bit values. That turns out to work -- if you simply sum the first 13 quantities into a U16, you get 017E.
Bob Schor