LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

64-Bit Hexadecimal to 64-Bit Binary

Is there a VI that will allow me to convert and display a 64-bit hexadecimal number to a 64-bit binary number? I need such a vi for an application and any help would be greatly appreciated.
0 Kudos
Message 1 of 6
(4,886 Views)
Labview under Windows cannot display a 64 bit numeric in hex or binary. Labview can display only integers as hex or binary. The largest interger in Windows is 32 bit.

You can display 64 bit (or larger) hex or binary strings. But the display is only a string. You can convert the large hex string to a double and display it only as decimal.

There are drawbacks using strings instead of numerics. You can't easily add increment/decrement arrows. You have to validate input characters. You have to convert the string to a value to operate on it.

See the attached LabView 6.1 example.
Message 2 of 6
(4,886 Views)
Azmat Bhatty wrote in message news:<50650000000800000027680000-1031838699000@exchange.ni.com>...
> Is there a VI that will allow me to convert and display a 64-bit
> hexadecimal number to a 64-bit binary number? I need such a vi for an
> application and any help would be greatly appreciated.

If you are trying to dispay the result on the front panel, then that
is easy.
Take your number and run it into a format value.vi and wire in %b into
the format string (on the controls pallette it is under String
pallette, string/Number conversion subpallette) If you have trouble
finding or understanding please post a follow-up with an email, and I
will send an example.
0 Kudos
Message 3 of 6
(4,886 Views)
I can display the 64-bit number(it's actually a string) without a problem. Now I just need to find a way to convert that into a number and send it via the SPI interface.

My e-mail is abhatty@aoc.nrao.edu
0 Kudos
Message 4 of 6
(4,886 Views)
You can't enter a 64 bit value as a number in hex in Labview and Windows. See my earlier answer to this question.

It doesn't look like this approach (using the Format Number function) works for 64 bit numbers, even entered in decimal. The Format Value function seems to treat the input value as I32 (32 bit signed integer) when you use %b, %d, %x, etc. Try it: enter a value of 2147483647.00 (7FFFFFFF hex, the highest signed 32 bit integer) and check the result. Then increment the value to 2147483648.00 (or higher): the result doesn't change.

Look at my earlier answer with the example which deals with large numbers as strings (with some stated drawbacks).
0 Kudos
Message 5 of 6
(4,886 Views)
Did you look at the example in my previous answer? It takes a 64 bit hex string and converts it to a 64 bit binary string and a double precision numeric.

What is the SPI interface and what does it have to do with Radio Astronomy? Do you send data in packets, bytes, or a bit at a time?

If you need to send the data in bytes, look at my examples here.
These examples convert a double precision numeric to an array of bytes. The example in my earlier answer to your question takes a long hex string and converts it to a double. Put the two together and you can convert a long hex string to a
n array of bytes.
0 Kudos
Message 6 of 6
(4,886 Views)