SPLat Logo

fIEEEtoWR [D>=21]

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

fIEEEtoWR [D>=21]

Converts the data in W from big endian IEEE754 floating point format to SPLat floating point format, with the word order reversed. This is used when transferring floating point data from a 3rd party device, say an HMI, to the SPLat. The word order reversal swaps the first two bytes with the 2nd two bytes. This is done to provide compatibility with certain 3rd party devices that use reversed word order. In general, different companies handle floating point formats in different ways, so compatibility can be elusive.

Explanation: The floating point format adopted in SPLat is a special format designed to be more efficient for implementation in an 8-bit processor. It keeps mantissa and exponent in separate bytes, whereas in IEEE they cross byte boundaries.

A typical use scenario would be that you are using ModBus to transfer a floating point number from an external 3rd party HMI to the SPLat. The number winds up in 4 bytes of SPLat RAM, but is in IEEE format. To swap word order and convert to SPLat format for further use you get it into W using fRecallW then you use fIEEEtoWR.

Dialect restriction: Available only in boards with dialect 21 or greater.

See also fIEEEtoW, fWtoIEEE, fWtoIEEER, FixToMem16U, FixToMem16S, FloatMem16U, FloatMem16S