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

Hi Lucian,I have one more question: For the laser power command, it is required to calculate the checksum (same method) of the sum of the Command (0x7F) and the data byte (the intensity as hexadecimal number). I tried that as shown in the attached VI (based on your suggestion, which works fine for only one byte), but this approach does not work. Can you tell me how to add the two Bytes (hexadecimal strings)? Thanks, Andreas

0 Kudos
Message 11 of 16
(1,295 Views)

Your code seems okay to me.  But why would you expect the checksum of 7F 30 to be the same as it was for 79?  It is a 1 in 256 chance that they would both result in 86.

0 Kudos
Message 12 of 16
(1,288 Views)

After the x2 multiplication you already got the byte value in U8.

Formatting this value to ASCII hex is wrong because the output is in general a two bytes string whose values don't correspond to the original byte value.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 13 of 16
(1,283 Views)

@pincpanter is right, I think this should work:

 

Synrad UC2000 Percentage Command.png

Lucian
CLA
Message 14 of 16
(1,272 Views)

Hi Paolo & Lucien,

awsesome. Works perfectly now. Thanks a lot for your time.

Andreas

0 Kudos
Message 15 of 16
(1,263 Views)

@LucianM wrote:

@pincpanter is right, I think this should work:

 

Synrad UC2000 Percentage Command.png


Instead of the Unflatten From String and the Flatten To String, use String To Byte Array and then Byte Array To String.  Those functions are actually noop (ie 0 CPU and memory use) and the rest of the functions will work just fine on the array of bytes.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 16 of 16
(1,230 Views)