From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Checksum data is not match the expected value, urgent a bit.

Solved!
Go to solution

Hello, 

I'm struggling one item for 3 days in a row. and can't find the reason. It's a bit urgent actually. 😞

So, kindly asking you about not the same the value with expecting checksum value.

 

Checksum spec: directly add in 2 bytes format. i.e. Checksum value = 0xC000 + 0x0000 + ... + 0xEFBE + 0xADDE.

 

I thought it's very simple and made a VI. (Attached) However, it's not working. 

Expecting checksum : 0x8644, Actual checksum: 0x0482. 

Capture1.PNG

Capture.PNG

Could you check this VI? I also included the raw data value in the VI. 

 

Thanks in advance.

 

 

Best Regards,
-----------------------------------------------------------------------------------------------------------


0 Kudos
Message 1 of 16
(4,557 Views)
Solution
Accepted by gooohestpoo

Try this:

2byte CS.png

Lucian
CLA
Message 2 of 16
(4,504 Views)

Hello, 

 

Thank you very much for your nice scratch!! It works and solved all problems just at one time.

Thank you and have a nice day!!

Best Regards,
-----------------------------------------------------------------------------------------------------------


0 Kudos
Message 3 of 16
(4,497 Views)

Hi Community,

I have searched for hours, but could not find a solution. I'm using a Synrad UC2000 laser controller vial serial communication. It can be run in two modes, with and without checksum. I ran it without checksum, so far, and it worked OK, but there were communication problems and I want to switch to the recommended mode with checksum at the ent of the hexadecimal command string. A command string (3 Byte) looks like this:

5Bh 79h and then the "One's compliment (bit inversion)" checksum Byte 86h. This was given as an example ad that command works. Now, I'm unable calculating the checksum (here 86h) from "bit inversion" of the command byte (which is 76h). I have to do that for other commands. I attach a VI and would be bery grateful if any of you could give me a hint.

Andreas

 

0 Kudos
Message 4 of 16
(4,068 Views)

0x86 is the negated value of 0x79. Can you post the whole explanation from the user manual about the checksum byte calculation? Also would be nice to attach the VI in a previous LabVIEW version (18 or older).

Lucian
CLA
0 Kudos
Message 5 of 16
(4,057 Views)

Hi Lucian, thanks for the quick reply. I attach the VI for Version 12. I also attach the documentation about how to calculate the checksum. Andreas

Download All
0 Kudos
Message 6 of 16
(4,051 Views)

It's clear to me: you have to negate the command byte to get the checksum byte. So for command byte 0x79 you should send 0x5B (STX) 0x79 (command) 0x86 (CS).

Lucian
CLA
0 Kudos
Message 7 of 16
(4,040 Views)

Hi Lucien. Yes. That's correct. But I have trouble calculating the 0x86 from the 0x79 byte. It comes as hexadecimal string, so simply negating (times -1) does not work here. I have converted the string to a byte-array and inverted that. But that does not give me the correct checksum. Any hnt how to get 0x86 from 0x79? Andreas

0 Kudos
Message 8 of 16
(4,034 Views)

Something like this:

Synrad UC2000 Command.png

Lucian
CLA
Message 9 of 16
(4,030 Views)

Perfect. That works. Thanks a lot.

0 Kudos
Message 10 of 16
(4,020 Views)