Numbers & bits

Float & Register Decoder

Decode IEEE-754 float32 bytes or encode a REAL value. Compare four byte orders, two register values and the underlying bits.

YOUR INPUTS

LIVE RESULT

Decimal REAL value1
Four hex bytes
3F 80 00 00
First register (decimal)
16256
Second register (decimal)
0
Canonical IEEE bytes
3F 80 00 00
IEEE-754 class
Normal

Calculated

The decimal output is the stored float32 value, including rounding.

FOLLOW THE SIGNAL
Float & Register DecoderWIRE BYTE ORDERR03FR080R100R10000111111100000000000000000000000SIGNEXPONENTFRACTION
THE RELATIONSHIPs = 0, e = 127, f = 0

How to use this on a job

Two good register reads can still produce a nonsense temperature. Modbus tells you how bytes travel inside a register; your device manual tells you how the two registers form a 32-bit value. Those are separate decisions.

  1. 01

    Choose encode to turn a decimal REAL into four bytes, or decode to inspect four captured hexadecimal bytes. For two decimal register values, first convert each to four hex digits using the integer tool.

  2. 02

    Choose the byte order stated by the device. A, B, C and D name the bytes from most to least significant in the canonical IEEE-754 representation. ABCD preserves them; CDAB swaps the words; BADC swaps bytes within each word; DCBA reverses all four.

  3. 03

    Read the sign, biased exponent and fraction. The decimal result is the actual stored float32, so 0.1 does not come back as exactly 0.1. Compare a known process value before accepting an order.

Work through one example

3F 80 00 00 → 1.0

REAL 1.0 has canonical bytes 3F 80 00 00. In ABCD order the registers are 16256 and 0. In CDAB order they are 0 and 16256. The information has not changed; its placement has. Try 0.1 to see float32 rounding directly.

Before you trust the answer

A plausible value is not proof of correct byte order. Check the register map, data type and a second known operating point. Special patterns such as NaN are decoded explicitly; this tool does not replace them with zero.

TRYPLC FIELD REFERENCE / 01

Float & Register Decoder

Decode IEEE-754 float32 bytes or encode a REAL value. Compare four byte orders, two register values and the underlying bits.

  • Float32: 1 sign + 8 exponent + 23 fraction bits
  • Normal: (−1)ˢ × (1 + f/2²³) × 2ᵉ⁻¹²⁷
  • Exponent 0: zero or subnormal
  • Exponent 255: infinity or NaN
Float & Register DecoderWIRE BYTE ORDERR03FR080R100R10000111111100000000000000000000000SIGNEXPONENTFRACTION

How to use this on a job

Two good register reads can still produce a nonsense temperature. Modbus tells you how bytes travel inside a register; your device manual tells you how the two registers form a 32-bit value. Those are separate decisions.

  1. 01

    Choose encode to turn a decimal REAL into four bytes, or decode to inspect four captured hexadecimal bytes. For two decimal register values, first convert each to four hex digits using the integer tool.

  2. 02

    Choose the byte order stated by the device. A, B, C and D name the bytes from most to least significant in the canonical IEEE-754 representation. ABCD preserves them; CDAB swaps the words; BADC swaps bytes within each word; DCBA reverses all four.

  3. 03

    Read the sign, biased exponent and fraction. The decimal result is the actual stored float32, so 0.1 does not come back as exactly 0.1. Compare a known process value before accepting an order.

Work through one example

3F 80 00 00 → 1.0

REAL 1.0 has canonical bytes 3F 80 00 00. In ABCD order the registers are 16256 and 0. In CDAB order they are 0 and 16256. The information has not changed; its placement has. Try 0.1 to see float32 rounding directly.

Before you trust the answer

A plausible value is not proof of correct byte order. Check the register map, data type and a second known operating point. Special patterns such as NaN are decoded explicitly; this tool does not replace them with zero.

https://tryplc.com/tools/float-register-decoder