Resolving WinCC Error 42C2: PLCSIM Named Connection Failure

David Krause10 min read
HMI / SCADASiemensTroubleshooting
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

Resolving WinCC Error 42C2: PLCSIM Named Connection Failure

WinCC Runtime (RT) and WinCC Flexible RT raise channel diagnostics error 42C2 (constant L4_DLL_E_LOGDEV) the moment the OS switches from compile to runtime when the HMI station talks to SIMATIC S7-PLCSIM over the ISO-on-TCP / MPI Named Connection path. The exclamation mark on the connection handshake in Tag Management and the channel error text are symptoms of a single underlying defect: the S7 communication DLL cannot bind to the logical device name that the OS project inherited from STEP 7 / SIMATIC Manager.

This reference documents the root cause, the official Siemens fix, registry-level verification, and a complete TIA Portal alternative. Apply it whenever a project that compiles cleanly nevertheless refuses to go online in PLCSIM Runtime.

1. Error Code Reference: 42C2 / L4_DLL_E_LOGDEV

Error 42C2 is a WinCC channel-driver error reported through the HMI channel diagnostics view. It maps directly to the S7 communication DLL constant L4_DLL_E_LOGDEV (logical device error) in the channel DLL WCCS7.DLL / WCCSIM.DLL.

Constant Decimal Hex Channel Meaning
L4_DLL_E_LOGDEV 17090 0x42C2 Logical device name not found, or no installed/registered communication driver for the bound logical device

Per the official Siemens TIA Portal knowledge base, the error is generated when the communication driver is not installed correctly or the registry entry for the logical device name has been damaged or deleted. The recommended first action is to validate the logical device name with the Set PG/PC Interface tool. Source: TIA Portal V21 documentation - Error 42C2 / L4_DLL_E_LOGDEV.

2. Root Cause Analysis

Error 42C2 on a PLCSIM target has two cooperating causes:

  1. Wrong connection type embedded in the OS project. When the OS is compiled from SIMATIC Manager, the wizard inserts a Named Connection (S7 connection name, e.g. S7-Verbindung_1) into the HMI station. PLCSIM only provides a single virtual Ethernet adapter; it does not emulate the MPI/PB Named Connection transport that WinCC uses to resolve S7-Verbindung_1 to a slot/CP pair. The runtime handshake therefore fails before the channel DLL can reach the simulated CPU.
  2. Logical device not registered in the WinCC station. Even after switching the connection type, the channel DLL still must load the S7 transport. The transport is selected by a logical device (e.g. TCP/IP -> Network card). If the device name is misspelled, removed by a Windows repair, or pointing to an uninstalled CP driver, the channel reports 42C2.
Engineering note. Named Connections work on real S7-300/400 MPI, PROFIBUS, or Industrial Ethernet CPs because STEP 7 writes the routing into the station and WinCC reads it from the S7 project. PLCSIM does not provide that routing layer for MPI/DP transports; only the soft-PLC's CP-IF2 (TCP/IP) interface is reachable.

3. Affected Products and Versions

Component Versions with the Issue Versions Verified as Fixed After Procedure
WinCC Flexible 2007 / 2008 / SP3 All builds with PLCSIM v5.x target Build 0800.2500.01.04 (SP3 HF7) and newer
WinCC V7.0 SP3 / V7.2 / V7.3 / V7.4 All builds using SIMATIC S7 Protocol Suite channel Resolves once Industrial Ethernet is selected
SIMATIC S7-PLCSIM V5.4 SP5 and V5.5 (Step 7 V5.x target) N/A - limitation of the simulator, not a bug fix
TIA Portal WinCC RT Advanced / Professional V13 to V21 (with PLCSIM V13-V21) Resolves once the HMI connection type is set to S7 connection over TCP/IP

4. Prerequisites

  • STEP 7 V5.4 SP5 or higher with S7-PLCSIM installed on the engineering station (for the SIMATIC Manager path).
  • Or TIA Portal V13 or higher with S7-PLCSIM V13 or higher (for the TIA Portal path).
  • Administrator rights on the engineering station - Set PG/PC and registry writes require elevation.
  • The WinCC OS project must be in a state where the S7 program can be loaded to PLCSIM without compilation errors.
  • Firewall rule allowing TCP port 102 (ISO-on-TCP) between the WinCC station and the PLCSIM instance.

5. Solution A - SIMATIC Manager: Switch the OS to Industrial Ethernet

This is the original fix confirmed on the WinCC Flexible / WinCC V7 channel and applies whenever the OS was compiled from a STEP 7 V5.x project.

  1. Open SIMATIC Manager and load the project that contains the WinCC OS.
  2. Right-click the OS and choose Compile OS → Start Compilation.
  3. Click Next through the compilation wizard until the Select Network view appears.
  4. In the network view, click the Connection button in the toolbar. A dialog opens listing the available network connections between the WinCC station and the S7 station.
  5. From the list, select the Industrial Ethernet connection (the one whose endpoint is the PLCSIM CP-IF2, e.g. IE General / CP 443-1 / PLCSIM). Click OK.
  6. Continue clicking Next and Compile. Wait for the OS to finish generating.
  7. Launch WinCC Runtime. The connection handshake in Tag Management should switch to a green check mark and the channel diagnostics window should be free of 42C2 entries.

The selection is persisted in the OS database under \\\\Connections\<conn_name>.cnf; the file is rewritten every compile, so re-running the wizard with the correct network replaces the broken Named Connection entry.

6. Solution B - TIA Portal: Configure the HMI Connection as TCP/IP

For TIA Portal projects, the equivalent fix is at the HMI connection object rather than the OS compilation wizard.

  1. In the TIA Portal project tree, open Devices & Networks.
  2. Select the HMI connection between the Comfort Panel / WinCC RT and the S7-300/400 PLC.
  3. In the inspector window Properties > General > Interface, set the Connection type to S7 connection and the Interface to TCP/IP (Industrial Ethernet). Do not select PROFIBUS or MPI.
  4. Under Address details, enter the PLCSIM IP address (default 192.168.0.1 on Siemens softnet) and rack/slot 0 / 2 (S7-300) or 0 / 3 (S7-400).
  5. Compile the HMI device (right-click → Compile > Software (rebuild all)).
  6. Download the HMI to WinCC RT. The runtime connection diagnostics should no longer raise 42C2.

7. Verifying the Logical Device with Set PG/PC Interface

If the connection type is correct but 42C2 still appears, the logical device binding is the next suspect. The official Siemens guidance is to open Set PG/PC Interface and confirm the access point is mapped to a working driver.

  1. Open Start → Control Panel → Set PG/PC Interface (or SIMATIC → Set PG/PC Interface).
  2. Select the access point used by the OS: S7ONLINE for STEP 7, or CP_HMI_1 / CP_L2_1 for the WinCC station.
  3. From the interface list, assign TCP/IP → <Network card used by PLCSIM>. Avoid ISO Ind. Ethernet entries that point to a CP that is not present.
  4. Click Diagnostics to ping the PLCSIM address. A successful ping validates the driver.
  5. Click OK to write the assignment to the registry.

8. Registry and Driver Sanity Check

When the Set PG/PC dialog refuses to list a TCP/IP entry, the registry keys that WinCC reads at runtime are corrupt. The keys live under:

HKLM\SOFTWARE\Siemens\SIMATIC\S7RTM\Interfaces
HKLM\SOFTWARE\Siemens\SIMATIC\S7ONLINE\Interfaces

Each interface is stored as a sub-key with the values:

Value Type Meaning
Name REG_SZ Display name shown in Set PG/PC
Type REG_DWORD Transport (1 = TCP/IP, 2 = ISO, 3 = MPI, 4 = PROFIBUS)
DLL REG_SZ Path to the channel DLL (e.g. s7otbxdx.dll for TCP/IP)
Device REG_SZ Network adapter GUID or CP name

If Type is missing or DLL points to a non-existent file, re-install the S7 communication services with Setup.exe /quiet /component S7Communication from the STEP 7 DVD, or run Control Panel → Programs → SIMATIC S7 → Repair. After the repair, re-open Set PG/PC Interface and re-assign the access point.

9. Channel Diagnostics Walkthrough

Use the WinCC channel diagnostics to confirm that 42C2 is no longer raised.

  1. In the running WinCC Explorer, open Tools → Channel Diagnostics.
  2. Switch to the Connection tab and locate the S7 connection used by the project.
  3. Read the Status field. A healthy link shows OK and a green check; a 42C2 row is shown with a red exclamation mark.
  4. Open Tag Management → SIMATIC S7 Protocol Suite → TCP/IP and check the connection properties. The Partner field must list the PLCSIM IP address and the Rack/Slot must match the simulated CPU.

10. Verification Tests

  1. Tag test. In WinCC Graphics Designer, place an I/O field linked to an S7 tag. Toggle the tag in PLCSIM (VAT table) and confirm the field updates without timing out.
  2. Connection cycle test. In Channel Diagnostics, right-click the connection and choose Statistics. Connection failures must remain 0 over a five-minute period.
  3. Cold restart test. Stop PLCSIM, restart it, and reload the S7 program. WinCC RT must auto-reconnect without raising 42C2.
  4. Compile clean. Re-run the OS compile wizard (SIMATIC Manager) or Compile > Software (rebuild all) (TIA) and confirm no warnings about unresolved connections.

11. Troubleshooting Matrix

Symptom Likely Cause Action
Compile OK, Runtime raises 42C2, Named Connection shown in OS wizard PLCSIM does not support Named Connection Re-run OS compile wizard, pick Industrial Ethernet (Solution A)
Compile OK, Runtime raises 42C2, TIA Portal project HMI connection set to MPI/DP Change HMI connection interface to TCP/IP (Solution B)
Set PG/PC shows no TCP/IP entry TCP/IP S7 driver not installed or registry damaged Repair STEP 7 install, then re-assign S7ONLINE access point
Set PG/PC lists TCP/IP but ping fails PLCSIM not running or wrong IP Start S7-PLCSIM, verify IP via PLCSIM PLC → Ethernet Address
Runtime shows 7000 series errors after 42C2 fix Wrong rack/slot in connection properties Set rack 0, slot 2 (S7-300) or 0/3 (S7-400) in the HMI connection
Error 42C2 returns after Windows update Windows replaced the s7otbxdx.dll with a generic version Restore the file from STEP 7 install media and re-register with regsvr32 s7otbxdx.dll

12. Related Connection Errors and Standards

While 42C2 is the dominant error on PLCSIM, the same underlying driver issue can surface with adjacent codes. Knowing the cluster speeds up triage.

Hex Code Name Typical Trigger
0x42C2 L4_DLL_E_LOGDEV Logical device name missing / driver not installed
0x42C3 L4_DLL_E_NOCONN Connection object not loaded into the channel
0x42C5 L4_DLL_E_PARTNER Partner (PLC) not reachable at the configured address
0x42C7 L4_DLL_E_TIMEOUT Read/write request timed out (firewall, slot mismatch)
0x42D0 L4_DLL_E_RESOURCE Insufficient connection resources; reduce simultaneous tags or upgrade CP firmware

All S7 transport values used above map to ISO-on-TCP port 102 as defined in RFC 1006 and the Siemens S7 Communication Programming Manual. When validating firewalls, allow inbound and outbound TCP 102 between the WinCC station and PLCSIM.

13. Preventive Checklist

  • Always design PLCSIM test rigs with the same transport (TCP/IP) that the production panel will use. Mixing MPI in the lab and Ethernet in production masks defects.
  • Document the Set PG/PC access point in the project README so each engineer selects the same logical device.
  • After any Windows or STEP 7 update, run a 5-minute tag test in PLCSIM Runtime before resuming development.
  • Keep the STEP 7 install media on the engineering station so the S7 communication DLLs can be repaired without a download.

What does WinCC error 42C2 actually mean?

It is the WinCC channel constant L4_DLL_E_LOGDEV (decimal 17090, hex 0x42C2). The S7 communication DLL cannot find the logical device name that the HMI station was bound to, usually because the driver is missing or the registry entry is damaged. See the TIA Portal V21 error reference for the canonical definition.

Why does the error appear only with PLCSIM and not with a real PLC?

Real PLCs expose both MPI/PROFIBUS and Industrial Ethernet CPs, so the Named Connection chosen during OS compilation resolves correctly. PLCSIM only emulates a single CP-IF2 over TCP/IP, so any Named Connection resolved to MPI/DP has no matching transport. The runtime reports 42C2 the moment the channel DLL fails to bind.

How do I switch the OS from Named Connection to Industrial Ethernet in SIMATIC Manager?

Start an OS compile, click Next until the Select Network view, click the Connection button, choose the Industrial Ethernet entry pointing to the PLCSIM CP, click OK, and finish the wizard. The OS is regenerated with the new connection and the runtime handshake succeeds.

Where is the logical device name stored on Windows?

Under HKLM\SOFTWARE\Siemens\SIMATIC\S7ONLINE\Interfaces for STEP 7 access and HKLM\SOFTWARE\Siemens\SIMATIC\S7RTM\Interfaces for WinCC RT. Each sub-key holds Name, Type (1 = TCP/IP, 2 = ISO, 3 = MPI, 4 = PROFIBUS), DLL, and Device values used by the channel DLL at load time.

Can the same fix be applied in TIA Portal projects?

Yes. Open Devices & Networks, select the HMI connection, set Connection type to S7 connection and Interface to TCP/IP, enter the PLCSIM IP and rack/slot (0/2 for S7-300, 0/3 for S7-400), then rebuild and download. The runtime channel diagnostics should clear 42C2.

Back to blog