Read Modbus Holding Registers (function code 03) vs Input Registers (function code 04) with correct addressing

domain: iot · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Identify which register type the device exposes: Holding Registers (function code 03, read/write, conventionally numbered 4xxxx) vs Input Registers (function code 04, read-only, conventionally numbered 3xxxx)
  2. Send the request with the matching function code (0x03 or 0x04), using a 1-byte function code, 2-byte starting address, and 2-byte quantity-of-registers
  3. Convert any documented register number to the PDU address by stripping the type-prefix digit and subtracting 1 — e.g. documented holding register 40002 maps to PDU address 0x0001; the wire protocol always uses 0-based addressing
  4. Parse the response: byte count field, then 2 bytes per register with the high-order byte first for each 16-bit register
  5. If values look shifted by one register or come from the wrong range, check whether the vendor's documentation numbers are already 0-based, and whether you used FC03 against a point that is really only exposed as an input register (or vice versa)

Known gotchas

Related routes

Read Modbus TCP holding/input registers from a device using pymodbus
pymodbus.readthedocs.io · 6 steps · unrated
Read Modbus RTU holding registers over a serial connection using pymodbus
pymodbus.readthedocs.io · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans