LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Floating Point Decimal to Hex

In my application I make some calculations using floating point format DBL,and need to write these values to a file in IEEE 754 Floating Point Hex format. Is there any way to do this using LabVIEW?
0 Kudos
Message 1 of 5
(6,038 Views)
To convert from DBL to Hex, have you tried the "Number to Hexadecimal String" VI In the String > String/Number Conversion palette?
0 Kudos
Message 2 of 5
(6,038 Views)
This is a great way of do it as long as one is dealing with integers. If that is not the case I do not think there is a short-cut soloution in LabVIEW. /Mikael
0 Kudos
Message 3 of 5
(6,038 Views)
Another thing to try is type casting. This can be found under Functions> Advanced> Data Manipulation> Type Cast on the block diagram. Type casting works for many other types of conversions as well.
0 Kudos
Message 4 of 5
(6,038 Views)
Mike,
Good news. LabVIEW has a function that does exactly what you want. It is well hidden though...

In the Advanced/Data manipulation palette there is a function called Flatten to String. If you feed this funtion with your DBL precision digital value you get the IEEE-754 hexadecimal floating point representation (64 bit) at the data string terminal (as a text string).

I attached a simple example that shows how it works.

Hope this helps. /Mikael Garcia
Message 5 of 5
(6,038 Views)