top of page

Modbus Read/Write Multiple Registers: The Write Happens Before the Read

5 hours ago
3 min read

A combined Modbus request is expected to capture a value before changing a setting, but the returned data appears to include the change. Check transaction order before adjusting timestamps. Function 23 combines operations with a defined write-before-read order; it is not a pre-change snapshot mechanism.


Modbus Read/Write Multiple Registers: The Write Happens Before the Read — original conceptual illustration
Original explanatory concept; not a specific product, live software screen or customer installation.

Key takeaways Confirm function 23 support and its write-before-read semantics. Distinguish a register observation from proof that the physical process has reached the requested condition.

1. Specify the operation without ambiguity


The official Modbus application protocol identifies Read/Write Multiple Registers as decimal function 23, hexadecimal 0x17. It combines a read and a write in one transaction and performs the write first. Record both number bases in the project specification so a tool displaying hexadecimal 17 is not mistaken for decimal function 17.


Verify exact device, firmware and client support before choosing the operation. Basic holding-register access does not prove that this combined function is implemented. Identify the read range, write range, data representation and permissions from the manufacturer's register map; do not copy another model's addresses.



2. Define what the returned registers establish


The normal response contains the requested read-register data. If the ranges overlap, the observation follows the write within the defined operation. That is different from taking an earlier baseline and returning it after a change. If a pre-change comparison is required, design an explicit observation sequence with its own timing and consistency requirements.


A returned command value is also not necessarily physical feedback. A pump's requested speed, drive acceptance state and measured rotation are separate observations. Determine which documented register or independent signal establishes each condition. Never imply that a protocol operation is a certified safety function or that communication success proves machinery is safe.


Define: Confirm function 23 and the actual register map.; Write then read: Interpret the returned range as a post-write observation.; Validate: Check the separately defined application feedback.
Original explanatory concept; not a specific product, live software screen or customer installation.

3. Work through an isolated example


In a hypothetical simulator, an ordinary holding register begins at 10. A supported combined request writes 20 and reads that same location. The defined ordering means the read is after the write; a commissioning test must not expect the original 10 as a guaranteed baseline. The exact application and any concurrent logic still need consideration.


Use an approved simulator or isolated non-production configuration. Do not select a convenient live plant register merely to demonstrate ordering. Check whether control logic, another client or a device-specific transformation can change the location after a write. Record which actor owns the setting and which value the test is intended to verify.


Observation

Check next

Old value expected

Review write-before-read test assumptions.

Setpoint matches

Verify required physical feedback separately.

Reply interrupted

Reconcile before repeating a write.


4. Write an acceptance checklist


First confirm the supported function and documented address notation. Next record a baseline through the agreed read method. Then exercise the combined operation in the authorised test environment and compare the returned range with the expected post-write state. Finally inspect the separately defined application or physical feedback where the project requires it.


Include unsupported-function, invalid-address and interrupted-response cases in the agreed test plan. An interrupted reply can leave uncertainty about whether a write occurred; repeating the command may not be harmless. Reconcile through the manufacturer's supported method and authorised recovery process rather than issuing uncontrolled retries.


5. Recommended related solutions


ProSense networking and gateway solutions are relevant when checking whether the route and driver preserve the combined request and response. ProSense automation solutions are relevant when defining setting ownership, controller behaviour and the required acceptance feedback. Confirm implementation on the actual selected equipment before purchase.


Bring the register-map revision, exact function notation and sanitised simulator trace to the project discussion. The handover should describe the baseline, written value, returned observation and independent acceptance signal separately. These checks support a specific integration requirement without promising that every Modbus-labelled controller supports function 23.




Practical FAQs


Is the returned value a guaranteed pre-write snapshot?


No. The defined combined operation performs its write before its read.


Does a returned setpoint prove the actuator moved?


No. Define and validate the appropriate device status or independent process feedback separately.


Technical reference



Protocol definitions are from the primary reference. The hypothetical tests and handover checks are project engineering recommendations; confirm the exact device or endpoint contract.


Need help with your application?










bottom of page