PLC Playground guide cover: Modbus floating-point word order

Modbus Float Looks Like Nonsense? Fix Word Order Before Scaling

An enormous, tiny, or rapidly changing floating-point value can come from perfectly received registers interpreted in the wrong order. Keep the raw hexadecimal words visible while you diagnose the mapping. Multiplying the displayed number by a correction factor will not repair a bit-layout mismatch.

Original IEEE 754 example; multiword representation is device-specific.

What is happening?

A 32-bit value occupies two 16-bit registers. Modbus specifies byte ordering within its protocol fields, but the device's representation of a multi-register application value must come from its register map. The client must also distinguish reinterpreting an IEEE 754 bit pattern from numerically converting a 16-bit integer to a floating-point number.

Check these five things

  1. Confirm the register address and read both words in the same request where the device supports that operation.

  2. Check whether the map defines a float, signed integer, unsigned integer, or scaled integer. These are different representations.

  3. Record the two raw words in hexadecimal. Compare the documented high-word and low-word order with the client's options.

  4. Use several known test values in a simulator or approved device test mode. A zero alone cannot expose most ordering mistakes.

  5. Verify the displayed engineering unit after the bit interpretation works. Apply scaling only if the register map requires it.

Worked example

The IEEE 754 single-precision encoding of 1.0 is 0x3F800000. A map that places the high word first would return 0x3F80 followed by 0x0000. Reversing those words creates a different bit pattern. This example establishes a test case, not a universal register ordering.

Quick diagnostic reference

Observation Check
Huge or tiny float Word order and data type
Plausible number, wrong magnitude Documented scaling
Occasional impossible jump Coherent multi-register update

The mistake to avoid

A client option named byte swap may mean something different from word swap. Read its definition instead of cycling options until one value looks believable.

How to verify the fix

Validate positive, negative where supported, and noninteger values across the expected range. Preserve the raw-word evidence with the configuration.

Field-work boundary: These are educational diagnostic guides. Use the exact equipment manuals and approved site procedures. Electrical testing and machinery changes belong to qualified, authorized personnel; control hazardous energy and validate affected functions before release.

Technical reference

Modbus Organization: protocol definitions and device-integration guidance. The examples and diagnostic tables above are original teaching material; they do not replace the product manual.

Continue troubleshooting

Previous Post Next Post