A 32-bit floating-point value has to travel across two 16-bit registers, and there is no universal agreement on which half goes first or how the bytes inside each half are ordered. That leaves four possible arrangements of the same four bytes, and only one of them decodes to the number the device meant to send. This guide focuses on the practical troubleshooting angle: the difference between a word swap and a byte swap, why the wrong one produces garbage or NaN, and how to diagnose the right arrangement from a known reference value.
Word Swap and Byte Swap in one line: A word swap reverses the order of the two 16-bit words that make up a 32-bit float, while a byte swap reverses the two bytes inside each word. Because a float spans two registers with no universal ordering, its four bytes can arrive in one of four combinations, and applying the wrong word or byte swap reassembles them into a wrong number or NaN rather than the intended value.
A 32-bit float is four bytes, carried as two 16-bit words across two consecutive registers. Two independent questions determine how those bytes line up. The first is word order: does the register holding the high-order half arrive first or second. Reversing that is a word swap, and it is the more common of the two variations because so many controllers and flow computers send the low word first. The second question is byte order within each word: inside a single register, does the high byte or the low byte come first. Reversing that is a byte swap.
Because the two swaps are independent, they multiply into four possible arrangements of the same four bytes, usually written with shorthand like ABCD, CDAB, BADC, and DCBA, where each letter is one byte in the order it arrives. ABCD is the straight arrangement with no swapping. CDAB is a pure word swap, keeping each register's bytes intact but reversing the two registers. BADC is a pure byte swap, keeping register order but flipping the bytes inside each. DCBA is both swaps at once, a full reversal. A float that decodes wrong is almost always one of these permutations away from correct.
The reason all four exist is that the ordering inside one register is standardized in Modbus while the order of registers for a multi-register value is not, so vendors chose differently. That leaves the word-swap question genuinely open per device, and some devices add a byte swap on top. The practical consequence is that word swap and byte swap are two separate settings you may each need to toggle, and getting a float right means picking the combination of the two that matches how a given device actually transmits.
A float is not a plain integer; its four bytes are divided into a sign, an exponent, and a fraction, and the exponent bits carry enormous leverage over the result. When the bytes are reassembled in the wrong order, the bits that were meant to be the fraction can land where the exponent belongs and vice versa. Because the exponent scales the value by powers of two, a misplaced exponent can turn a modest number into an astronomically large or vanishingly small one, which is why a mis-swapped float so often reads as a wildly wrong magnitude rather than a value that is merely a little off.
The same mechanism explains NaN. Certain bit patterns in the exponent field are reserved to mean not-a-number, so if a wrong swap happens to place bits that form that reserved pattern into the exponent, the decoded value is NaN even though the original number was perfectly ordinary. A reading that shows up as NaN is therefore a strong hint of a byte-order problem rather than a sensor fault, because a healthy sensor sending a real value should never produce a genuine NaN.
This is what makes float order errors easy to recognize once you know the signature. A status bit packed into a single register decodes fine regardless, so digital points look healthy and lull you into thinking the link is good. The float values, though, come out as huge numbers, tiny numbers, or NaN, all clustered on the two-register points. When only the floats and long integers are broken and the single-register values are fine, the diagnosis is almost never the field wiring or the sensors; it is the word or byte swap on the multi-register values.
The dependable way to find the correct arrangement is to force a value you already know and see which swap combination reproduces it. Ask the device to report something predictable, a fixed engineering value, a totalizer you can read off its local display, or a documented test register, then try the four orderings until the decoded number matches the known one. Vendor documentation usually states the order, but manuals are sometimes ambiguous and firmware revisions can differ, so a live confirmation against a reading you can independently verify is the trustworthy check.
Working through the four is systematic rather than guesswork. Start with the straight ABCD arrangement; if that is wrong, try the pure word swap, which is the single most common culprit, then the pure byte swap, then the full reversal. Because there are only four, you will find the match quickly, and once you do you can be confident the whole device family uses it. The discipline is to record which combination each device profile needs, since two devices on the same serial line can legitimately use different orders and you do not want to rediscover this every time.
In a cloud SCADA such as Merobix, the fix lives entirely in the point configuration, not in the field wiring. Each multi-register point is mapped with an explicit data type and the word and byte order the device uses, so a controller that sends word-swapped floats is normalized to the correct value at the platform without touching the device. Pinning this down once per device profile means every float from that family lands correctly and keeps landing correctly as more identical sites are added, which matters most for totalizers feeding measurement and accounting, where a mis-decoded value is not a cosmetic glitch but a wrong number on a report.
A word swap reverses the order of the two 16-bit registers that make up a 32-bit value, so the low-order word arrives where the high-order word was expected. A byte swap reverses the two bytes inside each individual register. They are independent, so a float can need a word swap, a byte swap, both, or neither, which is what produces the four possible arrangements.
A float's bytes include an exponent field, and certain exponent bit patterns are reserved to mean not-a-number. When a wrong word or byte swap reassembles the four bytes in the wrong order, it can place bits forming that reserved pattern into the exponent, so the value decodes as NaN even though the original number was ordinary. A NaN on a two-register point is a strong sign of a byte-order problem, not a sensor fault.
Force a value you can independently verify, such as a totalizer readable from the device's local display or a documented test value, then try the four arrangements until the decoded number matches. The pure word swap is the most common fix, so try it early. Record the combination that works for that device profile, since different devices can legitimately use different orders and you want to configure it once rather than rediscover it.
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.
Merobix reads your field devices into a cloud SCADA - the real thing behind these terms, live in days from any browser.