Resolving Missing Process Data on WinCC OS Clients in PCS 7 Custom C-Script Faceplates
In SIMATIC PCS 7 multi-client OS architectures, custom faceplates opened via C-scripts that display empty values or disconnected tags on OS Clients fail because the C-script references raw tag names without resolving the server prefix. OS Clients have no local tag management database; all process variables reside on the OS Server. To resolve this, extract the server prefix using 'GetServerTagPrefix' or retrieve the '@ServerName' attribute from the invoking block icon, and prepend the server prefix ('::') before passing the tag to WinCC faceplate functions such as 'SSMOpenTopFieldFix'.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
In SIMATIC PCS 7 distributed control systems, Operator Stations frequently operate in a Client-Server architecture where redundant OS Servers manage process communication with S7-400 controllers, while OS Clients render operator graphics across control rooms. When engineers develop custom faceplates or modify standard APL screen calls using WinCC C-script functions (such as SSMOpenTopFieldFix), faceplates often function perfectly on the OS Server but open completely blank or fail to bind process tags on OS Clients.
This discrepancy originates from WinCC's client-server tag resolution mechanics. Unlike Single-Station configurations, OS Clients host no runtime tag management tables for controller process variables; they interact with server tags exclusively via server packages. When a C-script calls a faceplate passing only an unqualified tag name (e.g., Motor1_Vlv), the client WinCC data manager fails with error DM_E_TAG_NOT_FOUND. This guide provides the architectural explanation and exact C-script coding pattern required to resolve server prefixes and ensure deterministic faceplate operation across all OS Clients.
Architecture and Fundamental Mechanics
The WinCC Client-Server tag management hierarchy enforces strict name-spacing between local client tags and remote server variables:
-
WinCC Server Data Packages:
- When an OS Server compiles, it generates a server package file (*.pck).
- This package is imported onto OS Clients. It informs the client Data Manager (CCDataMgr.exe) which server provides which tags.
- Remote variables require a package prefix:<PackageName>::<TagName>. -
Script Execution Context on OS Clients:
- When a faceplate is invoked on an OS Server, the local Data Manager resolves unqualified tag names directly against its own runtime database.
- When the same faceplate script executes on an OS Client, unqualified tag names are searched only in the client's internal tag table (which contains only local system tags like@CurrentUser,@LocalMachineName). Because the technological tag does not exist locally, the read operation fails silently or returns an uninitialized state. -
The 'Servername' Attribute and SSM Integration:
- In standard PCS 7 APL block icons, the AS-OS compilation wizard automatically populates the block icon'sServernameattribute with the server package identifier.
- Standard PCS 7 Split Screen Manager (SSM) functions likeSSMOpenTopFieldFixexpect parameters that include this server prefix.
- If a custom script bypassesGetServerTagPrefixor strips the server prefix string, the target faceplate picture window is populated with invalid tag links.
Step-by-Step Implementation Procedure
Follow these steps to update custom faceplate C-scripts and ensure proper tag resolution on WinCC OS Clients:
-
Inspect the Invoking Block Icon Properties:
- In WinCC Graphics Designer, open the process picture containing the custom block icon.
- Right-click the block icon > select 'Properties'.
- In the 'User Interface' or 'System' property group, verify that the attributeServername(ortagname) is present and bound to the server package name. -
Update C-Script Faceplate Invocation Logic:
- Open the mouse-click action C-script on the block icon.
- Modify the script to read both the base tag name and the server prefix:
```c
char szServerName[256];
char szTagName[256];
char szQualifiedTag[512];// Retrieve server prefix from block icon attribute
strncpy(szServerName, GetPropChar(lpszPictureName, lpszObjectName, "Servername"), sizeof(szServerName) - 1);
strncpy(szTagName, GetPropChar(lpszPictureName, lpszObjectName, "tagname"), sizeof(szTagName) - 1);// Construct qualified tag name if server prefix exists and is not empty
if (strlen(szServerName) > 0 && strstr(szTagName, "::") == NULL)
{
sprintf(szQualifiedTag, "%s::%s", szServerName, szTagName);
}
else
{
strncpy(szQualifiedTag, szTagName, sizeof(szQualifiedTag) - 1);
}
``` -
Call Faceplate Open Function with Qualified Tag:
- Pass the fully qualified tag string into the PCS 7 screen management function:
c // Open faceplate via Split Screen Manager SSMOpenTopFieldFix(1, szQualifiedTag, "@PG_CUSTOM_VIEW.PDL"); -
Handle Picture Window Dynamic Tag Prefixes:
- If opening a picture window within a screen instead of using SSM, explicitly set theTagPrefixproperty of the picture window control:
c char szWindowPrefix[512]; sprintf(szWindowPrefix, "%s::%s.", szServerName, szTagName); SetPropChar(lpszPictureName, "CustomFaceplateWindow", "TagPrefix", szWindowPrefix); SetPropBOOL(lpszPictureName, "CustomFaceplateWindow", "Visible", TRUE); -
Generate and Download Server Data on Engineering Station:
- In SIMATIC Manager Component View, right-click the OS Server project and select 'Server Data > Generate'.
- Select each OS Client project, right-click and select 'Server Data > Load' (or 'Update').
- Download the OS Client projects to their respective target stations.
Verification
- Launch WinCC Runtime on an OS Client station.
- Open
apdiag.exe(WinCC Application Diagnostics) on the client to monitor C-script execution and data manager queries in real time. - Click the custom block icon on the client process picture.
- Verify that the faceplate window opens immediately without tag connection errors.
- Confirm in
apdiag.exethat noDM_E_TAG_NOT_FOUNDor null-pointer errors are generated. - Verify that process variables, trend curves, and control buttons respond interactively on the client screen.
Limitations and Operational Precautions
Hardcoding server package names directly in scripts violates project reusability; always extract the server prefix dynamically from the block icon or via GetServerTagPrefix. When redundant OS Servers are deployed, never prefix tags with physical computer names; always use the symbolic Server Package name so that WinCC Redundancy can automatically switch tag routing during a server failover. Software runtime packages and client access licenses should be validated through an authorized Siemens distributor or the Siemens Industry Mall.
Engineer FAQ
Why did the faceplate work on the OS Server but fail on the OS Client?
The OS Server has the process variables in its local tag database. The OS Client has no local process tags and requires a server prefix (<Package>::<Tag>) to route requests to the server.
What diagnostic tool reveals tag lookup errors on WinCC clients?
apdiag.exe (located in C:\Program Files (x86)\Siemens\WinCC\bin\) logs runtime script and Data Manager errors such as DM_E_TAG_NOT_FOUND.
What function opens standard PCS 7 faceplates in WinCC?
SSMOpenTopFieldFix or standard APL helper functions such as APL_OpenFaceplate.
Does the server prefix use physical server hostnames?
No. It uses the symbolic server package name generated by the OS Server, which remains invariant during redundant server switchover.
Do OS Clients require AS RT Process Object licenses?
No. AS RT PO licenses are consumed exclusively on the automation controller; OS Clients require only standard OS Client runtime licenses.
Technical References
- SIMATIC Process Control System PCS 7 Operator Station (V8.2 / V9.0 / V9.1) Manual
- SIMATIC Process Control System PCS 7 Advanced Process Library Manual
- WinCC V7 Scripting: VBS, ANSI-C, VBA Programming Manual
Related Articles
- Restoring Missing Operator Input Messages on PCS 7 OS Clients via Standard Server Configuration
- Diagnosing Simultaneous OS Client Freezes and Transient Hangs in SIMATIC PCS 7
- Diagnosing WinCC Redundancy Failures and Historical Alarm Storage Halts in PCS 7 V9.0
Related Tags
- OS Client
- Faceplates
- C-Script
- Server Prefix
- SSMOpenTopFieldFix
- PCS 7 V9.1