LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Xor operation for Hex Values

Solved!
Go to solution

Dear sir,

I have to apply Xor operation for 03, 01, 57 & C9 Hex values.

In programmer Calculater I have applied like: "03 Xor 01 Xor 57 Xor C9 = 9C". Finally the output is 9C.

How to implement the same operation LabVIEW?

 

Regards,

S Nagaraju

 

 

0 Kudos
Message 1 of 7
(4,703 Views)
Solution
Accepted by topic author Sonti_11532

Try this

 

Xor.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 2 of 7
(4,691 Views)
Solution
Accepted by topic author Sonti_11532

Other options:

check.png

The FOR loop is more "scalable"…

Best regards,
GerdW


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

Thanks for the replay.

 

Actually the Hex Values are available in string format and seperate into bytes.

Please check the attached snippet and let me know still if any simplification possible.

 

Xor.png

 

Regards,

S Nagaraju

0 Kudos
Message 4 of 7
(4,663 Views)
Solution
Accepted by topic author Sonti_11532

Hi Sonti,

 

you don't need to split the string:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 7
(4,656 Views)

Thanks for the replay,

Depending on my application my string length may vary. In that case i can use a for loop with exclusive or function after type cast right.

Xor1.png

 

Rhanks & Regards,

S Nagaraju.

0 Kudos
Message 6 of 7
(4,650 Views)

You can both the ways, glad that both arrived at same method

 

Xor.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 7
(4,618 Views)