LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex string cksum XOR

Solved!
Go to solution

Hi,

 

I try to calculate cksum for hex string. but I can't get right result. I use MS calcuator, I got result "cksum = 51" and I use labview 8.5. I got the result " cksum = 11. Can anyone tell me what I did wrong?

 

Thanks,

 

Johnny

 

 

calculate Hex string cksum.png

0 Kudos
Message 1 of 8
(4,975 Views)

It looks like you are using OR instead of XOR.  I recommend building the bytes into an array and use a FOR loop and shift register to XOR all of the elements together.

Nevermind, just started looking at the VI instead of the picture.  This is actually a Decimal vs Hex problem.  Right-click on your constants and select Visible->Radix.  You will see a little 'd' next to your numbers.  This shows that your constants are in decimal notation.  You can click on the 'd' and choose Hex.  The radix will now display as a 'x'.  Fix your constants to be what they really should be.  Do the same thing to your output indicator to show the value in hex.


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
Message 2 of 8
(4,969 Views)
Solution
Accepted by topic author Jlin

The math in my head suggests that you probably are entering decimal values into those constants and not hex values.  Right click them all and set the display format to Hexadecimal (and show the radix!).  Do the same for your indicator.

0 Kudos
Message 3 of 8
(4,961 Views)

yeah, It works.

 

Thanks, Darin

 

Johnny

Message 4 of 8
(4,946 Views)

JIN @

HEY CAN U UPLOAD UR UPDATED VI PLEASE..!! IM FACING SAME PROBLEM

0 Kudos
Message 5 of 8
(4,360 Views)

@crossrulz wrote:

It looks like you are using OR instead of XOR.  I recommend building the bytes into an array and use a FOR loop and shift register to XOR all of the elements together.

Nevermind, just started looking at the VI instead of the picture.  This is actually a Decimal vs Hex problem.  Right-click on your constants and select Visible->Radix.  You will see a little 'd' next to your numbers.  This shows that your constants are in decimal notation.  You can click on the 'd' and choose Hex.  The radix will now display as a 'x'.  Fix your constants to be what they really should be.  Do the same thing to your output indicator to show the value in hex.


I'll give you a kudo since you didn't get a solution.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 8
(4,357 Views)

Hi minakshi,

 

there is a VI and you can read above how to change this VI to get a working solution! What else do you need?

All you need for your other thread is the XOR function as already suggested here

 

And please stop SHOUTING OUT LOUD - it's considered rude behaviour in public forums!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(4,352 Views)

thanks billko.! i will check out this.

0 Kudos
Message 8 of 8
(4,349 Views)