Automation Glossary • 32-Bit Float Across Two Modbus Registers

A 32-Bit Float Across Two Modbus Registers

Merobix Engineering • • 7 min read

A Modbus register holds sixteen bits, but a floating-point flow rate or totalizer needs thirty-two, so the value has to span two registers read together as a pair. That pairing is where a clean measurement so often turns into apparent garbage: read the two registers in the wrong order, or with the bytes swapped, and the same bits decode to a wildly wrong number. This guide explains how a flow computer packs an IEEE-754 float into two consecutive registers, why the reading looks broken until the pairing is right, and how to verify it on a live poll.

Back to Blog

32-Bit Float Across Two Modbus Registers in one line: A 32-bit IEEE-754 float does not fit in a single 16-bit Modbus register, so a device places it across two consecutive registers that must be read together and reassembled into one number. The 32 bits carry a sign, an exponent, and a fraction that only mean the intended value when the two registers and their bytes are combined in the order the device used. Because Modbus does not standardize that word order, the same pair of registers can decode to a correct flow rate or to nonsense depending on how the master pairs them.

Why One Float Takes Two Registers

The IEEE-754 single-precision format represents a real number in 32 bits: one sign bit, eight exponent bits, and twenty-three fraction bits, which together encode a wide range of magnitudes with fractional precision. A gas flow rate of, say, a few thousand standard cubic feet per hour, or a totalizer counting volume over time, needs exactly this kind of representation because it carries a decimal part and spans orders of magnitude that a plain 16-bit integer cannot express without awkward scaling.

A Modbus register, however, is only sixteen bits wide, half of what a single-precision float requires. So a device that wants to expose a float has no choice but to split those 32 bits across two adjacent registers and expect the master to read both and glue them back together. This is why flow computers and analyzers so often list a single measurement as occupying two register numbers - the value is one number conceptually but two registers physically, and the master must fetch the pair and reconstruct the float from all 32 bits.

Reading only one of the two registers gives you half the number, which is meaningless on its own - one register holds part of the exponent and fraction, the other the rest, and neither half decodes to anything useful alone. The master therefore has to know that a given value is a two-register float, read both registers in a single operation or as an adjacent pair, and interpret the combined 32 bits as IEEE-754. Treating either register as a standalone integer produces a number with no relation to the real measurement.

Why the Reading Looks Like Garbage

The trouble is that Modbus defines byte order within a single register but never standardized the order of the two registers that make up a 32-bit value, so device makers chose differently. One device places the register holding the more significant half first, another places the less significant half first, and some additionally swap the two bytes inside each register. The float only decodes correctly when the master reassembles the four bytes in the exact order the device wrote them, and because there are multiple plausible orderings, guessing wrong is common.

When the order is wrong, the failure is dramatic rather than subtle. Floating-point encoding concentrates enormous meaning in the exponent bits, so shuffling which bits land in the exponent position can turn a modest flow rate into an astronomically large number, a tiny fraction, a negative value, or a not-a-number result. This is why a mispaired float reads as obvious garbage - values like ten to the thirtieth power or wildly negative flows - rather than a plausible near-miss. The good news is that this obviousness makes the problem easy to spot: a nonsensical magnitude is a strong signal that the word or byte order, not the register address, is wrong.

The variable that fixes it is word order and byte order, the same set of combinations that governs any multi-register value. A float can be arranged with the high word first or the low word first, and with bytes in normal or swapped order inside each word, giving a small set of combinations to try. Only one of them yields the correct number, and the master must be configured to match the device's choice. This is a distinct step from getting the register address right - the address can be perfect while the pairing order is wrong, which is precisely why a correctly located float can still read as garbage.

Verifying the Pairing on a Live Poll

The fastest way to confirm the pairing is to compare a live poll against a value you already know. Flow computers typically show the same flow rate or totalizer on a local display or in vendor software, so poll the two-register value, decode it with a chosen word order, and check whether it matches the displayed reading. If it matches, the pairing is right; if it comes back as an absurd magnitude, switch the word order or byte order and read again. With only a handful of combinations, cycling through them against a known value quickly finds the correct one.

A second confirmation is to watch the value move. Real flow rates and totalizers change over time in expected ways - a totalizer only counts upward, a flow rate tracks operating conditions - so a correctly decoded float will behave sensibly on a trend while an incorrectly paired one jumps between meaningless extremes. Observing the value over a short poll session, rather than trusting a single sample, distinguishes a genuinely correct decode from a wrong pairing that happened to produce a not-obviously-crazy number on one read.

In a cloud SCADA this verification is part of commissioning each analog tag. When Merobix polls a flow computer over Modbus, a 32-bit float tag is configured with its two-register base offset and a word-and-byte-order setting, and the integrator confirms the decoded value against the flow computer's own display before trusting the trend. Getting the pairing right once, and verifying it against a known reading, is what turns a stream of garbage into a dependable flow or totalizer trend - and doing it at commissioning avoids the far worse situation of a float that silently reads wrong long after anyone is watching the display.

Frequently Asked Questions

Why does a 32-bit float need two Modbus registers?

A single-precision IEEE-754 float is 32 bits wide - one sign bit, eight exponent bits, and twenty-three fraction bits - but a Modbus register holds only sixteen bits. So a device splits the 32 bits across two consecutive registers, and the master must read both and reassemble them into one number. Reading only one register gives half the value, which decodes to nothing meaningful on its own.

Why does my Modbus float read as a huge or negative number?

Almost always because the two registers, or the bytes within them, are combined in the wrong order. Modbus does not standardize the order of the two registers in a 32-bit value, so if the master pairs them differently from how the device wrote them, the bits land in the wrong positions - and because the exponent bits carry so much weight, the result is often an astronomically large, tiny, or negative value rather than a near-miss. Adjusting the word and byte order fixes it.

How do I verify a 32-bit float is decoded correctly on a live poll?

Compare the decoded value against a known reference, such as the flow computer's local display or vendor software showing the same flow rate or totalizer. Poll the two-register value, try a word-and-byte-order setting, and check whether the result matches; if it is nonsensical, switch the order and read again. Also watch the value over time - a correct float behaves sensibly, while a mispaired one jumps between meaningless extremes.

Sources and verification

This page references the protocol specifications published by the organizations below. Editions, product capabilities, and documentation change over time - confirm current requirements and specifications directly with the source.

Last reviewed: July 27, 2026. Merobix is not affiliated with, endorsed by, or sponsored by these organizations; their names are used only to identify the standards and products discussed.

From Definitions to a Live Dashboard

Merobix reads your field devices into a cloud SCADA - the real thing behind these terms, live in days from any browser.

Request a Free Demo +1 (903) 307-7300
More in Automation Glossary
Modbus TCP vs Modbus RTU  •  DNP3 Object Groups and Variations  •  DNP3 Point Index  •  DNP3 Master and Outstation Addresses  •  OPC UA Node ID  •  OPC UA Address Space and Information Model  •  All Automation Glossary →
Free SCADA operator training
Merobix University - 70 video lessons & 261 quiz questions, from first login to compliance reporting. No demo call required.
Start free →