Modbus input and holding registers are 16 bits wide. A 32-bit integer or IEEE 754 single-precision value therefore occupies two registers, but the core protocol does not turn that pair into a standardized 32-bit type. The device register map and client decoder must agree on how the two words form one application value.

This boundary explains why a Modbus read can be syntactically perfect and still produce a believable but wrong robot speed, position, load, or energy value. The function code, address, byte count, and checksum may all pass while the client combines the two registers in the wrong order.

Start with the core wire rule

The official Modbus Application Protocol describes each register as 16 bits. When a register value is carried in a message, the most significant byte is sent first. That byte order inside one protocol register is part of the core representation.

Do not blur that rule with the application convention for multiple registers. If four conceptual bytes are labeled A, B, C, and D, the device map decides which two bytes occupy the first addressed register and which occupy the next. Clients and vendor tools often describe layouts as ABCD, CDAB, BADC, or DCBA. Those labels are useful only when the documentation defines exactly what A through D mean.

The common phrase “little-endian Modbus” is too vague. It might refer to swapping the two 16-bit registers, swapping bytes during application packing, the native memory layout of a processor, or a client-library option. State the order at both boundaries instead.

Write a complete decoding contract

For every multi-register item, record function and table, zero-based protocol address, displayed reference if different, register count, data type, signedness, register order, scaling, units, range, invalid sentinel values, and firmware or map revision. Include access mode and update behavior.

For example, a contract can say that holding registers at protocol offsets 120 and 121 contain one IEEE 754 binary32 value, with the high-order 16-bit word at offset 120, no additional byte swap within a register, scale 1, units degrees Celsius, and validity controlled by a status bit. That is testable. “Float at 40121” is not.

Keep configuration close to the decoder. A generic per-device “swap words” checkbox can silently change unrelated points that use different vendor conventions. Prefer typed map entries and explicit transformations reviewed with the source document.

Do not trust plausibility

Many wrong layouts decode to finite numbers. An encoder count can remain within a broad range after a word swap. A floating-point bit pattern can become a tiny denormal, a large but possible number, or another ordinary value. Range checking helps, but it cannot establish the layout alone.

Use a known test pattern whenever the device supports simulation, forcing, or a diagnostic register. A value with distinct bytes makes swaps visible. For a float, choose several safe values whose bit patterns exercise all byte positions; avoid validating with zero because every order still looks like zero.

Compare the captured register bytes, the documented layout, and the decoder result. Retain that golden vector in automated tests. Repeat it after firmware, gateway, client-library, and register-map changes.

Validate the data model too

Register order is only one possible mismatch. The same two registers could represent an unsigned 32-bit integer, signed two's-complement integer, IEEE 754 float, fixed-point value, bit field, or vendor-specific encoding. Scaling and units may be applied before or after conversion according to the device documentation.

Test boundary values: zero, negative numbers where valid, maximum and minimum integers, fractional values, invalid sentinels, and floating-point NaN or infinity behavior. Decide whether non-finite values are rejected, retained for diagnostics, or translated to a quality state. Never pass them directly into a robot command path without policy.

Separate reading together from updating atomically

Function 03 or 04 can return two adjacent registers in one Modbus response. That keeps the transport read together, but it does not by itself prove that the device application updated both words as one snapshot. A device task might write the low word and high word in separate operations while a request is served between them.

Use the vendor's snapshot, latch, freeze, sequence counter, timestamp, or validity mechanism when available. A common application technique is to read a version, read the two words, and read the version again, accepting the value only if both version reads match and the device defines that contract. Do not invent a version protocol that the device does not implement.

When no coherence mechanism exists, document the risk, poll at an appropriate rate, apply semantic checks, and avoid using the value for high-consequence decisions without independent confirmation.

Make writes explicit

Writing both registers with function 16 places the pair in one Modbus request. That is generally preferable to two independent function 06 writes because it avoids a network-visible gap between client operations. It still does not guarantee application-level atomicity unless the device documentation says the pair is committed together.

Define whether the device stages the pair, validates it before use, requires a commit bit, or consumes it immediately. Readback confirms stored representation, not physical execution. For motion or energy commands, require the device acknowledgement and safety feedback appropriate to the system.

Version and test the decoder

Treat a register map as a versioned interface. Bind the decoder to device model, firmware range, option set, and map revision. Reject an unknown combination rather than guessing from values that look reasonable.

Build golden tests from official examples or controlled captures. Each vector should include raw response bytes, register words, selected layout, expected typed value, scale, units, quality result, and map version. Add negative tests that intentionally apply each alternative layout and prove the validator detects or flags the mismatch.

At integration time, capture the complete request and response, not only the final engineering value. Display raw words beside the decoded result in diagnostic tools. This lets an engineer distinguish transport success, register selection, layout, type, scale, and freshness.

Name the evidence accurately

A defensible record says that two 16-bit registers were returned in a valid Modbus response and decoded under a named, versioned application convention. If the device provided snapshot or sequence evidence, record that separately. If physical behavior matters, record its feedback separately too.

Modbus transports 16-bit registers reliably when implemented correctly. The meaning of a 32-bit pair belongs to the device application contract. Making that contract explicit prevents a successful packet exchange from becoming a silent data-model error.