LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

operations with hexadecimal numbers

As part of my work I shall perform operations like OR, XOR operations with hexadecimal numbers. I don't find any block can perform these.....So, I have used from functions palette =>> Mathematics =>> "mathscript" function and wrote MATLAB code to perform these operations. after this I converted back to Hex. number and tried to used in my work but after this process a 1-byte hex number (for ex. B5 H or 0xB5) size increased to 2-bytes with same visibility (means it is showingup as still B5 H, but with 2 bytes size). I hope you got my qusetion..........!!!!!  Please help me, to get out of this problem............how to get above operations without changing it's size......I need only 1-byte size to make use of it.
 here I am giving the procedure how I am doing ..........

for example:::: to perform 0x32 OR 0x80........I am converting these two in decimal using 'hex2dec' function and doing 'bitor' and after this 'dec2hex'......sothat result will be in hex......It's giving exact answer as I wanted but with 2-bytes size......(hex2dec,bitor,dec2hex are MATLAB commands).

2) I have one more doubt but not related to above question........we can change the display(indicator) according to our requirements......like normal, hex, binary etc.....but how to make use of same changed radix no. in futher ckt........!!!!!!

I am new to LabVIEW......in basic level......
Excuse me if I post in wrong place......and inform, where to post.......

Thank you,

Ravinder
0 Kudos
Message 1 of 6
(5,561 Views)

I would recommend posting whatever sample code you have so far.  You may be making this much more complicated than it really is.

What are your inputs?  Are they strings with the characters B and 5?  Is it a single string character of ASCII value hexB5?  Is it a numeric integer?  If it is an integer, what is its numeric representation I8, U8, I16, U16 ....?

If they are integers with a hex display setup, you would be able to directly OR them together.


 


@Ravi0709 wrote:

2) I have one more doubt but not related to above question........we can change the display(indicator) according to our requirements......like normal, hex, binary etc.....but how to make use of same changed radix no. in futher ckt........!!!!!!


What does "ckt" mean?  Remember, the format and precision just determine how the value is displayed.  And the radix is just a visual indicator of the format.  They still have the same value no matter how it is displayed.

Message Edited by Ravens Fan on 10-16-2007 09:38 AM

0 Kudos
Message 2 of 6
(5,551 Views)
Hi
   Perform HEX operations is quite simple.... just use logic functions, controls, and indicators.... set to display HEX...

   Report if you have more questions!!!

graziano
0 Kudos
Message 3 of 6
(5,545 Views)
As I told you I am new to LabVIEW.............till now Ididn't try in this way.............. means connecting U8 type to or gate.......actually i always right click at the terminal ends and use only those input......I didn't know that we can chage to our required input.......thank you very much.....it' s really simple............
0 Kudos
Message 4 of 6
(5,540 Views)
and you can do it also with ARRAYS! Maybe you'll need it! Smiley Wink
0 Kudos
Message 5 of 6
(5,533 Views)
Did you see the OR, AND, XOR, etc. located in the Boolean palette? You can
wire integers to it, as well as booleans.

Regards,

Wiebe.


0 Kudos
Message 6 of 6
(5,520 Views)