IMDHMIControls LibraryShop main store

Troubleshooting

Why an HMI Modbus TCP write leaves the S7-1200 DB unchanged

Industrial networks Published 5 min read

Short answer

The write most likely never reached the register you think it did: the HMI's 400001 is a one-based display number, while the Modbus request carries a zero-based offset that the server block maps onto DB102.DBW0. Confirm the server block status and data area, confirm station 3 points at the S7-1200 rather than the motion controller, match the driver's register convention, and prove the path with one known value written to a single word.

On this page
  1. What 400001 actually says
  2. Confirm the MB_SERVER data area first
  3. Then check the HMI route and tag
  4. One test value settles it
  5. What each outcome tells you
  6. The decision
  7. Questions asked

The HMI accepted the entry and showed no error, but an accepted entry is not proof that the write landed anywhere. In this setup the S7-1200 runs the Modbus TCP server block with ten words mapped from DB102.DBW0 through DB102.DBW18, the HMI targets station 3 on network 1, and the IO field is tagged 1.3.400001. The usual reason DB102.DBW0 stays unchanged is a numbering mismatch: 400001 is one-based display notation for the first holding register, the request on the wire carries offset 0, and the server maps that offset onto DBW0. Check the server block first, then the route, then the tag convention, and finish by writing one known value to a single word.

What 400001 actually says #

Nothing called 400001 travels on the wire. A Modbus request carries a 16-bit register offset, and the first holding register is offset 0. The 4xxxxx forms are display conventions: 40001, 400001 and a plain 1 can all name that same first register, depending on the driver. When an HMI tag and a PLC server disagree about which number names the first register, the write either lands on the wrong word or is rejected outright — the general case is covered in fixing Modbus TCP addressing errors between an HMI and a PLC.

Entering 400001 into a driver that treats the entry as a raw offset produces a request for offset 400001, far outside the mapped area. Never shift the tag by one register on a guess: the correct fix depends on which convention each side actually uses, and the single-word test at the end of this article identifies it.

Confirm the MB_SERVER data area first #

The S7-1200 answers Modbus TCP through its PROFINET port, and the server instruction requires the holding-register area to sit in a non-optimized global DB or in M memory, because an optimized DB has no fixed byte addresses to map offsets onto. Before touching the HMI, work this list:

  1. The server block instance executes cyclically and its status output reports a running state, not an error.
  2. The configured data area points at DB102 with standard (non-optimized) access, covering ten words.
  3. The range arithmetic agrees: ten words of two bytes each occupy 20 bytes, so the last word begins at byte offset 18 — DBW18. A map that ends anywhere else has a different word count or start.
  4. You have written down the configured start: DBW0 is the first holding register.

The PLC-side items here — the server instance, its connection data and the data area — are the same ones described in what you must configure on the PLC side for Modbus TCP. Proceed only when all four points hold.

Then check the HMI route and tag #

The tag 1.3.400001 encodes three things in the driver's own field order: network ID 1, station number 3, and the Modbus reference. Station 3 must be assigned to the S7-1200; station 2 is the motion controller's server, and a write aimed there never reaches the DB no matter what the HMI displays afterward. A station number is a destination identifier — not a TCP port and not a memory offset. Then:

  1. Confirm the station assignment against the actual network configuration, not against the HMI project alone.
  2. Set the IO field tag as a write-enabled holding-register value, 16-bit, single word. Testing a multiword type against a one-word target tells you nothing.
  3. Read the driver's address rules and establish whether it wants the 4xxxxx display form or a zero-based offset for the first register.
  4. Download the changed communication configuration and confirm a live connection with no tag error before judging an unchanged PLC value.

One test value settles it #

Pick a test value that the PLC logic ignores, because a write into a live word can move a machine.

With the server running and its status healthy, watch DB102.DBW0 online in the programming environment and record its value (for example 0). Enter 12345 in the field tagged 1.3.400001 and commit the entry. A correct path is a one-word write (function code 16, one register, offset 0), and the value appears in DBW0 within the server's execution cycle — effectively immediately. Check the arithmetic that defines the target: DBW18 sits 18 bytes above DBW0, 18 ÷ 2 = 9 word steps, so the mapped area holds registers 400001 through 400010, offsets 0 through 9. Register 400010 is offset 9, not 10 — the one-based display number of the last register always exceeds its wire offset by one.

What each outcome tells you #

What you observe Which layer failed Do this next
HMI reports a communication error Route or server availability Fix the station 3 assignment and server status before touching the address
Entry accepted, DBW0 unchanged Address convention mismatch Compare the driver's first-register form with the server's configured start
A different word of the ten changes Fixed offset error Count which register changed and shift the tag by that many registers
DBW0 changes, then reverts PLC logic overwrites the word Find every writer of that address and coordinate the value
Server rejects the request Raw offset out of range The driver sent the literal number as an offset; use its zero-based form

Change one thing per test round. Changing the server start and the HMI tag at the same time destroys the evidence the next round would have given you.

The decision #

  • The test value appears in DB102.DBW0: mapping and route are proven; leave the tag alone and put the production values back.
  • The value lands on another word: move the tag by the exact register count the test revealed — no new theory needed.
  • The request is rejected: switch the HMI reference to the zero-based form (0 for the first register) and rerun the single-word test.
  • A communication error: the address was never the problem; correct the station route, then retest.
  • The value reverts: logic on the PLC side writes the same word; when that writer is a supervising system, follow the write-protection practice in safe Modbus writes to PLC output registers from SCADA.

Do not treat 400001 as a wire address, never accept the HMI's own connection status as proof of a write — the DB word is the only receipt that counts.

Questions asked

Why does the server block's mapped range end at DBW18?

Ten consecutive 16-bit words occupy 20 bytes. The first word sits at byte offset 0 (DBW0), so the tenth and last word begins at byte offset 18 (DBW18). If your map ends at a different byte, either the word count or the start offset differs from this one.

Does the data block need to be optimized or standard?

The S7-1200's Modbus server instruction requires the holding-register area to be a non-optimized (standard-access) global data block or M memory. An optimized DB has no fixed byte addresses, so the server cannot map register offsets onto DBW locations; set the DB to standard access and recompile before testing.

What if the HMI driver expects 0 instead of 400001 for the first register?

Then the literal 400001 leaves the tag as a raw wire offset, and the request falls far outside the mapped area, so the server rejects it. Enter the zero-based form (0 for the first register) or the driver's documented display form, and confirm with the single-word test before restoring production values.

Why must the write go to station 3?

The station number selects which Modbus server on network 1 receives the request. Station 2 is the motion controller's server, so a write aimed at station 2 never touches the S7-1200 data block even when the HMI reports success on its own connection. Match the station field in the tag to the PLC's configured server station.

Keep reading

  • Explainer

    What you must configure on the PLC side for Modbus TCP

    On the PLC side you always provide the IP address, port 502 and the register map — but the serving mechanism is what differs: the S7-1200, the Omron CP2E and the Speed7 family need the manufacturer's server function blocks called cyclically, while a ControlLogix needs a socket-based add-on instruction.

    Industrial networks

  • Troubleshooting

    What to do when a Modbus TCP server lacks FC22 support

    When a SCADA client sends FC22 (Mask Write Register) to a server that does not implement it, the reply is exception 01, Illegal Function. A compiled server library cannot be edited to add the function, so the fix is client-side: map the points as coils, write whole registers, or use FC23, and give every shared register a single writer.

    Industrial networks

  • How-to

    Linking Modbus RTU BMS SCADA to a redundant S7-1500R

    Use one Modbus RTU-to-TCP gateway as the Modbus TCP client, and run the Modbus TCP server on the S7-1500R system IP address that switched communication moves to the surviving CPU. The BMS keeps polling its RS-485 link unchanged; on a switchover the TCP session drops and the gateway reconnects. Set the comm-fail timeout to the measured gap plus one poll interval: 3 s at a 1 s rate in the example.

    Industrial networks