A successful Modbus response proves that a device answered a request. It does not prove the returned number is the pressure, temperature or energy value the application intended to read. Address notation, signedness, scaling and multi-register representation can all turn a valid response into a misleading measurement.
The Modbus application protocol specification defines data tables and function behavior, including 16-bit input and holding registers. The equipment manufacturer defines what a particular register means. Start with the device model, firmware and the corresponding register map.
Translate the address before decoding the value
Record the device identifier, register table, documented reference, client address convention and read function. Manuals may display reference numbers differently from the zero-based address used in a request. Do not subtract one mechanically: first confirm what the manual and client each mean by the displayed number. Read a known safe, documented value and compare it with the device display or another trusted reference.
Keep reads within ranges permitted by the device. A request that spans undocumented or unsupported addresses can fail even if some individual registers are valid. Grouping reads may reduce transactions, but only where the device allows the range and the site has approved the resulting load.
Record the decoding contract
| Field | Question to resolve from device documentation |
|---|---|
| Representation | Is the value an unsigned or signed integer, a floating-point value, a bit field or another format? |
| Width and order | Does it occupy one or multiple registers? For multi-register values, what word ordering does this device use? |
| Scale and unit | Is a raw count multiplied by a factor or offset? What engineering unit results? |
| Invalid states | Are there sentinel values, device status bits or documented invalid ranges? |
| Timing | How often does the device update the value, and where will the collection timestamp originate? |
Worked example: one temperature register
Assume a fictional device manual labels the temperature as holding register 40011, specifies signed 16-bit integer encoding, a scale of 0.1 °C per count and no offset. For this example only, the manual defines 40001 as the first holding register and the client accepts a zero-based protocol address. The engineer selects function 03, Read Holding Registers, starting address 10, quantity 1. The 4xxxx label is a documentation convention, not an address to insert unchanged into every client’s address field. A different manual or client may use another convention.
Suppose the response contains register value 0x00FD: as a signed 16-bit integer it is 253, so 253 × 0.1 = 25.3 °C. Compare the decoded reading with the device’s trusted local display or a suitable reference at the same operating condition, within an agreed tolerance; record the raw register, time, device and mapping revision. Repeat at another known value, including a negative value if the device and safe test conditions permit. The address, scale and reading are illustrative, not specifications for a real instrument. Modbus Organization’s protocol specification defines function 03 and zero-based protocol addressing; it does not assign this device’s measurement or scale.
Multi-register values deserve special testing. A plausible value is not enough to establish correct word order. Compare several known readings, including one that changes, against the authoritative display or test equipment. Ask the device owner how the device ensures a consistent multi-register read if the underlying value changes during access.
For an illustrative 32-bit floating-point value of 1.0, the IEEE 754 bit pattern is 0x3F800000. A device may document the high-order word first, yielding registers 0x3F80, 0x0000, or may specify the opposite word order. Capture both raw 16-bit words, apply the documented byte and word arrangement, decode with the specified type, and compare with a trusted reference at two or more distinct, safely obtained values. A reversed interpretation that looks plausible is not proof. Check for any device-specific byte swapping separately, and record the selected arrangement and map version. If the device cannot guarantee a coherent multi-register read during an update, agree on a supported consistency method before accepting the result.
Validate and maintain the mapping
- Store the original register reference, decoded name, unit, scale, type, source device and map revision.
- Verify known values and an expected change with the equipment owner; include status or invalid-value cases where they can be tested safely.
- Record whether a timestamp represents device time or collection time. A polled response does not automatically reveal when the physical measurement was made.
- Confirm read permissions, network segmentation, error handling and an acceptable polling workload before production.
- Revalidate mappings after firmware, equipment or register-map changes.
Avoid testing write functions against production equipment merely to check connectivity. Use the site’s approved procedure and appropriate access controls. A trustworthy historian record needs the right value, source identity and meaning—not simply a valid register response.


