Problem Overview
A SINUMERIK 840D sl installation with an NCU 720.3 PN and an external PCU 50.5 loses HMI/NCK connection after the user edits base.ini to open a firewall port and reboots. After the reboot, the PCU's HMI software (SINUMERIK Operate) no longer establishes a connection to the NCK, while:
- ICMP ping from the PCU to the NCU succeeds.
- The MCP (Machine Control Panel) comes online normally on the NCK side.
- Activating the internal HMI on the NCU and viewing the screen through a VNC client works.
- Disabling the internal HMI and pointing the PCU's SINUMERIK Operate back at the NCU still results in a no-connect state.
This article documents the diagnostic logic, the relevant parameters inside base.ini, the network services that must be permitted, the standard recovery workflow, and the verification sequence used to confirm that the HMI/NCK handshake is fully restored.
SINUMERIK 840D sl System Architecture
The 840D sl is built on three logical components that communicate over TCP/IP through factory-defined ports and proprietary protocols:
| Component | Role | Typical Designation |
|---|---|---|
| NCU (Numerical Control Unit) | Holds the NCK (NC kernel) and the integrated PLC (SINUMERIK PLC 317 series) | NCU 710.3 PN, NCU 720.3 PN, NCU 730.3 PN |
| PCU (Panel Control Unit) | Industrial PC running Windows / HMI software that hosts SINUMERIK Operate and the HMI user interface | PCU 50.3, PCU 50.5 |
| MCP / HT / TP / Operator panels | Machine Control Panel, Handheld Terminal, Touch Panel, thin client panels connecting to PCU or NCU | MCP 483, MCP 310, HT 2, TP 177B, OP 010, OP 012, OP 015, OP 019 |
The PCU boots Windows, loads the HMI services, and then initiates an HMI/NCK connection to the NCU. The MCP and TP are typically networked to the PCU and reach the NCK through the PCU's HMI proxy. When the MCP is online but the HMI is not, the fault is in the PCU-side HMI/NCK handshake, not in the MCP/NCK link or the underlying IP layer.
Affected Components in This Failure Mode
| Item | Part Number Reference | Notes |
|---|---|---|
| NCU 720.3 PN | 6FC5372-0AA30-0AA0 (with CF card for NCK/PLC software) | Holds NCK software, PLC 317 runtime, internal HMI (Operate / HMI Advanced embedded) |
| PCU 50.5 | 6FC5370-5AA30-0AA0 (typical 840D sl variant) | Windows-based industrial PC, hosts SINUMERIK Operate runtime, ghost image partition, VNC server for remote HMI |
| System Software | NCU system software on CF card; HMI runtime on PCU | Versions must match. Mixing NCU SW 4.x with HMI SW 4.x is required; cross-version combinations are not supported. |
Root Cause Analysis
When base.ini is modified to expose a service through the Windows firewall and the system is rebooted, the HMI/NCK connection can fail for several reasons. Each must be ruled out in order from cheapest to most expensive to verify.
1. Firewall on the PCU now blocks HMI/NCK sockets
Editing base.ini sometimes triggers the PCU to reload the firewall profile, or the operator (intending to open a single port) replaces the rule set with one that is too restrictive. The PCU must allow outbound TCP from the HMI service to the NCU. If the firewall is blocking the HMI/NCK port, the HMI sits in connect-pending and reports Error 150202 "PCU50.5 not connecting to NCK".
2. base.ini corruption or unintended parameter change
base.ini drives the HMI start logic. A stray character, wrong IP, an extra CRLF, or the wrong section key can break the handshake without the HMI service reporting a clear reason. Reverting the file to its last known-good backup is the standard corrective step.
3. Internal HMI vs. external HMI contention
If Internal HMI is enabled on the NCU and an external HMI on the PCU is also starting, both can race for the HMI/NCK session. The internal HMI takes the seat by default. The external HMI must either wait, or the internal HMI must be disabled, or the PCU must connect with a higher priority and displace the internal session. The symptom in the source — internal HMI works, external HMI does not — is consistent with the NCK accepting the internal session first and not handing the seat over.
4. NCK / HMI version mismatch
If the ghost image restored a different HMI runtime version than the NCK SW on the CF card expects, the HMI/NCK connection may fail to complete its protocol negotiation. A version handshake is performed at the start of every HMI/NCK session; mismatch produces a 150202-class error.
5. Network route or gateway change
Although the user reported that ICMP ping from PCU to NCU works, the TCP path used by the HMI service may traverse a different interface or a different route. With the firewall changes in place, the PCU may be reaching the NCU on the management network while the HMI service is bound to the company network interface (or vice versa).
Diagnostic Procedure
Follow this order. Each step takes only minutes and avoids the need for a full PCU re-image if the cause is recoverable.
Step 1 — Capture the current state of base.ini
Open a command prompt on the PCU with administrator rights and back up the current file before changing anything:
copy C:\Program Files\Siemens\Automation\SinumerikHMIVersion\base.ini base.ini.bak
The actual path varies by HMI version; the canonical locations are:
- For older HMI Advanced:
F:\Baseor the corresponding installation drive. - For SINUMERIK Operate:
C:\Program Files (x86)\Siemens\Automation\SCADA\SinumerikHMIor under the configuredHMIVersionpath.
Step 2 — Verify HMI/NCK network reachability on the application port
Ping is necessary but not sufficient. Confirm the TCP port the HMI/NCK service listens on is reachable from the PCU:
telnet <NCU_IP> 19212
If telnet is not installed, use PowerShell:
Test-NetConnection -ComputerName <NCU_IP> -Port 19212
The NCU's HMI/NCK listener uses the SINUMERIK-defined TCP port (19212 in current 840D sl software revisions). A successful TCP three-way handshake shows the firewall and IP routing are both healthy. A timeout indicates either a routing problem, a firewall block, or the NCK not having finished booting.
Step 3 — Inspect the base.ini parameters that govern the HMI/NCK link
Open base.ini with a plain-text editor (Notepad, Notepad++) and verify the following sections. Do not use Word, WordPad, or any editor that can insert Unicode characters.
| Section | Key | Typical Value | Meaning |
|---|---|---|---|
| [HMI] | Address | 192.168.214.1 | IP of the NCU the PCU will connect to |
| [HMI] | Port | 19212 | TCP port for the HMI/NCK service |
| [HMI] | Timeout | 15000 | Connection / read timeout in ms |
| [TCP] | Retries | 3 | Number of retry attempts before Error 150202 |
| [HMI_NCK] | Version | 04.07 | Expected NCK version; must match CF card |
| [internalHMI] | Enable | 0 | Disable internal HMI so the PCU owns the seat |
| [HOST] | Name | PCU50.5 | Logical PCU name |
Step 4 — Revert base.ini to the last known-good version
If a backup exists from before the firewall change, copy it back:
copy base.ini.bak base.ini
If no backup exists, compare the file against a sibling PCU 50.5 at the same SW level, or against the factory default for the same HMI version. A consistent file will have valid section headers, comments starting with ;, and CR/LF line endings only.
Step 5 — Disable Internal HMI on the NCU
With the PCU present, the internal HMI on the NCU must be disabled so the PCU owns the only HMI/NCK session. On the NCU side this is controlled through commissioning (in HMI Advanced: Startup > Operating Area Switchover; in Operate: Commissioning > HMI > Internal HMI), or by setting [internalHMI]Enable=0 in the NCU's mmc.ini / sldgconfig equivalent for the active boot. A reboot of the NCU is required for the change to take effect.
Step 6 — Audit the Windows firewall on the PCU
Open Windows Defender Firewall with Advanced Security and verify the rules governing the HMI service. The minimum required is an outbound allow rule for the HMI executable to the NCU IP, TCP port 19212. A misconfigured rule set that opens one port and implicitly denies the rest is a common cause of 150202.
| Port | Protocol | Direction | Service |
|---|---|---|---|
| 19212 | TCP | Outbound (PCU → NCU) | HMI/NCK |
| 102 | TCP | Bidirectional (only if PLC S7 routing over Ethernet is enabled) | S7Comm |
| 5900 / 5901 | TCP | Inbound (PCU only, for VNC) | VNC server (diagnostic) |
| 445 / 139 | TCP | Company network share path if the user opened file-share ports | SMB |
Step 7 — Reboot in the correct order
NCK first, then PCU. The PCU's HMI service must not start before the NCK has finished booting and the HMI/NCK listener is ready, otherwise the PCU will time out and report 150202. Allow at least 60 s after the NCU's seven-segment display reaches 6 (Ready / Run) before starting the PCU's HMI runtime.
Step 8 — Capture and interpret HMI/NCK log files
If the error persists, pull the HMI startup log:
type C:\ProgramData\Siemens\HMI\Logs\hmistartup.log
Search the log for the strings 150202, connection refused, timeout, and version mismatch. Each corresponds to a different root cause:
| Log Token | Root Cause | Corrective Action |
|---|---|---|
| connection refused | NCK not ready, wrong port, or wrong IP | Verify NCU IP and port; wait for NCK 6 state |
| timeout | Firewall drop, route, or NCK hang | Open PCU firewall for TCP 19212; check NCU seven-segment |
| version mismatch | NCK SW / HMI SW mismatch | Upgrade the lower side; or downgrade the higher side |
| session in use | Internal HMI active or another PCU holds the seat | Disable internal HMI; verify only one external HMI connects |
Step 9 — If the issue cannot be resolved, restore the ghost image
When the user cannot isolate the corrupt parameter or the file system damage, restore the PCU's ghost image. The PCU 50.5 has a dedicated recovery partition and supports a one-key ghost image restore from boot. The procedure is documented in the PCU 50.5 operating manual referenced below.
base.ini Deep Dive
base.ini is the central configuration file for the HMI runtime on the PCU. Errors in this file are the most common cause of 150202 in 840D sl installations. The file is read at HMI start; it is not re-read during runtime. Any change requires a service restart or a reboot.
Encoding and line endings
The file is encoded in ASCII / Windows-1252. UTF-8 with BOM is not accepted by older HMI versions. Line endings must be CR/LF. Editing in tools that convert to LF only (Notepad on macOS, certain Linux editors) will fail to parse, and the HMI start logic silently ignores the entire file, falling back to defaults that may not match the local NCU.
Section order
The HMI service does not require a specific section order, but every section referenced from [HMI] must be present. A missing [HMI_NCK] section produces a no-connect state without a useful error string.
Common mis-edits
- Editing a section header key (e.g.,
[HMI]→[HMI ]with a trailing space). The section is then ignored. - Inserting a Unicode character (em dash, smart quote) by accident. The parser stops at the first non-ASCII byte.
- Setting
Addressto the management IP of the NCU while the HMI service is bound to the company-side interface. The HMI service uses the IP of the local PCU's outgoing interface, not the destination, to determine routing. - Replacing the file with one from a different HMI SW version. The section keys differ between SW 4.5, 4.7, 4.8, and 5.x.
Network and Firewall Configuration
The HMI/NCK link is a single TCP session from the PCU to the NCU. The NCU listens on a fixed port. The PCU initiates. Therefore, on the PCU the relevant rule is outbound allow to NCU port 19212.
Firewall rule template (PowerShell)
New-NetFirewallRule -DisplayName "SINUMERIK HMI/NCK outbound" `
-Direction Outbound -Action Allow `
-Protocol TCP -RemoteAddress <NCU_IP> -RemotePort 19212 `
-Program "C:\Program Files\Siemens\Automation\HMI\hmiruntime.exe"
This is the narrowest rule that satisfies the HMI/NCK requirement. The wider the rule, the more risk of inadvertently exposing other Windows services on the company network.
Interface binding on the PCU
The PCU 50.5 typically has two Ethernet interfaces:
| Interface | Typical Use | Address Family |
|---|---|---|
| X1 (company / corporate network) | Default route, Windows services, network shares | 10.x / 172.16.x / 192.168.x per plant |
| X2 (SINUMERIK plant network) | NCU, MCP, drives, I/O | 192.168.214.x (default 840D sl plant network) |
If base.ini contains a [HMI]Address value on the 192.168.214.x subnet but the PCU's X2 interface is not connected or its metric is higher than X1, the HMI traffic leaves on the wrong interface and the connection times out. Set the interface metric so that the SINUMERIK plant network interface has a lower metric (higher priority) than the corporate network interface:
Set-NetIPInterface -InterfaceAlias "SINUMERIK_Plant" -InterfaceMetric 10
Set-NetIPInterface -InterfaceAlias "Corporate" -InterfaceMetric 20
Commissioning Workflow After Recovery
Once the HMI/NCK link is restored, complete the following checks before returning the machine to production.
- Confirm SINUMERIK Operate shows the channel status, axes, and tool list (proves NCK variables are streaming).
- From the HMI, read a known NCK variable via the Diagnosis > NC/PLC Variables area. A non-zero return confirms bidirectional communication.
- Cycle power on the NCU with the PCU running; the HMI must auto-reconnect within 30 s. If not, Error 150202 returns and a re-image is the most likely cure.
- Verify PLC online. From SINUMERIK Operate, open Commissioning > PLC > Online. The PLC must be visible and a project upload must succeed.
- Test the MCP. Move the axis-selection rotary and confirm the active axis indicator updates on the HMI. This proves MCP → HMI → NCK routing.
- Capture a fresh ghost image of the PCU. Store it on the recovery partition and on an external backup medium. A known-good image saved immediately after commissioning is the most valuable asset for the next incident.
Verification Checklist
| Check | Pass Criterion | Tool |
|---|---|---|
| ICMP PCU → NCU | Reply received, RTT < 5 ms on plant network | ping |
| TCP/19212 PCU → NCU | Three-way handshake completes | Test-NetConnection / telnet |
| HMI startup | No Error 150202 in hmistartup.log | Log inspection |
| NCK ↔ HMI | Channel status, axes, tools visible | SINUMERIK Operate |
| PLC online | Project upload succeeds | Operate / STEP 7 |
| MCP online | Axis selection updates HMI | Operator panel |
| Power cycle | HMI auto-reconnects within 30 s | NCU cold restart |
Preventive Measures
- Treat
base.iniedits as controlled changes. Always back up the file before editing. Maintain a configuration baseline per machine in a versioned repository. - Apply firewall changes through a single script and test against the verification checklist before placing the machine back in production.
- Keep NCK SW and HMI SW at matched versions. Use the compatibility matrix in the Base Software Commissioning Manual to plan upgrades.
- Take a fresh ghost image of the PCU immediately after commissioning, after every approved change, and after every software update.
- Disable the internal HMI on the NCU when an external PCU is the intended operator interface. Leaving the internal HMI enabled produces intermittent 150202 errors when both sessions contend for the same HMI/NCK seat.
- Document the HMI/NCK port (19212) and the SINUMERIK plant network (192.168.214.0/24 by default) in the plant's network inventory. The plant network should be a separate VLAN, segregated from the corporate network, and reachable only through controlled paths.
Documentation References
- SINUMERIK 840D sl Base Software Commissioning Manual
- SINUMERIK 840D sl Base Software and Operating Software Commissioning Manual
- SINUMERIK 840D sl PCU 50.5 Operating Manual
- SINUMERIK 840D sl Operator Components Manual
- SINUMERIK 840D sl Network Configuration Manual
FAQ
What does SINUMERIK Error 150202 mean on a PCU 50.5?
Error 150202 indicates that the PCU's HMI service cannot establish a TCP session to the NCK on the NCU. The PCU has the IP layer working (ping passes) and the MCP path works, but the HMI/NCK handshake fails — most often due to firewall rules, a corrupt base.ini, an internal HMI session holding the seat, or a version mismatch between NCK SW on the CF card and HMI SW on the PCU.
Which TCP port does the HMI/NCK service use on an NCU 720.3 PN?
The HMI/NCK service listens on TCP port 19212. Confirm reachability with Test-NetConnection -ComputerName <NCU_IP> -Port 19212. If the connection times out, check the PCU firewall, the interface metric, and the NCK boot state on the seven-segment display.
How do I tell whether the failure is on the PCU side or the NCU side?
If the internal HMI on the NCU works (visible via VNC on the NCU's VNC server), the NCK, PLC, and HMI/NCK listener are healthy and the failure is on the PCU side. If the internal HMI also fails, the NCU itself is at fault — typically a corrupt CF card, a missing mmc.ini, or an NCK SW version not matching the boot configuration.
Can I edit base.ini while the HMI service is running?
No. The HMI service reads base.ini at startup and does not re-read it. Any change requires a service restart, or more reliably, a reboot of the PCU. Always back up the file before editing and use an editor that preserves CR/LF line endings and ASCII encoding.
When should I give up troubleshooting and restore the ghost image?
When the diagnostic procedure cannot isolate the failure within a service window, or when base.ini and the Windows firewall have both been verified and the HMI/NCK link still does not come up, restore the ghost image from the PCU's recovery partition. The image restore returns the PCU to a known-good Windows / HMI state in 10–20 minutes and is faster than continued non-destructive diagnosis.