Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Hexadecimal to float-point?

Hi, i'm working with modbus and i get a hexadecimal value but i need the value in float-point format, can help me??
0 Kudos
Message 1 of 3
(3,058 Views)
Hi Arsintek,

What programming language are you using to read in the data and do the conversion?  In LabVIEW, there is a hexidecimal string to decimal number VI in the string palette that may do exactly what you are looking for.  The method to convert the datatype will be different for different programming languages.

john m
Applications Engineer
0 Kudos
Message 2 of 3
(3,040 Views)

Is your problem just a matter of display, or are you receiving a floatting point number under machine format (ie 4 bytes for a single precision float) ?

In the latter case, use the type cast function as in the attached vi. Depending on the connected instrument, you may need to revert the byte order in your hex number to read something understandable.

 

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 3 of 3
(3,035 Views)