ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

float to hex string

Hi mom,

you can typecast any datatype to string:



Message Edited by GerdW on 03-25-2008 10:05 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 21 of 25
(1,196 Views)
Hi Partha,

you can also use hex notation for floats! (You can use any base for floats - integers are just some special floats!)

Example: 24.25 (base10) = 18.4 (base16) = 11000.01 (base2) = 30.2 (base8) = 22.02(...) (base3)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 22 of 25
(1,192 Views)

Hi GerdW,

But you cannot enable the HEX Radix for a Sgl/Dbl, right... ?! Smiley Happy

How can you display the Float in its equivalent HEEX, then? Smiley Indifferent

I think I m not getting your point still. Smiley Sad Can you elaborate a bit more?

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 23 of 25
(1,190 Views)
Hi Partha,

yes, the controls/indicators for floats don't provide a hex display. On the frontpanel you see a decimal representation whereas LabView (or the CPU) is using a (kind of) binary representation for calculation...
 
But mom was asking for a "conversion to hex"! And you can convert floats to hex "display" (string!): division by base for integer part, multiplication by base for fractional part, concat all digits to a string!


Message Edited by GerdW on 03-25-2008 10:38 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 24 of 25
(1,183 Views)
Would that be a bad time to bring up Endianness? 😄
 
It could certainly be an issue when flattening multibyte data to a string.
Message 25 of 25
(1,157 Views)