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.
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.
11-24-2020 08:46 AM
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
11-24-2020 09:08 AM
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.
11-24-2020 09:32 AM
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.
11-24-2020 09:59 AM
@pincpanter is right, I think this should work:
11-24-2020 10:10 AM
Hi Paolo & Lucien,
awsesome. Works perfectly now. Thanks a lot for your time.
Andreas
11-27-2020 07:41 AM
@LucianM wrote:
@pincpanter is right, I think this should work:
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.