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.
Could you check this VI? I also included the raw data value in the VI.
Thanks in advance.
Solved! Go to Solution.
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!!
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.
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).
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).
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