Troubleshooting SINUMERIK 840D SL CP840D OPC UA Connection

David Krause11 min read
Industrial NetworkingSiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

1. Problem Statement

A SINUMERIK 840D SL controller using its integrated CP 840D communication processor refuses to complete a TCP/IP session with an external OPC server (or OPC UA client). The diagnostic buffer, HMI trace, or connection status register reads "Passive connection establishment in progress" and never transitions to Established. Cabling, the intermediate router, and ICMP echo (ping) are all functional; the host is reachable. Forty-nine identical cells on the same network topology communicate without intervention. This document isolates the failure path, ranks the most common causes, and provides a deterministic diagnostic and remediation procedure.

The status string "passive connection establishment in progress" originates from the CP 840D connection state machine. It indicates that the CP has opened the local TCP port and is waiting for the remote partner to issue the active CONNECT. It does not indicate a hardware or layer-1 fault.

2. SINUMERIK 840D SL Communication Architecture

The 840D SL is built around an NCU (Numerical Control Unit) that integrates:

  • An NCK (NC kernel) for motion and interpolation.
  • A PLC (S7-300/ET200-class) for discrete logic.
  • An integrated CP 840D communication processor with onboard Ethernet.
  • A HMI runtime (Operate / SinuTrain) running on the NCU or a separate PCU/IPC.
Component Function Relevant to TCP/IP Issue
NCK Hosts the OPC UA server on 840D SL Yes — license and NC SW version gate OPC UA
PLC (integrated) Application logic Yes — CP 840D connection configuration is set in PLC project
CP 840D Integrated PROFINET/Ethernet CP inside NCU Yes — owns the TCP endpoint and the active/passive flag
HMI (Operate) Operator interface Secondary — only used for diagnostics
NCU X130 External Ethernet port (RJ45) to plant network Yes — physical egress; OPC UA port binds here

The CP 840D shares the NCU's X130 Ethernet port with other TCP services (HMI web, VNC, SFTP). Configuring the OPC UA endpoint requires that the NCK have a valid IP, subnet, and router entry on X130.

3. CP 840D Hardware and the X130 Interface

The CP 840D is not a plug-in card on the 840D SL — it is hardwired into the NCU module. The relevant physical interface is X130, the customer-side Ethernet socket on the NCU. The CP 840D supports:

  • PROFINET IO controller / device
  • S7 communication (PUT/GET, BSEND/BRCV)
  • ISO-on-TCP (RFC 1006) connections
  • TCP/IP native sockets
  • OPC UA server (NC-side, license-gated)

Configuration of the CP 840D's connection database is performed in the STEP 7 (or TIA Portal) project that owns the integrated PLC — not in HMI Operate. The HMI Operate interface exposes diagnostics but not full connection configuration.

A common field error: assuming CP 840D parameters live in the HMI's network settings menu. They do not. The CP 840D connection table is part of the PLC's HW Config / device configuration.

4. OPC UA Server Placement on 840D SL

Unlike S7-1200/1500 controllers where the OPC UA server runs inside the PLC firmware, the 840D SL places its OPC UA server on the NC side (NCK). Consequences:

  • The OPC UA server endpoint binds to the NCK's network stack, reachable on the NCU's X130 IP.
  • Activation requires a runtime license on the NC, not the PLC.
  • Tag data is read from PLC via internal NCK-PLC interfaces and exposed through the OPC UA address space.
  • NC software version determines whether the server comes up automatically or requires manual file staging.
Aspect S7-1500 OPC UA Server 840D SL OPC UA Server
Runtime host PLC firmware NCK firmware
License location PLC CPU license NC license (NCK-side)
Config tool TIA Portal OPC UA configuration HMI Operate + bases.ini + NC expert set
Default port 4840 (configurable) 4840 (configurable)

Because the server lives on the NC side, an OPC client that can ping the NCU but cannot OpenSecureChannel on TCP 4840 has either a port/ACL problem, an NC-side license missing, or an NC software version too old to host the server natively.

5. Active vs Passive Connection Establishment

The CP 840D maintains a TCP connection state machine identical to SIMATIC S7 CPs. There are two roles:

  • Active connection establishment: CP 840D issues the CONNECT() call to the remote IP:port.
  • Passive connection establishment: CP 840D binds to a local IP:port and waits for the remote side to connect.

When the connection sits in "passive connection establishment in progress" indefinitely, the CP has executed a LISTEN() and is waiting for a remote SYN that never arrives. Diagnostic branches:

  1. The remote OPC client never sends SYN — fault on the client side (wrong target IP, wrong target port, firewall blocking outbound, wrong active/passive role in client config).
  2. The remote OPC client sends SYN but a network device drops it — ACL, NAT, or routing asymmetry.
  3. The CP 840D is configured passive but the field engineer expected active — configuration error; the checkbox "Active connection establishment" is not set.
If the 840D SL is meant to be the TCP client (and the OPC server is the listener), the CP 840D's connection must be flagged Active. Otherwise the CP will forever sit in passive listen state.

6. Root Cause Matrix

Rank Cause Symptom Quick Verification
1 Wrong target IP in OPC client Connection stays passive forever; client shows no SYN in capture Cross-check OPC client's configured target IP vs NCU X130 address; ping from client
2 Active/passive role mismatch on CP 840D Connection table shows passive, never attempts connect Inspect PLC-side CP connection configuration in STEP 7/TIA
3 OPC UA license missing on NCK Port 4840 closed even though firewall permits Check HMI Operate → Diagnostics → Licenses; verify OPC UA option
4 NC software version without native OPC UA server Port 4840 not listening despite correct config Check NC SW version (must support OPC UA server on NCK without manual file copy)
5 Firewall in system bases.ini blocking TCP Local SYN out or remote SYN in dropped at NCU Inspect system bases.ini on the NCU CFast for firewall / tcpcfg entries
6 NCU firmware bug Symptom clears on identical machine after firmware update Update NC SW per Siemens recommendation; if unresolved, replace NCU
7 Intermediate router/firewall ACL Ping works, TCP does not Capture packet trace at router; verify TCP 4840 not filtered
8 Wrong TSAP / local port in CP connection Connection attempts but rejected (RST) Verify TSAP and local port match on both sides

7. Diagnostic Procedure (Step-by-Step)

Prerequisites

  • STEP 7 / TIA Portal project archive for the 840D SL with the integrated PLC.
  • HMI Operate access (or service menu on the NCU).
  • Read access to the NCU's /user/system/etc/system bases.ini and tcpcfg.ini.
  • A laptop with Wireshark and portqry / nmap available.
  • Out-of-band console (e.g., SSH on X130 if enabled) or direct connection at X130.

Step 1 — Verify Physical and Layer 3

  1. Confirm link LEDs on NCU X130 and adjacent switch port.
  2. From OPC client, ping <NCU IP>. Confirm reachable.
  3. From OPC client, tracert <NCU IP> (Windows) or traceroute. Confirm route.

Step 2 — Inspect CP 840D Connection Configuration (PLC Side)

  1. Open the PLC project in STEP 7 / TIA Portal.
  2. Navigate to CP 840D > Connections.
  3. Identify the connection to the OPC server. Confirm:
Parameter Expected Value Common Error
Partner IP address Matches OPC server IP exactly Single-digit typo; stale entry from a prior machine ID
Partner port / TSAP Matches OPC server listener TCP 4840 vs TSAP 01.01 confusion
Local TSAP / port Unique and unused Duplicate local port with another connection
Active connection establishment Checked if 840D is the TCP client Unchecked when role is reversed
Connection type TCP / ISO-on-TCP / OPC UA — matches server Wrong protocol selected

Step 3 — Verify NC-Side OPC UA State

  1. On HMI Operate, open Commissioning > Licenses. Confirm the OPC UA option is licensed on the NCK.
  2. Check the NC SW version: only newer NC releases host the OPC UA server natively without manual file staging.
  3. If older NC SW is in use, the OPC UA server files must be manually deployed to the NCU and tcpcfg.ini configured.

Step 4 — Firewall and bases.ini Audit

  1. On the NCU, open system bases.ini:
# Example excerpt — adapt to site policy
[LinuxBase]
firewall=1
firewall_in_tcp=4840
firewall_out_tcp=4840
firewall_in_udp=0
firewall_out_udp=0
  1. Ensure the OPC UA TCP port (default 4840) is allowed inbound. Restart of the relevant service may be required after editing.
  2. Check tcpcfg.ini for the OPC UA server's bind address and port.

Step 5 — Capture a Network Trace

  1. Start a packet capture at the OPC client (Wireshark on the client NIC) with display filter tcp.port == 4840 || ip.addr == <NCU IP>.
  2. Reproduce the failure by triggering a connect from the client.
  3. Confirm whether the client ever emits SYN:
  • If no SYN: client-side configuration error (target IP/port, outbound firewall, OPC UA endpoint URL string).
  • If SYN sent, no SYN-ACK: intermediate device filtering, or NC-side listener absent (license, NC version, service crashed).
  • If SYN sent, RST received: NC-side active reject (port bound but not accepting, or wrong protocol).

Microsoft's general TCP/IP troubleshooting guidance (Troubleshoot TCP/IP communication — Microsoft Learn) is the canonical checklist for this trace-then-isolate discipline.

Step 6 — OPC Client-Side Verification

  1. Open the OPC client's configuration (e.g., OPC UA expert tool, Kepware, Ignition, Siemens OPC Scout).
  2. Verify the Endpoint URL:
opc.tcp://<NCU IP>:4840
  1. Verify the client's destination IP is the NCU's X130 address — not the management port of an intermediate device. Single-character typos here are the most frequent field finding.

8. Field-Proven Resolution Path

The original incident resolved when a typo in the OPC client's target IP was corrected. After the IP fix, the connection transitioned from passive-listen to established in seconds. Apply this priority order when reproducing:

  1. Validate IP on both sides. Most failures are configuration errors, not hardware.
  2. Confirm active vs passive role in the CP 840D connection.
  3. Confirm NC-side OPC UA license and NC SW version.
  4. Audit system bases.ini and tcpcfg.ini.
  5. Capture packets at both ends to localize the dropped frame.
  6. If all configuration is correct and trace confirms SYN-reach but no SYN-ACK, escalate to Siemens for NC firmware update.
  7. If firmware update does not resolve, replace the NCU. Field reports indicate this resolves cases where the integrated CP 840D hardware is defective.

9. Firmware Update and Hardware Escalation

When configuration and trace are clean but the failure persists on a single machine among identical peers, Siemens' recommendation is:

  1. Update the NCK firmware on the suspect NCU to the latest released version compatible with the PLC project.
  2. Re-test the OPC UA connection post-update.
  3. If the issue remains, replace the NCU module. Document the NCU order number (e.g., 6FC5371-..., varies by performance class) and warranty status.
Always back up the NC and PLC images, the system bases.ini, and the project archive before applying a firmware update. Down-grade is not always available on field-flashed CFast.

10. Verification Checklist

After applying a remediation, verify the following before returning the machine to production:

  • OPC UA client receives OpenSecureChannel and CreateSession responses.
  • Subscription and monitored items return expected values for at least 5 minutes.
  • Connection state in HMI Operate reads Established (not "passive in progress").
  • No new entries in NCK diagnostic buffer related to CP 840D or OPC UA.
  • Packet capture shows periodic keep-alive / publish traffic consistent with subscription intervals.
  • NCU X130 link utilization remains within nominal envelope (<5% sustained).

11. Related Connection Types on CP 840D

When diagnosing, ensure you are testing the correct transport:

Transport Default Port Typical Use on 840D SL
PROFINET IO n/a (UDP-based) I/O to distributed field devices
S7 Communication 102 (TCP) PUT/GET between PLCs / HMI
ISO-on-TCP (RFC 1006) Configurable, TSAP-based Legacy S7 partner connections
OPC UA (NC-side server) 4840 (TCP, configurable) Modern tag exchange to MES/IT
HMI Web / VNC 5900 / 5800 / 8443 Operator remote access

Confirm the OPC client is actually targeting the OPC UA endpoint (port 4840). A misconfigured S7 connection endpoint will produce a similar "passive establishment" symptom but on port 102.

FAQ

What does "passive connection establishment in progress" mean on a SINUMERIK 840D SL?

It is the CP 840D's connection state when the local side has executed LISTEN on the configured local port/TSAP and is waiting for the remote partner to issue the active CONNECT. It is not a hardware fault; the CP is doing exactly what it was configured to do — listening. The fault lies in the missing or rejected inbound SYN.

Why does the OPC UA server live on the NC side and not the PLC on 840D SL?

Unlike S7-1200/1500 controllers, the 840D SL integrated PLC does not host an OPC UA server. The OPC UA server runs on the NCK, exposes PLC tag data through the NCK-PLC interface, and binds to the NCU's X130 IP. Activation requires an NC-side license, and newer NC SW versions host the server natively.

How do I tell if the OPC UA server is actually listening on the NCU?

From a host with network access, run Test-NetConnection <NCU IP> -Port 4840 (PowerShell) or nc -vz <NCU IP> 4840. A successful TCP handshake means the NC-side listener is up. Confirm the NC SW version supports OPC UA on NCK and that the license is installed in HMI Operate > Licenses.

What is the role of system bases.ini in TCP connectivity?

The system bases.ini on the NCU controls the embedded Linux firewall. Inbound and outbound TCP/UDP ports must be explicitly permitted (e.g., firewall_in_tcp=4840). Without these entries, the CP 840D's connection attempts or listener can be silently filtered.

When should I escalate to NCU replacement?

After the OPC client's target IP, the CP 840D's active/passive flag, the NC-side license, the NC SW version, and the firewall configuration are all verified correct, and a packet trace confirms SYN reaches the NCU but never receives SYN-ACK, the integrated CP 840D is likely defective. Apply Siemens' recommended NC firmware update first; if the failure persists on a single machine among identical peers, replace the NCU.

Back to blog