IMDTouchKnowledge BaseShop main store

Troubleshooting

Why WinCC opens too many TCP connections to a Modbus gateway

HMI and touchscreens Published 5 min read By IMDTouch engineering team

Short answer

A reported behavior of the WinCC Modbus TCP channel opens a separate TCP session for every distinct unit ID, even when all of them sit behind one gateway IP address. The ADAM-4572 documentation gives 8 simultaneous clients, so a design that works on paper can exhaust the gateway. Measure the sessions the installed driver actually opens and keep them within the gateway's limit.

On this page
  1. One gateway, two kinds of Modbus address
  2. Why the gateway fills before WinCC does
  3. Measure the sessions your driver actually opens
  4. Worked example: counting sessions for five meters behind one gateway
  5. Changes that hold the demand under the limit
  6. The decision
  7. Questions asked

Your WinCC project and the gateway can both pass every basic check and still fail, because the resource that runs out is neither ping nor port: it is TCP sessions. The standard WinCC Modbus TCP channel has a reported behavior of opening a new TCP connection for every different Modbus unit ID, even when all of those unit IDs sit behind the same gateway IP address. The ADAM-4572 accepts up to 8 clients at the same time. Address more unit IDs than that, or let a second station poll the same gateway, and the overflow sessions are refused while the earlier ones keep working. Count the sessions your installed driver actually opens, compare that count with the gateway's capacity, and only then change hardware.

One gateway, two kinds of Modbus address #

The report behind this failure says the driver opens a connection for every different Modbus address. Modbus address means two different things here, and only one of them creates sessions. The unit identifier selects the downstream device: the MODBUS Messaging on TCP/IP Implementation Guide V1.0b reserves that field for reaching end devices behind bridges and gateways that share a single IP address. The register address selects data inside the device the unit identifier picked. Sessions follow unit identifiers; register addresses ride inside an already open session.

On the WinCC side, the channel's default port is 502, documented for WinCC V8.0, and when a bridge sits in the path the downstream device is entered as the Address of remote slave in the connection configuration. Building tags on top of that connection is covered in configuring WinCC Professional Modbus TCP tags to read a device, and unit ID 0 has routing quirks of its own, explained in why unit ID 0 fixes a Modbus TCP device not responding.

Why the gateway fills before WinCC does #

Each accepted TCP client occupies one gateway slot, no matter how many unit IDs that client polls. Advantech documents the ADAM-4572, a one-port Modbus gateway, for up to 8 clients accessing field data simultaneously. On the WinCC side, Siemens support discussions put the standard Modbus TCP channel at roughly 27 parallel connections, a reported figure rather than a datasheet line. The smaller number governs, and it belongs to the gateway.

Extra sessions buy nothing downstream. The gateway queues every request onto one serial link, so additional connections add overhead on the Ethernet side and zero bandwidth on the serial side.

Measure the sessions your driver actually opens #

Treat the report as a lead and your own measurement as the verdict. Run the sequence on a bench or an isolated network with test tags, because restarting a channel on the live station drops every tag on it.

  • Baseline: one connection, one unit ID, one read-only tag, all other clients disconnected. Confirm the tag shows good quality.
  • On the WinCC station, run netstat -n and count the established lines to the gateway's address. Expect exactly one.
  • Add several register tags for that same unit ID and recount. The count should not move.
  • Add a second unit ID and recount. A count that rose by exactly one confirms the reported behavior on your release: one session for each distinct unit ID.
  • Work through the full device list and write down the total. Comparing that total with the gateway's client slots is the whole diagnosis.

Worked example: counting sessions for five meters behind one gateway #

Inputs:

  • Five serial meters at unit IDs 1 to 5 behind one ADAM-4572, an example device list; substitute your own.
  • One session for each distinct unit ID, as the test above measured on the installed release.
  • Gateway capacity of 8 simultaneous clients, from the gateway documentation.
  • One WinCC station in service and a second one planned, example inputs.

Rule in words: sessions demanded equal the number of distinct unit IDs, times the sessions the driver opens for each, times the number of polling stations. The design holds while sessions demanded stay within the gateway's client slots.

Arithmetic:

  • Today: 5 × 1 × 1 = 5 sessions demanded, which fits, with 8 - 5 = 3 slots free.
  • With the planned second station: 5 × 1 × 2 = 10 sessions demanded, so 10 - 8 = 2 sessions are refused at connect time and those unit IDs show bad quality on one station.
  • Largest single-station design on this gateway: 8 × 1 × 1 = 8 sessions, meaning unit IDs 1 to 8 poll and a ninth is refused.

Result: commission with one station and at most eight unit IDs behind this gateway. The decision threshold is the slot count, and the second station pushes demand past it by arithmetic, so correct the architecture before that station arrives, not after.

Changes that hold the demand under the limit #

  • Ask Siemens support first. The behavior is reported for the standard channel; whether a corrected revision or setting exists is a question only they can answer for your release, so send the WinCC version and the measured session count together.
  • Cap the unit IDs. With the measured behavior, the design cap is the gateway's client slots divided by the number of polling stations, expressed in unit IDs. Every station you add halves what is left.
  • Split the serial devices across two gateways when you need more unit IDs than the cap allows; each gateway brings its own address and its own slots.
  • Insert a data-map gateway: a device with a configured register map polls the serial side itself and presents the WinCC channel with a single unit ID to read. The trade is a fixed map instead of transparent pass-through, the arrangement covered in getting gateway sensor data onto an HMI with a Modbus TCP bridge. That is different again from an RTU-over-Ethernet tunnel, which is not Modbus TCP and will not answer this channel; why Modbus RTU over Ethernet is not Modbus TCP for an HMI lays out that distinction.

The decision #

  • The count follows unit IDs and the total fits the slots: commission as designed and write the measured session count into the commissioning record.
  • The count exceeds the slots: the failure is session demand, not cabling or addressing. Correct it with the driver answer from Siemens, fewer unit IDs, a second gateway, or a fixed map, in that order of preference.
  • Every tag is bad from the first session: this is not the count. Verify that the project uses the Modbus TCP channel, that the gateway's enabled service matches it, and that serial settings agree at both ends; only a working single-tag baseline gives the count any meaning.

Questions asked

Is this session behavior confirmed for every WinCC release?

No public document lists the affected releases or driver revisions, so treat the report as a lead and your measured count as the verdict. Siemens support is the only source that can say whether a corrected revision exists for your exact release; send them the WinCC version and the session count you measured.

Could a wrong register offset cause the same symptoms?

No. An offset fault, such as the offset of 1 that the Unity Pro address format applies when configuring a connection to a Modbus Quantum PLC, shifts which register you read while tag quality stays good. Session exhaustion is coarser: entire unit IDs show bad quality from their first poll while earlier unit IDs keep updating normally.

Can the gateway's client limit be raised?

No. The 8-client figure is fixed capacity of that gateway model, not a configuration value. Above it, the choices are fewer sessions from the WinCC side, a second gateway with its own address for the overflow unit IDs, or a data-map gateway that needs only one unit ID.

Do two WinCC stations share sessions to the same gateway?

No. Each station runs its own channel and opens its own set, so stations multiply the demand instead of pooling it. Two stations polling the same five unit IDs demand ten sessions, which is exactly why the worked example fails the moment the second station is added.

Keep reading

  • Troubleshooting

    Why unit ID 0 fixes a Modbus TCP device not responding

    A Modbus TCP device that ignores the HMI can fail on the unit ID alone: in the worked case a Weintek cmt3162x in EasyBuilder Pro 6.08.02.322 connected to a process heater at 192.168.1.113 once the unit ID was set to 0, port 502 confirmed, and the unsupported 0x and 1x address mappings removed.

    HMI and touchscreens

  • How-to

    Connecting a C-More HMI to a Schneider M340 over Modbus TCP

    Yes. Select the Modicon Modbus TCP/IP driver in the C-More project, give the M340 a static IP address because its Ethernet modules default to dynamic addressing, and map each %MW word N to the one-based register reference N+1 — the field-documented case reads %MW62200 at 462201. Verify with one known word before building screens.

    HMI and touchscreens

  • Selection guide

    Connecting a Do-more PLC to a Third-Party HMI

    A Do-more CPU reaches any third-party HMI over Modbus: the H2-DM1E serves Modbus/TCP on its Ethernet port — up to 8 simultaneous masters — and Modbus/RTU on its RS-232 port, while the non-E H2-DM1 serves Modbus/RTU only. C-more is the single panel line with a native Do-more driver, so every other panel or PC runtime binds to a Modbus register map you build and control.

    HMI and touchscreens

Fixing Data Table Too Small Errors After a PanelView Plus Conversion