Resolving WinCC Faceplate Designer Lock Message Button Failure

David Krause11 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

Problem Overview

Operators using Siemens SIMATIC WinCC / PCS 7 faceplates report that the Lock alarm message button in the Overview page of a custom faceplate stops responding when the faceplate is generated or regenerated through the WinCC Faceplate Designer (a PCS 7 plant-specific add-on that wraps the standard basis faceplate template into user-defined tag types such as MEAS_MON, MEAS_MON2, MOTOR, VALVE, PID).

Symptoms observed in the runtime:

  • Pressing the lock button in the Overview faceplate does not toggle the lock state.
  • The button graphic remains in the "closed lock" position even after operator action.
  • Operator-induced alarm messages continue to appear and scroll normally in the message line — they are not suppressed.
  • The same lock button, when pressed from the bottom message bar of the same picture, still works correctly.
  • The issue is not present on stock faceplates such as @PG_MEAS_MON_OVERVIEW.pdl that were copied and edited by hand in Graphics Designer.

Affected environment per the field report:

  • SIMATIC PCS 7 V7.1 (engineering / runtime on Windows XP Professional SP3).
  • SIMATIC WinCC V7.1 (basisfaceplates package).
  • All faceplate types generated by the Faceplate Designer plug-in (the OS Project Editor's "Create/Update Faceplates" function).

The failure is independent of the controller type (AS 400, AS 410, AS 300), the WinCC channel, the alarm logging configuration, and the user authorization level in WinCC User Administrator.

Root Cause Analysis

The Faceplate Designer in PCS 7 does not assemble a new picture from scratch — it copies a master template from the WinCC installation path and substitutes the %type% token with the actual CFC block type (e.g., MOTOR, MEAS_MON). One of those templates contains a C-Script defect in the Mouse-click event of the Lock-Alarm message button.

The defective file shipped with PCS 7 V7.1 is:

C:\Program Files\SIEMENS\WINCC\Options\PDL\basisfaceplates\@pg_%type%_overview.pdl

When the Faceplate Designer materializes a faceplate for a given block type, it writes the resolved file to the OS project (for example, @PG_MEAS_MON2_OVERVIEW.pdl). The C-Script error is copied verbatim, so every regenerated faceplate inherits the broken behavior.

The original C-Script in the button's Mouse-click event begins with these two procedures (after the variable declarations):

// Defective code shipped with the template
pszParentPicture = GetParentPicture(lpszPictureName);
if (pszParentPicture != NULL) return;

For comparison, the hand-edited working file @PG_motor_overview.pdl uses the opposite condition:

// Correct logic in the stock basis faceplate
pszParentPicture = GetParentPicture(lpszPictureName);
if (pszParentPicture == NULL) return;

Function semantics matter here. GetParentPicture() returns the immediate parent picture of the active level. The button lives on a nested level of the faceplate (typically a subpicture or a graphic object inside the overview), so the call always returns a non-NULL pointer — namely the parent picture of the button inside the faceplate hierarchy.

With the wrong relational operator (!= NULL), the script hits return; on every click and exits before the lock/unlock action is performed. The button toggles nothing, the icon never updates, and the message-line lock state is not modified.

Why Hand-Copied Faceplates Are Not Affected

A user who copies @PG_MEAS_MON_OVERVIEW.pdl manually in Graphics Designer, renames it, and edits it inherits the correct script from the original Siemens-delivered basisfaceplate (the == form). The defect only exists in the template variant that the Faceplate Designer uses as a base.

Key distinction:

Method Template Source Script Condition Behavior
Manual copy in Graphics Designer @PG_*_OVERVIEW.pdl from OS picture tree if (pszParentPicture == NULL) return; Lock button works
Faceplate Designer / OS Project Editor basisfaceplates\@pg_%type%_overview.pdl if (pszParentPicture != NULL) return; Lock button is non-functional

This explains the user's observation: the lock button works on a manually edited faceplate, but is broken on every faceplate generated through the Faceplate Designer.

Affected Software Versions

The defect was confirmed by the field reporter on:

  • SIMATIC PCS 7 V7.1 + SPx (engineering station and operator station)
  • Windows XP Professional (operator station image)
  • WinCC V7.1 runtime

Because the buggy template ships with the WinCC Options\PDL\basisfaceplates folder rather than with a service pack hotfix, the issue should be assumed to exist in all PCS 7 V7.0 and V7.1 installations that use the standard Faceplate Designer. Operators upgrading to PCS 7 V8.0 or later should verify the template on disk after the upgrade before regenerating faceplates; the V8 faceplate architecture is significantly different and the same file may not be present.

Note: Always check the file with a text or hex-capable editor before assuming the fix is in place. SIEMENS occasionally repatches the same template in cumulative updates; in such a case the source code already reads == NULL and the manual edit is unnecessary.

Solution: One-Line Script Correction

The fix is a single-character (one-token) change inside the C-Script attached to the Lock-Alarm message button on the Overview page of the Faceplate Designer template. There are two locations where the change is required:

  1. The master template in the WinCC install directory (fixes future regenerations).
  2. Each already-generated faceplate in the OS project (fixes the live runtime).

Procedure A — Patch the master template

  1. On the engineering station, navigate to:
    %ProgramFiles%\SIEMENS\WINCC\Options\PDL\basisfaceplates\@pg_%type%_overview.pdl
  2. Open WinCC Graphics Designer as administrator and open this picture.
  3. Select the Lock-Alarm message button on the Overview page (typically the padlock icon near the message area).
  4. Open the button's properties and switch to the Events > Mouse > Mouse Click action.
  5. Open the attached C-Script in the C-Script editor.
  6. Locate the line:
    if (pszParentPicture != NULL) return;
  7. Replace it with:
    if (pszParentPicture == NULL) return;
  8. Compile the script (Generate C / OK) and save the picture. The file remains in the install path and serves as the new master.
Write protection: The file may be read-only after the WinCC install. Clear the read-only attribute in Explorer (or via attrib -r) before saving. On Windows 7 and later, run Graphics Designer elevated.

Procedure B — Patch the generated faceplates

Each picture already deployed in the OS (e.g. @PG_MEAS_MON2_OVERVIEW.pdl) still contains the defective script. Repeat the edit in Graphics Designer for every overview faceplate that was generated by the Faceplate Designer:

  1. Open the OS project in WinCC Explorer.
  2. Open Graphics Designer and load the affected picture, e.g. @PG_<TYPE>_OVERVIEW.pdl.
  3. Select the Lock-Alarm message button, open its Mouse-Click C-Script, change the same line, recompile, and save.
  4. Repeat for every faceplate type in the project (MOTOR, VALVE, MEAS_MON, MEAS_MON2, PID_CTRL, ANA_MON, …).
  5. Regenerate the OS via the OS Project Editor. Because the master template is now fixed, newly created or refreshed faceplates will be correct out of the gate.

Verification

After patching, validate the fix end-to-end in WinCC Runtime:

  1. Compile the OS and start runtime.
  2. Open a picture that contains the affected faceplate (e.g. an overview with several MEAS_MON2 blocks).
  3. Press the Lock-Alarm message button on the Overview faceplate.
  4. Confirm that:
    • The button icon toggles between the closed-padlock and the open-padlock graphic.
    • The WinCC message line stops updating with new alarm events of lower or equal priority once the lock is engaged.
    • Pressing the button again unlocks the message line and updates resume.
  5. Trigger a controlled alarm from the CFC (e.g. set a process tag to an out-of-limit value) and confirm the lock behavior matches the button state.
  6. Repeat the test on at least one of every faceplate type that was regenerated by the Faceplate Designer.
Tip: If the icon updates but the message line still scrolls, the issue is in the MSGBOX_LOCK / GMSG_MAINTENANCE tag wiring, not in the C-Script. Inspect the internal faceplate tags with the WinCC tag debugger.

Workarounds (Before or Without a Code Edit)

  • Use the global message-bar lock instead of the per-faceplate lock. Operators can still suppress messages from the bottom bar of the runtime window — that control is wired to a different script and is unaffected.
  • Maintain a manual copy of the basisfaceplates folder. After every WinCC reinstall or SP application, re-apply the patch to @pg_%type%_overview.pdl before opening the OS Project Editor.
  • Disable the Faceplate Designer for OS projects that are already mature. Continue to edit faceplates manually in Graphics Designer — the lock script on those copies is already correct.
  • Apply the Siemens Hotfix if available. SIEMENS has distributed a corrected template as part of the PCS 7 master service packs since V7.1 SP3. Always check the readme of the most recent cumulative update for a faceplate-template fix entry.

Prevention in Future Projects

To keep the bug from re-appearing after every WinCC install, service pack, or migration:

  1. After installing or upgrading WinCC / PCS 7, immediately inspect %ProgramFiles%\SIEMENS\WINCC\Options\PDL\basisfaceplates\@pg_%type%_overview.pdl in a text viewer. Confirm the lock-button C-Script reads == NULL.
  2. Wrap the basisfaceplates folder into your version-control repository (SVN, Git, TIA Portal Change History). Treat the WinCC install as a build artifact, not a source of truth.
  3. Document the fix in the project Functional Specification and the OS commissioning checklist so the next engineer does not regenerate faceplates from a clean install and lose the fix.
  4. When migrating to WinCC Unified (TIA Portal V17+), review the new faceplate model. Unified faceplates are stored in the project library and instantiated in screens; the C-Script defect does not exist there because the relevant logic is in VB-style events or in configured properties.
  5. For non-Siemens systems, follow the same audit pattern. For AVEVA / Plant SCADA faceplates, the sample-faceplates workflow is different and not affected by this WinCC C-Script. For Rockwell PlantPAx Process Controller faceplates, the lock state is driven by the faceplate instruction set on the controller, not by a script on the HMI.

Related Faceplate Diagnostics

If the lock button is fixed but other faceplate behaviors still misbehave, the most common adjacent defects in PCS 7 faceplates are:

Symptom Likely Cause Diagnostic / Fix
Lock icon does not toggle but message line lock works Tag wiring on LockBits / MAINT lost during regeneration Inspect the connections in the picture's Interface tab; rebind to the source structure tag
No message events at all on the faceplate Message configuration not transferred to the OS Run OS Project Editor with "Messages" enabled; check WinCC Alarm Logging
Buttons gray / disabled for all operators Operator authorization not assigned in WinCC User Administrator Add the operator to the matching level (e.g. Operator_Process_control)
Faceplate shows ##### or invalid values AS-OS connection lost or tag scale mismatch Check SIMATIC S7 Protocol Suite channel diagnostics; verify scaling on the block
Faceplate opens but is empty Block instance number not in the picture's tag prefix Verify the picture's tag connection is bound to the AS structure

Code Reference — Complete Corrected Script

The full corrected Mouse-click C-Script for the Lock-Alarm message button on the Overview faceplate follows the pattern of the stock @PG_motor_overview.pdl:

// Top of script
#include "apdefap.h"

void OnClick(char* lpszPictureName, char* lpszObjectName)
{
    char* pszParentPicture = NULL;

    // Resolve the parent picture of the button
    pszParentPicture = GetParentPicture(lpszPictureName);

    // FIX: bail out ONLY if we are not on a nested level
    if (pszParentPicture == NULL) return;

    // Toggle the message-line lock state via the internal faceplate tag
    SetTagBitWait("@LockMessage", (GetTagBit("@LockMessage") == 0) ? 1 : 0);

    // Update the visible icon (closed lock vs open lock)
    if (GetTagBit("@LockMessage") == 1)
    {
        SetPictureDeactivatedRGB(lpszPictureName, lpszObjectName, 0x00C0C0C0);
        // Optionally swap the graphic via SetVisible / SetPictureName
    }
    else
    {
        SetPictureDeactivatedRGB(lpszPictureName, lpszObjectName, 0x00FFFFFF);
    }
}
The exact SetPicture* calls vary between faceplate versions. The critical change is the relational operator in the early-exit guard. Do not modify the rest of the script unless the original template on disk is missing the toggle calls entirely.

Frequently Asked Questions

Why does the Lock-Alarm message button work on a hand-edited faceplate but fail on a Faceplate-Designer-generated one?

The Faceplate Designer copies a master template from C:\Program Files\SIEMENS\WINCC\Options\PDL\basisfaceplates\@pg_%type%_overview.pdl which contains a defective C-Script with the condition if (pszParentPicture != NULL) return;. Hand-edited copies of the basisfaceplate in the OS picture tree use the correct == NULL form. The script exits before performing the lock action in every Faceplate-Designer-generated faceplate.

What PCS 7 versions are affected by this Faceplate Designer bug?

The defect was confirmed on PCS 7 V7.1 with WinCC V7.1 on Windows XP. Because the buggy template ships in the WinCC install directory and is not a hotfix deliverable, all PCS 7 V7.0 and V7.1 installations using the standard Faceplate Designer should be assumed affected until the corrected template is verified on disk. PCS 7 V8.x and WinCC Unified use a different faceplate architecture and are not affected.

Can I fix the issue without editing the master template?

Yes. Open each generated overview faceplate (e.g. @PG_<TYPE>_OVERVIEW.pdl) in Graphics Designer, change the same != NULL to == NULL in the lock button's Mouse-click C-Script, recompile, and save. You still have to fix every faceplate type, so editing the master template first is more efficient.

Will the fix be lost if I regenerate the OS with the OS Project Editor?

If the master template in the WinCC install directory is not patched, the OS Project Editor will overwrite your hand-edits on the next faceplate regeneration. Patch the master template first, then regenerate. As a safety net, archive the corrected master file in your version-control system before each OS build.

Does this bug also affect the Acknowledge or Horn buttons on the same faceplate?

No. Only the Lock-Alarm message button uses the buggy != NULL early-exit guard. Acknowledge, Horn, and the per-message state buttons use independent C-Scripts that perform their own state checks. If those are also misbehaving, the cause is elsewhere — typically message-class authorization, AS-OS connection status, or the Alarm Logging configuration.

Back to blog