Resolving WinCC OPC Server Error 0x80040154 REGDB_E_CLASSNOTREG in SIMATIC PCS 7
In SIMATIC PCS 7 and WinCC, the COM exception 0x80040154 (REGDB_E_CLASSNOTREG - Class Not Registered) occurs when an OPC client attempts to instantiate a 32-bit WinCC OPC COM object from a 64-bit process without an out-of-process surrogate, or when the OPC Foundation Core Components or WinCC OPC Server registry keys are missing or uninstalled. To resolve it, configure 32-bit execution mode (x86) in the client application, install the 32-bit and 64-bit OPC Core Components redistributable, and verify WinCC OPC Server component registration using regsvr32.
Table of Contents
- Root Causes of REGDB_E_CLASSNOTREG (0x80040154) in WinCC OPC Architectures
- 32-Bit vs. 64-Bit Registry Architecture Comparison Table
- Step-by-Step Resolution: OPC Core Components and DLL Registration
- Configuring DCOM and Client Process Bitness for WinCC OPC DA/HDA/AE
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Root Causes of REGDB_E_CLASSNOTREG (0x80040154) in WinCC OPC Architectures
The Windows COM error code 0x80040154 (REGDB_E_CLASSNOTREG) translates formally to Class not registered. In SIMATIC WinCC V7.x and PCS 7 OS stations, this exception is thrown during the initial COM connection call (CoCreateInstance or CoCreateInstanceEx) when an external client application attempts to access the WinCC OPC Server (OPCServer.WinCC, OPCServer.WinCC.A&E, or OPCServer.WinCC.HDA).
The failure is caused by three primary architectural factors:
1. Process Bitness Mismatch (64-bit Client vs. 32-bit WinCC COM Servers): WinCC V7.0 through V7.4 and PCS 7 OS run as 32-bit applications. Their registered in-process COM libraries and out-of-process local servers reside in the 32-bit Windows registry hive (HKEY_CLASSES_ROOT\WOW6432Node\CLSID). If a custom .NET OPC client or third-party historian client is compiled as a 64-bit process (x64 or Any CPU with Prefer 32-bit unchecked on a 64-bit Windows OS), the 64-bit client searches HKEY_CLASSES_ROOT\CLSID. Because the 64-bit registry lacks the requested Class ID (CLSID), Windows returns 0x80040154.
2. Missing or Corrupted OPC Foundation Core Components: WinCC relies on standard OPC Foundation redistributable assemblies (e.g., opcproxy.dll, opccomn_ps.dll). If these core files are damaged, uninstalled by third-party software, or not registered during installation, COM activation fails.
3. Unregistered WinCC OPC Server Binaries: When WinCC updates or updates to PCS 7 are applied without administrative rights, or if an OS project is moved across computers with different paths, the WinCC OPC server DLLs and executables lose their COM class registrations.
32-Bit vs. 64-Bit Registry Architecture Comparison Table
Understanding how COM registration differs between 32-bit and 64-bit subsystems is vital for diagnosing connection errors:
HKLM\Software\Classes\WOW6432Node\CLSIDHKLM\Software\Classes\CLSIDWOW6432Node (32-bit native)C:\Windows\SysWOW64\C:\Windows\System32\C:\Program Files (x86)\...comexp.msc or mmc comexp.msc /32comexp.msc (Standard 64-bit MMC)0x80040154WinCCExplorer.exe acts as local serverDistributor and integration advisory: Validate OPC client software entitlements and third-party interface compatibility against authorized vendor specifications.
Step-by-Step Resolution: OPC Core Components and DLL Registration
Execute the following administrative steps on the WinCC station to resolve class registration failures:
- Reinstall OPC Foundation Core Components:
* Navigate to the PCS 7 installation media:...\Support\OPC_Core_Components\.
* Alternatively, download the latest official OPC Core Components Redistributable (x86 and x64) from the OPC Foundation repository.
* Run the installer as Administrator. Ensure both the 32-bit and 64-bit versions are installed on 64-bit Windows systems. - Re-register WinCC OPC COM Components:
* Open an elevated Command Prompt (Run as Administrator).
* Navigate to the WinCC binary directory:
cmd cd /d "C:\Program Files (x86)\Siemens\WinCC\bin"
* Register the core WinCC OPC server binaries:
cmd regsvr32.exe opcda.dll regsvr32.exe opcae.dll regsvr32.exe opchda.dll sopcsrvr.exe /regserver
* Ensure eachregsvr32execution returns a confirmation dialog stating: DllRegisterServer succeeded. - Re-register System COM Marshalling Proxies:
* In the elevated Command Prompt, execute:
cmd cd /d "C:\Windows\SysWOW64" regsvr32.exe opccomn_ps.dll regsvr32.exe opcproxy.dll
Configuring DCOM and Client Process Bitness for WinCC OPC DA/HDA/AE
If the OPC client is an external program developed in C#, VB.NET, or C++:
1. Force 32-Bit Target Platform in Client Application:
* In the Visual Studio or compiler project settings, open Build Properties.
* Change Platform Target from Any CPU or x64 to x86.
* Recompile the executable. This forces the Windows OS to launch the client inside the WOW64 subsystem, directly exposing the 32-bit WinCC COM registrations.
2. Configure 32-Bit DCOM Settings (comexp.msc /32):
* Press Windows Key + R, type mmc comexp.msc /32 and press Enter.
* Navigate to Component Services > Computers > My Computer > DCOM Config.
* Locate OPCServer.WinCC (and OPCServer.WinCC.A&E).
* Right-click and select Properties.
* Under the Security tab, verify that SYSTEM, SIMATIC HMI, and the connecting user account have Launch and Activation Permissions and Access Permissions set to Allow.
* Under the Identity tab, ensure the server runs under The interactive user or a dedicated administrator service account member of SIMATIC HMI.
Verification
Verify that class registration is fully restored:
1. Launch the standard Siemens diagnostic tool OPC Scout V10 or a lightweight third-party tool like OPC Quick Client.
2. Browse local COM servers under OPC DA > Local Server.
3. Confirm that OPCServer.WinCC appears in the list and can be expanded without throwing 0x80040154.
4. Connect to the server, add a test item (e.g., @CPU_RT), and confirm that the item state displays Good with live timestamp updates.
Limitations and Operational Precautions
- Never attempt to register 64-bit wrapper DLLs directly over native 32-bit WinCC server DLLs using standard
System32\regsvr32.exe; this can corrupt the Windows COM surrogate architecture. - WinCC OPC DA (Data Access) utilizes legacy COM/DCOM technology; for modern, firewall-friendly, cross-network communication, deploy SIMATIC NET OPC UA or the OpenPCS 7 OPC UA interface.
- Always ensure the user account running the remote OPC client is configured with matching credentials in the local Windows users group
SIMATIC HMIon the WinCC OS server.
Engineer FAQ
Can a 64-bit OPC client connect to a 32-bit WinCC OPC DA server?
Not directly via in-process COM DLLs. A 64-bit client requires an out-of-process DCOM connection, an OPC wrapper/bridge (such as OPC .NET DA wrapper), or the client application must be compiled targeting x86.
What is the difference between error 0x80040154 and 0x80080005?
Error 0x80040154 (REGDB_E_CLASSNOTREG) indicates the server class is not registered in the registry. Error 0x80080005 (CO_E_SERVER_EXEC_FAILURE) means the class is registered, but the executable failed to start or timed out during launch.
Does OpenPCS 7 eliminate the need for 32-bit DCOM configuration?
Yes. OpenPCS 7 provides an OPC UA server interface (IEC 62541), which uses TCP/IP binary communication and bypasses Windows COM/DCOM registry requirements entirely.
Technical References
- SIMATIC HMI WinCC V7.3 WinCC: Communication Manual (A5E34775450)
- OPC Foundation: OPC Data Access Custom Interface Standard 3.0
- Siemens Support Entry 41196: DCOM and OPC Server Troubleshooting
Related Articles
- Resolving WinCC OPC Server Error 0x80080005 Server Execution Failed
- Configuring OpenPCS 7 OPC UA Server for Secure SCADA Connectivity
- Step-by-Step DCOM Security Hardening for WinCC and PCS 7 Stations
Related Tags
- WinCC OPC
- 0x80040154
- REGDB_E_CLASSNOTREG
- DCOM
- OPC DA
- SysWOW64
- PCS 7 OS