Troubleshooting Severe SFC Visualization Opening Delays and Freezes in PCS 7 WinCC

Troubleshooting Severe SFC Visualization Opening Delays and Freezes in PCS 7 WinCC

Severe delays of 15 to 30 minutes when opening Sequential Function Chart (SFC) faceplates in SIMATIC PCS 7 WinCC are primarily caused by broken tag linkages in background graphics triggering synchronous script timeouts, unresolved DCOM / RPC network handshakes, or unregistered SFC Visualization ActiveX controls (SfcCtrl.ocx). When an operator clicks an SFC icon, WinCC invokes the SFC Visualization component to query step, transition, and interlock states across Named Connections. If C-scripts embedded in standard faceplates reference non-existent tags, the WinCC UI thread freezes while executing repeated blocking timeouts. Diagnosing with apdiag.exe, repairing broken tag links, and ensuring proper SFC compile and OS package loading eliminates these operational freezes.

Table of Contents

Mechanism of SFC Visualization and ActiveX Controls

In SIMATIC PCS 7, Sequential Function Charts (SFC) engineered in the AS can be visualized directly on the operator station using the SIMATIC SFC Visualization optional package. When an operator clicks an SFC block icon, WinCC opens the standard SFC faceplate (@pg_@sfc_type.pdl or @pg_@sfc_chart.pdl), embedding the Siemens SFC ActiveX control (SfcCtrl.ocx).

The ActiveX control initiates high-frequency queries over S7 Named Connections to fetch current active steps, satisfied transitions, step times, and interlock conditions. Because SFC Visualization interfaces tightly with both the WinCC Graphics Runtime display thread and the underlying SIMATIC BATCH / OS communication channels, any blocking operation during initialization halts the entire WinCC user interface.

Root Causes of Extended Faceplate Freezes

When an SFC faceplate takes 15 to 30 minutes to open, the fault is almost never related to CPU performance, but rather to synchronous software wait states:

Failure MechanismTechnical Root CauseDiagnostic IndicatorResolutionBroken Script Tag ReferencesC-script in process graphic queries non-existent WinCC tagapdiag.exe reports repeated tag access errorsRemove or correct missing tag references in Graphics DesignerUnregistered / Mismatched OCXCorrupted SfcCtrl.ocx or version mismatch after updateEvent Viewer reports COM / OLE initialization timeoutsRe-register SFC OCX files via regsvr32Missing OS SFC CompilationOS compiled without 'SFC Visualization' option enabledWinCC attempts dynamic AS address discoveryExecute full OS Compile with 'SFC Visualization' checkedDCOM / RPC Network LatencyHigh packet loss or blocked RPC ports on Terminal BusWindows RPC client blocks for standard timeout (30-60s)Open required DCOM ports and verify Terminal Bus healthSQL Server Lock ContentionLocal WinCC runtime SQL database experiencing locksSQL Server profiler shows blocked queriesReorganize project and restart WinCC Runtime services

If a graphic contains custom C-scripts that execute inside a synchronous loop while querying invalid tags, WinCC queues thousands of failed queries, freezing the station until the queue completes.

Diagnosing Script Hangs via Apdiag Output Window

The standard Siemens diagnostic utility Apdiag provides real-time visibility into the internal WinCC C-scripting engine:

  1. On the affected OS Client or Single Station, navigate to C:\Program Files (x86)\Siemens\WinCC\utools\ (or C:\Siemens\WinCC\bin\).
  2. Double-click apdiag.exe.
  3. In the Apdiag toolbar, click Output Window (or select Output Window -> Open).
  4. Keep the Apdiag window visible on screen, then attempt to click the problematic SFC icon in WinCC Runtime.
  5. Review the immediate stream of diagnostic messages:
    - If error lines appear reporting Tag <TagName> does not exist or GetTagChar: Error in picture <PictureName>.pdl, inspect the offending graphic object.
    - If OLE/COM error messages appear (e.g., 0x80004005 or RPC server unavailable), the issue lies in ActiveX registration or DCOM communication.

Step-by-Step Resolution and Component Re-Registration

To restore rapid SFC faceplate loading:

  1. Repair Broken Graphic Tags:
    - Open WinCC Graphics Designer.
    - Open the picture identified in Apdiag (e.g., SGP_WATERCIRC_E.pdl).
    - Locate the specific object reported (e.g., StaticText126).
    - Inspect dynamic dialogs and C-scripts under the 'Text' and 'Dynamic' attributes; eliminate references to obsolete tags and save the graphic.
  2. Re-Register SFC Visualization ActiveX Controls:
    - Open Windows Command Prompt as Administrator.
    - Navigate to the WinCC bin directory: cd "C:\Program Files (x86)\Siemens\WinCC\bin".
    - Execute the registration commands:
    cmd regsvr32 SfcCtrl.ocx regsvr32 SfcVis.dll
    - Confirm that both dialogs report successful registration.
  3. Recompile OS with SFC Visualization:
    - In SIMATIC Manager, select the OS project and click Compile.
    - In the Wizard options, ensure that SFC Visualization is selected.
    - Perform an OS compile and download the server data package to all clients.

Verification

To verify that SFC Visualization performance is restored:
1. Open WinCC Runtime on the OS Client.
2. Click on the SFC block icon; verify that the SFC faceplate opens instantly (typically under 1 to 2 seconds).
3. Confirm that the SFC step sequence, active step highlighting, and transition condition tables display live states accurately.
4. Keep Apdiag open in the background; verify that zero scripting error messages or missing tag warnings are generated during faceplate operations.

Limitations and Operational Precautions

Never ignore script errors logged in Apdiag. Even a single invalid tag reference inside a cyclically executed script (e.g., executing every 250 ms) will degrade overall WinCC client responsiveness, increase memory consumption, and eventually crash the graphics system. Always ensure that the version of SIMATIC SFC Visualization installed on the OS Client matches the exact version running on the OS Server.

Engineer FAQ

Does SFC Visualization require a dedicated license?

Yes. SIMATIC SFC Visualization requires a runtime license (6ES7652-0XX... / 6ES7658-2FX...) installed on each OS Client and Single Station where SFCs are monitored.

Why does an invalid tag in a graphic cause SFC Visualization to freeze?

WinCC executes graphic C-scripts synchronously within the main user interface thread. If a script requests a non-existent tag, WinCC waits for the communication channel timeout before returning control, locking all UI interactions.

Can SFC Visualization be opened from a Web Client?

Yes, provided the WinCC Web Navigator client has the SFC Visualization Web plug-in installed.

Technical References

Related Articles

Related Tags

  • SFC Visualization
  • WinCC Scripting
  • Apdiag
  • ActiveX Control
  • Performance Optimization
6 respuestas