LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1's complement

Solved!
Go to solution

Hi,

I want to convert my data into 1's complement so can anybody suggest any soluton for that. Here i have attached my vi so according to this if i put my knob at -1 i am getting data after hex conversion is FFF  and for +1, 001 but instead of that i want 000 and FFE repectively.

 

Thank you

0 Kudos
Message 1 of 5
(3,339 Views)
Solution
Accepted by spv162

Hi spv,

 

seems you need to subtract 1 from your conversion result:

check.png

Atleast this works according to your examples…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(3,332 Views)

This sort of does what you want except there are 4 characters Hex string when knob is greater than -1

 

Ken

0 Kudos
Message 3 of 5
(3,329 Views)

Thank you all i got my result.

0 Kudos
Message 4 of 5
(3,310 Views)

Hi spv,

 

according to Wikipedia "one's complement" is defined a little different to your explanation…

Best regards,
GerdW


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