Search found 3 matches

Return

by Benj
Fri Jan 24, 2020 2:26 pm
Jump to forum
Jump to topic

Re: FLOAT to INT and back again.

If you wanted to convert floats to 4 bytes then you would use the SetFloat function to load in the float and then call the GetByte function four times with indexes 0-3. The icon of the component on the panel should show how the values interrelate. Type.jpg This topic should help if you want to do th...
by kersing
Sun Feb 09, 2020 9:57 am
Jump to forum
Jump to topic

Re: FLOAT to INT and back again.

Change your union to:

Code: Select all

 typedef union
{
  float AsFloat;
  MX_UINT8 AsByte[4];
} MX_FloatUnion;

MX_FloatUnion FloatUnion;


Assign the value to AsFloat and get the bytes from the 4 AsByte vast like your earlier example.
by mnf
Mon Mar 30, 2020 2:32 pm
Jump to forum
Jump to topic

Re: FLOAT to INT and back again.

Yes,
Use FCL_ as the prefix to the uppercase name ( instead of FCV_)

Martin