Troubleshooting WinCC 7.5 OPC UA Server Disconnect on Reboot
When SIMATIC WinCC 7.5 is configured as an OPC UA client against the MELSOFT MX OPC Server UA from Mitsubishi Electric, the runtime may report the OPC channel in red (Tag Management) immediately after a project restart or WinCC Explorer reactivation. The MELSOFT MX OPC Server UA process is running, the Browse OPC server dialog enumerates the address space correctly, and a manual reconnect from the channel diagnostic does not re-establish the link. The only field-proven recovery in this exact symptom pattern is a full Windows reboot. This reference isolates the root cause, provides deterministic diagnostics, and walks through the corrective steps that bring the channel back to a green state without rebooting the host.
1. Problem Overview
The failure mode is reproducible and behaves as follows:
- WinCC Explorer is left running; the project is activated.
- The operator (or a scheduled event) deactivates and reactivates the project, or WinCC is restarted as a service.
- Within seconds, the OPC UA channel in WinCC Tag Management shows a red connection icon.
- Opening Tag Management → OPC → Browse OPC server enumerates tags successfully; the OPC server process is responsive.
- Clicking Update on the channel does not clear the red state.
- Restarting the MX OPC Server UA, the PLC, or the WinCC Runtime service does not clear the red state.
- A full Windows reboot is the only action that returns the channel to green.
The contradiction between a red channel and a working Browse dialog is the diagnostic fingerprint of the issue: the WinCC channel cache and the OPC Enum path are out of sync with the live server.
2. Affected Versions and Environment
| Component | Version / Build | Notes |
|---|---|---|
| SIMATIC WinCC | V7.5, V7.5 SP1, V7.5 SP2 (Update 2 and later recommended) | CSPA cache behavior changed in Update 2 |
| MELSOFT MX OPC Server UA | V3.x, V4.x (UA 1.04 server profile) | Default endpoint opc.tcp://localhost:48050 |
| MELSOFT MX Component | V5.x | Provides the COM wrapper and UA bridge |
| GX Works / GX Works2 / GX Works3 | Any version supporting MX Component 5.x | Used to build the PLC project |
| Windows | Windows 10 IoT Enterprise LTSC 2019, Windows Server 2016/2019/2022 | DCOM model required |
| .NET Framework | 4.7.2 or later | OPC UA stack prerequisite |
| WinCC service account | Local Administrator or "Siemens" service account | Must own the OPC UA endpoint ACL |
3. Root Cause Analysis
Three root causes dominate this exact symptom pattern. They can co-occur; treat them in the order presented.
3.1 OPC Server Auto-Start Service Order Race
The WinCC 7.5 OPC UA client channel discovers servers through the Windows OpcEnum service, not through OPC UA Discovery. When WinCC Runtime initializes, it requests the Enum result synchronously. If the MELSOFT MX OPC Server UA service is registered with a Manual start type, or if it depends on a network resource (license server, MX Component management service) that has not finished initializing, the Enum returns a NULL server pointer even though MXOpcUaServer.exe is launchable on demand. The WinCC channel marks the connection red, but the Browse dialog still works because it uses CLSID lookup to instantiate the COM object directly, bypassing Enum.
3.2 COM/DCOM Orphaned Process in the Running Object Table
Repeated project re-activations without exiting WinCC Explorer can leave orphaned COM server instances. Each new activation increments the reference count on the OPC server's Running Object Table (ROT) entry, but the previous ROT entry is not released because the WinCC CSPA (Channel State Persistence Agent) fails to call IUnknown::Release() on channel teardown. The MELSOFT MX OPC Server UA, running in-process or local out-of-process, eventually refuses new client subscription requests until the ROT is rebuilt, which only happens at Windows logon or a full restart. UA Expert will reproduce the same refusal when it is the first client opened after a WinCC cycle, which is a useful cross-check.
3.3 Stale Security Token in the WinCC Channel Cache
The WinCC OPC UA channel caches the user identity token obtained at the first successful connect. When WinCC Runtime restarts inside the same Windows session, the cached SecurityToken is reused even though the server has generated a new one after a session timeout. The server returns Bad_SessionClosed or Bad_IdentityTokenRejected, which WinCC displays as a red channel. The Browse dialog bypasses the channel cache and opens a fresh UA session, which is why it succeeds.
4. Diagnostic Procedure
Run these checks before applying any fix. The order is intentional: each step isolates one of the three root causes.
- Open WinCC Explorer → Tools → Channel Diagnostics. Record the channel state, error code, and last successful poll timestamp. A red state with code
0x80070005(E_ACCESSDENIED) points to DCOM;0x80004005(E_FAIL) points to the CSPA cache. - Open Windows Event Viewer → Windows Logs → Application. Filter on Source =
OPC,COM,MELSOFT, andOpcEnum. Look for events with Event ID 10010 (DCOM launch failure) and 10016 (DCOM permission). - Start the MELSOFT MX OPC Server UA configuration tool. Verify the UA endpoint URL (default
opc.tcp://localhost:48050) and the security policy in use. - From an elevated Command Prompt, confirm the server process is alive:
tasklist /fi "imagename eq MXOpcUaServer.exe" - Verify the OPC Enum service is running:
Expected state:sc query OpcEnumRUNNING. Start type:Auto. - Use a third-party OPC UA test client (for example UA Expert) to confirm the endpoint is reachable independent of WinCC. A successful UA Expert session proves the server is healthy; a failure proves the issue is server-side or network-side.
- Export the WinCC channel logs from
C:\ProgramData\Siemens\Automation\WinCC\Diagnosticsand review the most recentOPCUAChannel.logfor token reuse messages. - Capture a network trace with Wireshark on the loopback interface, filter on
opc.tcp, and verify that a CreateSessionRequest is sent within 5 seconds of project activation. The absence of the request confirms the CSPA cache orphan.
5. Step-by-Step Solution
5.1 Convert the MX OPC Server UA to an Auto-Start Service
Open an elevated Command Prompt and execute:
sc config "MELSOFT MX OPC Server UA" start= auto
sc start "MELSOFT MX OPC Server UA"
Add a service dependency on the WinCC service to enforce start order:
sc config "MELSOFT MX OPC Server UA" depend= "WinCC/OpcEnum"
Reboot Windows. Confirm the service state is RUNNING before launching WinCC Explorer.
5.2 Re-Register the OPC Server in the Windows Registry
Re-run the MELSOFT MX OPC Server UA installer with the Register OPC Server option, or manually merge the following registry fragment with the actual CLSID from the OPC server About dialog:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}]
@="MELSOFT MX OPC Server UA"
[HKEY_CLASSES_ROOT\CLSID\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}\LocalServer32]
@="C:\\Program Files\\Mitsubishi\\MXComponent\\MXOpcUaServer.exe"
[HKEY_CLASSES_ROOT\CLSID\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}\ProgID]
@="MELSOFT.MXOPCServerUA.1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MELSOFT.MXOPCServerUA.1]
@="MELSOFT MX OPC Server UA"
After merging, restart the OpcEnum service:
net stop OpcEnum && net start OpcEnum
5.3 Configure the WinCC Channel Reconnect Parameters
Edit the WinCC OPC UA channel configuration (typically OPCUA.ini in the project \<ProjectName>\Library folder) and set the following values. The defaults are conservative; the values below balance recovery time and server load.
| Parameter | Recommended Value | Default | Effect |
|---|---|---|---|
| ReconnectInterval | 30 s | 60 s | Time between reconnect attempts |
| MaxReconnectAttempts | 10 | 3 | Number of attempts before giving up |
| SessionTimeout | 600000 ms | 300000 ms | Matches the MX OPC Server UA default |
| SecurityPolicy | None (lab) / Basic256Sha256 (production) | None | Set per security policy |
| KeepAliveCount | 10 | 5 | Watchdog packets per session timeout |
5.4 Apply Windows DCOM Permissions
Open dcomcnfg.exe and navigate to Component Services → Computers → My Computer → DCOM Config. Right-click the MELSOFT MX OPC Server UA entry and configure the following tabs:
-
Identity: select This user and enter the WinCC runtime service account (typically
.\Siemensor the logged-on operator account). - Security: under Launch and Activation Permissions, add the WinCC service account with Allow on Local Launch, Remote Launch, Local Activation, Remote Activation.
- Endpoints: confirm the OPC UA TCP port 48050 is in the static exceptions list. If the Windows Firewall is active, add an inbound rule:
netsh advfirewall firewall add rule name="MX OPC UA 48050" dir=in action=allow protocol=TCP localport=48050
5.5 Clear the WinCC Channel State Cache
Stop the WinCC Runtime services:
net stop "CCAgent"
net stop "WinCC"
Delete the CSPA cache files:
del /q "C:\Program Files\Siemens\Automation\WinCC\bin\CSPA*.dat"
del /q "%ProgramData%\Siemens\Automation\WinCC\ChannelState\*.csc"
Restart the runtime. The first activation will rebuild the cache and issue a fresh CreateSessionRequest, clearing the stale token issue.
6. Verification
After applying the corrective steps, perform the following validation sequence:
- Reboot Windows. Verify the
MELSOFT MX OPC Server UAservice starts automatically and reaches theRUNNINGstate before the WinCC services. - Launch WinCC Explorer and activate the project. Confirm the OPC UA channel in Tag Management transitions to green within 30 seconds.
- Open Channel Diagnostics and confirm no error code is reported.
- Stop and restart the project five times in succession. The connection should remain green throughout, with no orphaned ROT entries observable in Process Explorer → System Information → ROT.
- Run a 24-hour soak test. Monitor
OPCUAChannel.logfor anyBad_SessionClosedorBad_IdentityTokenRejectedmessages. A clean run confirms the fix.
7. Connection Lifecycle Diagram
8. Related Configuration Notes
For environments planning a migration from WinCC 7.5 to TIA Portal / WinCC Unified, the OPC UA client architecture is fundamentally different. The WinCC Unified OPC UA client is configured directly in TIA Portal as an HMI device connection, supporting both alarm and tag subscription models without a separate OPC server process. The native MELSOFT MX OPC Server UA integration path is not required when using WinCC Unified, because the Mitsubishi MC protocol can be loaded directly via the Mitsubishi driver in TIA Portal. For users of SIMATIC WinCC classic on third-party OPC servers, the OPC UA Extension for SIMATIC WinCC from Unified Automation provides a drop-in channel that bypasses the legacy COM Enum entirely and is worth evaluating for new deployments.
For teams using the modern TIA Portal toolchain, the Using the WinCC Unified OPC UA client (RT Unified) documentation describes the equivalent configuration on the Unified platform. WinCC V7.5 does not use that configuration model; treat the two as separate architectures when porting example projects.
9. Alternative Approaches
If the OPC UA route continues to fail after the corrective steps above, evaluate the following alternatives. They are listed in order of operational impact.
9.1 Direct MX Component to WinCC Tags
If a license is available, the WinCC Mitsubishi MX Channel provides direct MX Component access without an OPC server in the loop. This removes the entire OPC Enum / CSPA failure surface and is the most robust long-term fix for classic WinCC installations.
9.2 Modbus TCP Gateway
Most Mitsubishi MELSEC controllers expose a Modbus TCP gateway either natively (iQ-R, iQ-F) or via the MX Component Modbus Server add-on. Configuring a Modbus TCP channel in WinCC is a well-documented path and avoids the OPC UA stack entirely.
9.3 Fallback to OPC DA
The symptom does not reproduce on the legacy MELSOFT MX OPC Server DA. If OPC UA is not a hard requirement, OPC DA is a pragmatic fallback for the duration of the upgrade project.
10. Field-Proven Caveats
- The MELSOFT MX OPC Server UA does not support a watchdog keep-alive. The WinCC channel will not detect a server crash within the session timeout window. Plan for an external watchdog (for example, a scheduled task that pings the endpoint with a ReadRequest) if server availability is safety-relevant.
- The red channel state in WinCC Tag Management is purely cosmetic for OPC UA subscriptions. Runtime tag values continue to update from the cached subscription for the duration of the session timeout. Loss of the red state alone is not a process control risk.
- Always test with the OPC UA Discovery URL (
opc.tcp://localhost:48050) before assuming a server-side fault. A failure to resolve the URL is a Windows Firewall issue, not a WinCC issue. - The MELSOFT MX OPC Server UA service name varies by installation language. The English installer registers it as
MELSOFT MX OPC Server UA; the Japanese installer registers it asMELSOFT MX OPC Server. Verify withsc query state= allbefore scripting service control. - Do not disable the
OpcEnumservice. WinCC 7.5 OPC DA channels still depend on it. The CSPA orphan can be cleared by restartingOpcEnumalone, without a full Windows reboot, after the CSPA cache is deleted.
11. Quick Reference: Fault Code Matrix
| Error Code | Symbolic Name | Root Cause | Corrective Action |
|---|---|---|---|
| 0x80070005 | E_ACCESSDENIED | DCOM launch or activation denied | Step 5.4 (DCOM permissions) |
| 0x80004005 | E_FAIL | CSPA cache orphan or stale token | Step 5.5 (clear CSPA) |
| 0x80040154 | REGDB_E_CLASSNOTREG | CLSID missing from registry | Step 5.2 (re-register server) |
| 0xC0040007 | Bad_SessionClosed | Server closed stale session | Step 5.3 (raise SessionTimeout) |
| 0x80200000 | Bad_IdentityTokenRejected | Cached token mismatch | Step 5.5 (clear CSPA) |
| 0x800706BA | RPC_S_SERVER_UNAVAILABLE | OpcEnum not running | Start OpcEnum, set to Auto |
Why does "Browse OPC server" work when the WinCC channel is red?
Browse uses CLSID lookup to instantiate the COM object directly. The WinCC OPC UA channel uses the OpcEnum service to enumerate running servers. The two paths are independent, and a server can be visible to one and invisible to the other, which is the diagnostic fingerprint of this issue.
Is this issue fixed in WinCC 7.5 Update 2 or later?
The CSPA cache behavior was tightened in WinCC 7.5 Update 2. Earlier versions (V7.5, V7.5 SP1) require the manual cache-clear workaround in Step 5.5. Verify your installed version under WinCC Explorer → Help → About.
Can the same fix be applied to WinCC V7.4?
Yes. The registry re-registration (Step 5.2) and DCOM permission steps (Step 5.4) apply unchanged. The CSPA cache file location differs: on V7.4 the files live under C:\Program Files\Siemens\Automation\WinCC\bin\ with the same CSPA*.dat pattern.
Does a Windows restart still matter if the MX OPC Server UA service is set to Auto?
Yes, if the service dependency is not configured. WinCC Runtime in V7.5 caches the OpcEnum result at first launch. If the MX OPC Server UA service starts after the WinCC CSPA initializes, the channel reports red. Configure the service dependency on the WinCC service (Step 5.1) to enforce start order.
What is the default OPC UA endpoint for the MELSOFT MX OPC Server UA?
The default endpoint is opc.tcp://localhost:48050, configurable in the MX Component installation directory. The endpoint accepts the None security policy by default; production deployments should switch to Basic256Sha256 and configure a certificate trust list.
Can I confirm the fix without rebooting Windows?
Yes. Stop the WinCC services, delete the CSPA cache (Step 5.5), restart the OpcEnum service, then start WinCC. The channel should transition to green within 30 seconds. A full Windows reboot is the worst-case recovery path, not a required step.