IMDHMIControls LibraryShop main store

Troubleshooting

Why an S7-1500 X2 Modbus server accepts TCP but no DONE arrives

Industrial networks Published 7 min read

Short answer

The client's 0001-to-7005 loop means it builds a connection, sends a request and never receives an accepted response; the completed 7006 state and DONE never arrive. A blank Telnet session proves only that X2 accepts TCP on port 502. Match TCON_IP_v4.InterfaceID to X2's hardware identifier from device configuration, then read the one-scan ERROR and STATUS with a trace.

On this page
  1. What do MB_CLIENT statuses 0001 to 7005 mean?
  2. Does a blank Telnet screen prove the Modbus server works?
  3. Can X2 serve Modbus TCP while X1 runs PROFINET I/O?
  4. Where do you find the hardware identifier for X2?
  5. How do you catch an error that lasts one scan?
  6. What must the server data block satisfy?
  7. Is moving Modbus TCP to X1 a real fix?
  8. What order settles the fault?
  9. Questions asked

An S7-1500 1516-3 PN/DP can serve Modbus TCP from its X2 interface while X1 carries PROFINET I/O; nothing about that arrangement needs changing. When the S7-1200 client cycles through 0001, 7002, 7003, 7004 and 7005 without reaching 7006, while a blank Telnet session still opens on 192.169.1.10, the transport is fine and the exchange is not. The first thing to compare is the InterfaceID in the server's connection description against the hardware identifier device configuration assigns to X2. With this exact pattern — port 502 accepting TCP, DONE never true, success after the link is moved to X1 — the two numbers usually differ, and setting them equal is the fix. The proof is a one-scan capture of ERROR and STATUS, because the error bit lives for a single cycle.

What do MB_CLIENT statuses 0001 to 7005 mean? #

The sequence is the client's attempt loop: it builds the connection, tears it down, builds it again, sends the request, and never reaches 7006, the state in which a response has arrived and DONE goes TRUE for that call.

STATUS Meaning in the instruction help What it tells you here
0001 Initial call, no request sent yet Block started, waiting on the request bit
7002 Connection is being established Transport attempt under way
7003 Connection is being terminated The block closes a connection between attempts
7004 Connection established and monitored Transport up, exchange about to run
7005 Data is being sent Request on the wire
7006 Exchange complete, DONE set Never seen in this fault

Read the meanings from the help of the installed library version; the values describe block states as much as errors, so a moving status word is a working block, not a diagnosis. What matters is the shape: the send state is reached and the completed state is not, so a request leaves the client and no accepted response comes back. That places the fault after transport — in the server's connection binding, its data area, or the mapping between the two.

Does a blank Telnet screen prove the Modbus server works? #

No: Telnet opening on 192.169.1.10 at port 502 proves only that something accepted a TCP connection at that moment; Telnet sends no Modbus request, so the test says nothing about function codes, the connection description or the data area.

TCP acceptance and Modbus processing are separate stages. After the handshake, the client must send a valid request, the server block must execute in its scan cycle and reach the addressed data, and the client must accept the response. A failure in any of those later stages leaves the Telnet test green and DONE false. Close the Telnet session before further testing; the real test is one controlled client request with a trace armed, which the capture section below sets up.

Can X2 serve Modbus TCP while X1 runs PROFINET I/O? #

Yes: on the 1516-3 PN/DP, open user communication runs on either integrated PN interface, so an MB_SERVER can listen on X2 while X1 carries its I/O; no documented restriction ties Modbus server mode to X1.

So the success after moving the link to X1 is not evidence of a limitation — it is a controlled experiment with exactly one changed variable, the interface the connection binds to. That makes the comparison decisive: put the working X1 connection description next to the failing X2 one and compare InterfaceID first, then the local port, the connection ID and the data area. Whatever differs is your fault list, in priority order.

Where do you find the hardware identifier for X2? #

In device configuration: the compiler assigns each hardware object of the PLC a numeric hardware identifier, and the value belonging to the second PN interface is what TCON_IP_v4.InterfaceID must contain; the printed X2 label is not that number.

The usual way this breaks is a copied connection description: a structure first written for X1 keeps X1's identifier, the server then listens or fails on the wrong interface, and the client loops through its attempt states indefinitely. Compare numbers, not names: open the identifier list for the PLC device, find the entry for the interface that carries 192.169.1.10, and check it against the structure. Run the same comparison on the client side — its InterfaceID must name the 1215C's own PN interface. If the server-side numbers differ, that difference is the fault, and step 1 of the ordered procedure applies it.

How do you catch an error that lasts one scan? #

Configure a trace on each CPU that samples every cycle and triggers on the rising edge of the block's ERROR output, recording DONE, ERROR, STATUS, the request bit and the connection ID; the error state lasts one scan, so nothing slower will hold it.

Take a 10 ms OB1 cycle as an example: the error bit is true for 10 ms, then gone until the next failed attempt. An online watch that refreshes once per second catches it about one refresh in a hundred, which is why staring at a live table finds nothing. A program latch works as well: a rung that sets a memory bit on the rising edge of ERROR and holds it, with the status word moved into a hold register on the same edge, keeps the number for lookup in the installed help. Read the client record first: a send state followed by an error and no matching server activity means the request never reached the server block, which points back at the interface binding; a server-side error in the same window points at the request range or the data area.

What must the server data block satisfy? #

Two things: standard, non-optimized access, and a word count that covers the highest register the client addresses; the TCP test proved nothing about either, and a request that overruns the area returns no data.

Example: the client reads 20 holding registers from 40091, the data block holds 100 words, and the area's first word maps to holding register 40001. First offset: 40091 − 40001 = 90 words. Highest offset: 90 + 20 − 1 = 109. Words needed: 110. Shortfall against the block: 110 − 100 = 10 words. Decision: grow the block to at least 110 words, or cut the request to the 100 − 90 = 10 registers that exist above the start offset. A range error of this family is also what happens when an HMI write never lands where it was aimed — Why an HMI Modbus TCP write leaves the S7-1200 DB unchanged walks through that variant.

Is moving Modbus TCP to X1 a real fix? #

As a production stopgap, yes; as a repair, no — the move changes exactly one variable, the interface binding, and so proves the pair completes Modbus exchanges when that variable is different, which is evidence about the binding, not about X2.

Use it that way: let the machine run on X1 while you correct the X2 binding from the comparison above. Keeping Modbus on X1 permanently means one port carries PROFINET I/O, the Modbus server and every programming session together; how one CPU port behaves with Modbus TCP next to its other connections is what Can one S7 CPU PN port run Modbus TCP and S7 comms together covers.

What order settles the fault? #

Take the checks in this order; with this symptom set — transport accepted, the client looping through the send state, DONE never true, success after the move to X1 — the interface identifier is the first suspect and the usual fix.

  1. Read X2's hardware identifier in device configuration and compare it with TCON_IP_v4.InterfaceID. Not equal: set it, compile, download, retest, and in most of these cases you are done. Equal: continue.
  2. Close any Telnet session, then run one controlled client request with traces armed on both CPUs, triggered on the rising edge of ERROR. Look up the first status after the send state in the installed help.
  3. Check the request range against the data block with the arithmetic above. Overrun: enlarge the block or shorten the request.
  4. Keep passive server mode and local port 502 as configured — the full PLC-side settings a Modbus TCP server needs are listed in What you must configure on the PLC side for Modbus TCP; changing subnets, ports or firewalls at this stage only adds variables, because the transport was already proven.
  5. Only if every item holds and the capture shows an error the help assigns to the interface itself, take the CPU's communication manual for the installed firmware to the vendor's support channel; that residual case is rare.

The download in step 1 stops a CPU that may be carrying production on X1, so schedule it through your normal change approval. Decision in short: match the identifiers, capture one scan, size the data area — in that order.

Questions asked

Can the client's InterfaceID cause the same status loop?

Yes, on a CPU with several interfaces: the client's connection description carries its own InterfaceID, and a wrong value there fails the connection before any request leaves, producing the same looping statuses. On a 1215C with one PN interface the value is that interface's identifier, so the client side is the less likely culprit, but confirm it while the identifier list is open.

How many clients can one MB_SERVER instance accept at once?

One: each passive server instance holds a single connection at a time, so a Telnet session left open occupies the slot the PLC client needs, and a second client is refused until the first disconnects. Close every Telnet test before the PLC client connects, and give any additional client its own instance with its own connection ID.

What if InterfaceID already matches the X2 hardware identifier?

Leave the network parameters alone and read the captured one-scan error instead. A matching identifier moves the fault into the exchange itself, so check the request range against the server data area and look the captured status up in the installed instruction help. Rewriting subnets, ports or firewalls at that point only adds variables to an already-proven transport.

Why must the server data block use non-optimized access?

The register mapping assumes standard access: the block relates Modbus register numbers to absolute DB words, so the optimized-access property stays off and the DB is created manually. Non-optimized access does not size anything, though. The word count must still cover the highest offset requested, and a standard-access block that is too short fails exactly like any other.

Keep reading

  • Troubleshooting

    Why MB_CLIENT shows STATUS 16#0000 but no data arrives

    A no-error STATUS of 16#0000 from MB_CLIENT certifies that the request cycle completed, not that the values reached the receive array. With an empty array, audit the request definition first: make the address span satisfy end minus start equals quantity minus one, set the unit identifier the converter forwards to the downstream slave's ID, and give the bit-type objects a destination of the matching type. Until those three checks pass, treat the clean status as unproven.

    Industrial networks

  • How-to

    Set up a CLICK Plus as Modbus TCP client to an S7-1200

    Yes: make the S7-1200 the Modbus TCP server with MB_SERVER mapped to a data block of INTs, and make the CLICK Plus the client with Send and Receive instructions aimed at the CPU's IP address and port 502. Write the shared register map first; the S7 logic copies physical inputs into it and applies its output words to the real outputs.

    Industrial networks

  • Troubleshooting

    Why an S7-1200 Modbus TCP client shows no data through a gateway

    When a Modbus TCP test utility reads the instrument through the gateway but the S7-1200 shows nothing, the Ethernet path already works; the PLC's request does not match it. Copy the working request's destination, unit identifier, function code, address and count, capture the PLC at a switch mirror port, and read MB_CLIENT STATUS to place the fault at connection, timeout or exception stage.

    Industrial networks