LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

16-bit float

I am reading a 16-bit float value from another device ( PLC ). How to declare and handle a float with 16bit (two bytes).

 

In my old application this was OK. Now CVI takes 4 bytes for float and 8 bytes for double.

 

How to to have flat with two byte.

 

Regards,

E. Kumar

 

 

0 Kudos
Message 1 of 3
(1,032 Views)

There's no support for 16-bit or 24-bit floats in standard C. You will find some compiler support for dedicated hardware (DSPs but especially GPUs, which you should use for raw speed). And you'll also find conversion libraries (such as this https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/cellperformance-snip...) which is probably the solution you are looking for.

0 Kudos
Message 2 of 3
(1,025 Views)

There are at least three different float 16 definitions, but you probably have "IEEE 754 half-precision binary floating-point format: binary16". In the end it is just 16 bits and you can do whatever you want with them. You probably also need to worry about byte order (endian-ness).

 

Can you explain your term "handle" (Just store and shuffle around? do math?)

0 Kudos
Message 3 of 3
(1,012 Views)