Resolving PCS7 WinCC Quality Code 4C and Phantom HH Alarms

David Krause19 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 PCS7 WinCC Quality Code 0x4C and Phantom HH Alarms on Custom P_AI Blocks

This field reference documents a recurring PCS 7 / WinCC Runtime fault pattern where a custom P_AI function block reports an apparently normal process variable on the AS, yet the Operator Station (OS) raises a phantom High-High (HH) alarm, paints the block icon magenta (bad quality), and shows several internal alarm outputs (MHH, HH, LL, MLL, SB_LL) as 0 even though the AS logic returns 1. The WinCC tag tooltip reports a quality code of 0x4C (76 decimal) instead of the expected 0x80 (128 decimal, good). The pattern has been reproduced on PI-1001A/AI and PI-5803/AI in a PCS 7 V9.x system that uses an APL-derived, site-customised P_AI faceplate and block icon. Recovery is possible without deleting the FBs in production, but only when the underlying cause is correctly identified.

This article maps the symptom matrix to the OPC UA quality code dictionary that WinCC uses, isolates the root cause to WinCC-side tag database state rather than PLC logic, and presents the engineer-to-enginener procedure used to clear the fault on a live system. Examples target the SIMATIC PCS 7 portfolio; behaviour is consistent from V8.2 through V10.0 and the WinCC Runtime Professional that ships with it.

Important: A WinCC quality code of 0x4C is a WinCC-side issue, not a PLC fault. The PLC may be returning a perfectly good value with status 80 while WinCC still holds a stale, uncertain, or substituted internal copy. Re-flashing or re-compiling the AS will not fix this.

1. Problem Statement

On a fully commissioned PCS 7 process cell, two analog input tags - PI-1001A/AI and PI-5803/AI - began to display the following anomalous behaviour on the OS server graphics:

  • An HH alarm appears in the Incoming Alarm List although the process value is sitting at roughly 10% of the configured range.
  • The block icon background is rendered magenta, which the APL faceplate template uses to indicate a bad PV quality (typically a sensor short circuit).
  • The block icon does not show the B text marker and does not show the HH suffix that the template normally displays next to the value.
  • In the group icon the AL indicator is red (active), but the HIGH HIGH text box itself is grey, which is the rendered state when the alarm is acknowledged but not currently active.
  • The B indicator in the group icon is magenta (active), but the FAULT text box is grey and the SC text next to PV is not present.
  • HH and SC alarms no longer appear in the faceplate alarm window, even though they were visible in the days before. The reason is that Alarm Logging is configured with a 1-week retention and the older events have been moved to the CAS (Central Archive Server) and are no longer queryable from the live list.

Reading the live values from the AS side via STEP 7 / CFC online shows all alarm outputs (HH, LL, HF_HL, HF_LL, CH_QBAD, MO_EN, MO_TMR, MO_SET, MO_RST, SBC, SB_LL, MHH, MLL) at 1 - i.e. healthy. The process value is correct, and the channel driver on the ET 200SP / ET 200M AI module shows status 0x80 (good).

2. Symptom Matrix

Symptom matrix observed on a live PCS 7 OS server
Layer Expected Observed Quality Code
AS logic (online) All alarm outputs = 1 All alarm outputs = 1 0x80 (good)
Tag management on OS (tooltip) PV matches AS PV matches AS for the input; alarm-flag tags mismatched (PLC=1, OS=0) 0x4C (uncertain) on flag tags
Block icon background White / green Magenta 0x4C (uncertain / bad-substitute)
Block icon HH suffix Hidden when HH=0 Hidden (HH=0 in WinCC internal state) 0x4C
Group icon AL indicator Grey when not active Red n/a (latched internally)
Faceplate FAULT text Magenta when SC active Grey n/a
Incoming Alarm List Empty HH alarm visible, unacknowledgeable 0x4C (latched from prior state)

The combination of block icon magenta + FAULT text grey + alarm unacknowledgeable is the fingerprint of a WinCC tag-database inconsistency, not a true field fault.

3. WinCC Quality Code Reference

WinCC tag quality codes are aligned with the OPC UA status code convention. The codes observed in this fault pattern are listed below.

Common WinCC / OPC UA quality codes
Hex Decimal Severity Meaning Typical trigger
0x00 0 Bad Bad - non-specific Channel not connected
0x04 4 Bad Bad - configuration error Datatype mismatch
0x08 8 Bad Bad - not connected PLC link down
0x0C 12 Bad Bad - device failure IM / PN device failure
0x10 16 Bad Bad - sensor failure Wire break on AI
0x14 20 Bad Bad - last usable value Substitute value active
0x1C 28 Bad Bad - communication failure Sub-D / PROFINET IO lost
0x24 36 Bad Bad - out of service Tag placed out of service
0x40 64 Uncertain Uncertain - non-specific Initial value before first read
0x4C 76 Uncertain Uncertain - substitute value Tag not referenced by graphics, scripts, archive, or alarm; or stale internal copy after a delta-load
0x80 128 Good Good - non-specific Normal cyclic read
0xC0 192 Good Good - local override Manually forced value

For this article, the two codes that matter are 0x80 (good, what we want) and 0x4C (uncertain - substitute value, what we see). The 0x4C value is the OPC UA status Uncertain_SubstituteValue combined with the limit bit pattern; in WinCC it is most often a side-effect of either a tag that is configured but not referenced anywhere in graphics, scripts, alarms, or archives, or of a WinCC-side internal copy that has not been refreshed after a delta OS compile.

Quality code 0x4C is not a PLC fault. A reliable field check is to put the same tag on a different process picture that does not use the customised faceplate. If the second picture shows quality 0x80 and the correct value, the AS is fine and the WinCC-side state of the customised picture is the problem.

4. Root Cause Analysis

Three hypotheses were evaluated against the evidence in the source field case. Only the third matches every observation.

4.1 Hypothesis A - PLC logic fault

If the P_AI function block on the AS were the cause, the online view in CFC would show alarm outputs at 0 and the PV would be outside the configured range. The observed evidence is the opposite: PV is normal, alarm outputs are 1, channel diagnostics show 0x80. This hypothesis is rejected.

4.2 Hypothesis B - Safety / HH configuration on PCS

The process cell uses a PCS (non-safety) controller, and HH alarms are not normally configured on the PCS for this class of measurement. The HH limit file was checked on the ES and no HH threshold exists for either tag. The HH message visible in the Incoming Alarm List was not generated by the AS alarm logic. This hypothesis is rejected.

4.3 Hypothesis C - WinCC-side tag database inconsistency on a delta-loaded picture

This is the surviving hypothesis. The OS was delta-compiled (Changes Only) after a CFC modification. The customised P_AI block icon and faceplate were not re-rendered with a full compile. The WinCC internal image of the flag tags (HH, LL, MHH, MLL, SB_LL) lost their tag-binding to the picture object. The PLC keeps reporting 1, but the picture's internal cache reports 0 with quality 0x4C (uncertain - substitute value). A subsequent online read from Tag Management on the server shows the same mismatch.

The decisive evidence: when the P_AI function block was deleted from the CFC and the OS recompiled with Changes Only on a replicated engineering laptop, the problem disappeared. That test result points firmly at WinCC-side state corruption on a single function-block instance, not at runtime corruption of the PLC program or the PCS 7 master database.

5. Why Deleting the FB Works (And Why You Cannot Do It on a Live System)

When a customised faceplate is bound to a CFC instance, WinCC stores the binding in an internal picture-local list keyed by the CFC instance name. A Changes-Only delta compile rebuilds the picture only for the changed instances; the picture-local binding for the changed instance is regenerated, but on certain combinations of customised faceplate, modified script interface, and modified alarm class the regeneration drops the runtime binding for one or more flag tags. The flag tag then becomes "configured but unreferenced from any active picture" and WinCC reports it as 0x4C.

Deleting the FB and re-compiling Forces-Only re-establishes the picture-local binding from scratch. The reason this is not a viable production remedy is that any untouched FB still bound to the same customised faceplate retains its corrupt binding, and forcing a full OS compile on a live plant takes the system offline. The remaining sections describe how to clear the fault without that step.

6. Prerequisites for Recovery

Before any of the procedures below are executed, confirm the following:

  1. The ES, OS server, and OS clients all run the same PCS 7 version (V8.2 / V9.0 / V9.1 / V10.0 with the matching hotfix level). Mixed versions cause exactly the kind of quality-code 0x4C symptom described here.
  2. The redundant OS server pair is healthy, with both servers in standby-master state and no messages in the Redundancy window.
  3. The AS is in Run with no system faults on the CPU diagnostic buffer.
  4. There is a current backup of the PCS 7 project (.p7* zip) and a recent image of the OS server volumes.
  5. The WinCC Alarm Logging retention is known. In the source case, retention was 1 week and old HH / SC events had been moved to CAS, which is why they no longer appear in the faceplate alarm window.

7. Step-by-Step Recovery Without Deleting FBs

7.1 Step 1 - Confirm the PLC side is clean

On the ES, open the CFC online view for the affected AS, navigate to the P_AI instance, and capture a screenshot of every input and output. The PV, PV_FAC, PV_OUT, and alarm outputs HH, H, L, LL, MHH, MLL, HF_HL, HF_LL, CH_QBAD, SBC, SB_LL, MO_EN, MO_TMR, MO_SET, MO_RST should all be at their healthy values. If any of these are at 0 on the AS, the problem is in the CFC, not in WinCC, and you must fix the CFC first.

7.2 Step 2 - Read the OS-side tag quality

On the OS server, open WinCC Explorer, expand Tag Management, right-click each of the flag tags listed above, and read the value and quality code from the tooltip. Record the values in a worksheet. The expected quality code is 0x80; the observed value is 0x4C for the flag tags that are out of sync. This is the live evidence that the problem is WinCC-side.

7.3 Step 3 - Re-synchronise the picture binding

This is the corrective step that does not require deleting any CFC instance.

  1. Open the affected process picture on the ES in Graphics Designer.
  2. Select the customised P_AI block icon instance.
  3. Open the Properties > Events dialog and confirm the configured event names match the customised faceplate script interface. A mismatch in the interface is a common cause of dropped bindings after a delta compile.
  4. Open Compile OS > Changes Only, and tick Update picture objects. Run the compile.
  5. Download the delta to the standby OS server and let redundancy synchronise.
  6. Wait for the redundancy sync to complete, then fail over the master. Verify the picture now shows white background and no HH message.

If the binding is still mismatched, force a recompile of the single picture file by right-clicking it in WinCC Explorer > Graphics and selecting Recompile. The single-picture recompile is much faster than a full OS compile and is safe on a running plant because it does not restart the OS server process.

7.4 Step 4 - Clear the latched message in Alarm Logging

The HH message visible in the Incoming Alarm List was generated before the binding was repaired and is still latched internally. Clearing it requires the Siemens support procedure that was attempted in the source case, plus a small refinement that fixes the root cause: the WinCC internal message state bit is reset by triggering a state change on the bound tag, not by writing to a custom binary tag.

  1. On the ES, open Alarm Logging and locate the HH message by message number. Note the message number, the message class, and the bound tag.
  2. In the CFC, force a brief 0 -> 1 -> 0 transition on the bound alarm-output tag (for example, momentarily force the HH threshold one count higher and back). This causes the AS to send a fresh, good-quality message that the OS can latch and acknowledge normally.
  3. On the OS server, refresh the Incoming Alarm List. The phantom HH row should now be replaceable by a fresh, acknowledgeable message. Acknowledge it.
  4. If a fresh message is not generated (the bound tag is stuck at 0 in the OS internal state), then the message-class binding itself is the broken element. Proceed to Step 5.

7.5 Step 5 - Reset the WinCC message class binding

This is the procedure recommended by Siemens support for the rare cases where a message class loses its tag binding after a delta compile:

  1. Write down the message number of the unacknowledgeable HH message.
  2. On the ES, open the project, and create a binary tag in Internal Tags named for example ResetMsg_PI1001A.
  3. Open Alarm Logging, search for the message number, and reassign its Trigger Tag to the new internal binary tag.
  4. Implement an E/A field in a process picture, link the field to the new internal tag, and save.
  5. Download the server (delta).
  6. On the OS server, set the new internal tag to 1 and then back to 0. This forces a new timestamp on the message and re-marks it as acknowledgeable.
Note: The above steps only clear the latched state of one specific message. They do not fix the underlying picture binding. Always run Step 3 first; if the latched message persists, then run Step 4 and Step 5.

8. PCS 7 Alarm Logging and CAS Archive Settings

The original fault report noted that the HH and SC alarms were visible in the faceplate alarm window in the days prior to the failure and were no longer visible at the time of investigation. The reason is the 1-week retention configured in Alarm Logging. After one week, events are moved to the CAS (Central Archive Server). The faceplate alarm window is bound to the live Alarm Logging database, not to CAS, and therefore the older events are not displayed.

To inspect the archived events, open the Tag Logging / Alarm Logging archive viewer, connect to the CAS, and query the message number and time range. If the events are present in CAS but absent from the live faceplate, this confirms the time-bound nature of the symptom and is not by itself evidence of a fault.

Recommended Alarm Logging retention values for a process cell of this class
Archive Recommended size Segment type CAS swap
Alarm Logging - short term 7 days Daily, 1 GB Yes
Alarm Logging - long term 12 months Monthly, 4 GB No (CAS only)
Tag Logging - fast 30 days Daily, 2 GB Yes
Tag Logging - slow 12 months Weekly, 4 GB Yes

Retention that is too short causes the engineer to lose the very events needed to diagnose an intermittent fault. Retention that is too long fills the CAS volume. The values above are a reasonable starting point for a small to mid-size cell.

9. Cross-Reference Verification (Tag in Use)

WinCC treats a tag as in use only if it is referenced from at least one of: a graphics object, a script, an alarm, an archive, or a global action. A tag that is configured in Tag Management but is not referenced anywhere will be reported as quality 0x4C by the runtime, because the runtime is not subscribed to it from the AS.

To confirm whether the affected flag tags are referenced, run Cross Reference on the ES against the WinCC project and search for each tag name. The output will list the picture files, scripts, and alarms in which the tag appears. If the flag tag is only listed in Tag Management and nowhere else, then the 0x4C code is "by design" and the tag should either be referenced or removed.

The macro from the field report captured this diagnosis exactly: the tag was in use only in a C / VBScript that the runtime did not flag as a subscriber, so the WinCC internal image of the tag drifted to 0x4C whenever the subscribed picture was not currently open. When the picture displaying the block icon is opened, the runtime resubscribes and the value briefly becomes 0x80. This is consistent with the observation in the source case that the H and L tags changed state when the picture was opened.

10. Diagnosing Bad Quality from Customised Faceplates

The block icon's magenta background is a feature of the customised faceplate that is bound to a quality-code field on the bound tag. When the field is 0x4C, the faceplate paints magenta. The standard APL P_AI faceplate uses the same convention. The differentiation between "bad quality - sensor failure" (which would also show the B text marker) and "uncertain - substitute value" (which does not) is signalled by the lower nibble of the quality code.

How the customised faceplate renders quality codes
Quality code Background colour B marker HH / SC text Meaning
0x80 White / green Hidden Hidden Good - normal read
0x4C Magenta Hidden Hidden Uncertain - substitute value
0x10 / 0x14 Magenta Visible SC visible if SC alarm active Bad - sensor failure / short circuit
0x1C Magenta Visible Hidden Bad - communication failure

The fact that the block icon shows magenta without the B marker is a reliable on-screen diagnostic: the faceplate is reporting a quality code with an uncertain severity bit, not a bad severity bit. This narrows the search to the 0x40-0x7F range and confirms the WinCC-side state hypothesis.

11. Prevention and Hardening

Three engineering controls reduce the likelihood of recurrence.

11.1 Always run a full OS compile after customising a faceplate

A Changes-Only compile is not sufficient to refresh the picture-local binding list for a customised faceplate when the script interface or alarm class has been modified. After any modification to a customised faceplate, run a full OS compile, not a delta compile, then download the full OS image. The full compile forces every picture to re-bind against the new faceplate interface.

11.2 Use the standard APL P_AI faceplate where possible

Customised faceplates and block icons are a common source of binding drift. If the project can be aligned to the standard APL P_AI faceplate, the change reduces the surface area of script-interface mismatches. For projects that require a customised faceplate, freeze the script interface and alarm class on a single PCS 7 version and avoid modifying them on a running plant.

11.3 Avoid improper shutdown of the OS server

A power-cut to the OS server, a forced kill of the WinCC Explorer process, or an out-of-cycle restart of the redundancy service can leave the alarm-logging database and the picture-binding database in inconsistent states. Use the OS server Shut down menu option (not a hard power-off), and protect the OS volume with a UPS sized for at least 10 minutes of runtime to allow a graceful shutdown.

11.4 Periodic Cross-Reference audit

Run a full Cross-Reference of the WinCC project once per quarter and verify that every tag with quality 0x4C is either genuinely unreferenced (and therefore a candidate for removal) or is referenced by a picture, script, alarm, or archive. Quality 0x4C is the most common early indicator of a binding drift before it becomes a hard fault.

12. Verification Checklist

Post-recovery verification checklist
Step What to check Expected result
1 Open the process picture containing PI-1001A / PI-5803 Block icon background is white or green, not magenta
2 Hover the tag name in Tag Management Quality code reads 0x80 for PV and all flag tags
3 Open the faceplate for PI-1001A FAULT text background is grey, AL indicator is grey, no HH / SC messages in the alarm window
4 Open the Incoming Alarm List No HH or SC messages for either tag
5 Cross-Reference the flag tags on the ES Each tag is referenced by at least one picture, alarm, or script
6 Inspect CAS archive for the older HH / SC events Events present in CAS within the configured retention
7 Fail over the OS server pair and repeat the visual check on the standby server Same green/white state on the standby

13. Frequently Asked Questions

What does WinCC quality code 0x4C mean in PCS 7?

Quality code 0x4C is the OPC UA status "Uncertain - substitute value" (decimal 76). In WinCC it most often appears when a tag is configured in Tag Management but is not currently referenced by any graphics object, script, alarm, archive, or global action, or when a picture-local binding has drifted after a delta OS compile. It is an uncertain-severity code, not a bad-severity code, which is why customised faceplates paint the block icon magenta but suppress the B text marker.

Is a WinCC quality code 0x4C a PLC fault?

No. Quality code 0x4C is a WinCC-side status. The PLC may return a perfectly good value with status 0x80. The diagnostic is to open a different process picture that uses the same tag but a different faceplate; if that picture shows quality 0x80, the AS is healthy and the problem is the binding of the customised faceplate on the original picture.

Why does deleting the P_AI FB and recompiling with Changes Only clear the fault?

Deleting the FB invalidates the picture-local binding cache for that instance. The subsequent Changes-Only compile rebuilds the binding from the CFC source and the customised faceplate template, which forces the WinCC runtime to re-subscribe to all the flag tags. It is a working fix on a replicated engineering laptop but is not viable on a live plant because it requires deleting a configured and tested CFC instance.

How do I clear a latched HH alarm that is no longer acknowledgeable?

First run a Changes-Only OS compile with "Update picture objects" ticked to restore the picture binding. If the message is still latched, force a brief 0 -> 1 -> 0 transition on the bound alarm-output tag in the CFC so the OS receives a fresh, good-quality message that can be acknowledged. As a last resort, reassign the trigger tag in Alarm Logging to a new internal binary tag, set that tag to 1 and back to 0 on the OS server, and the latched message will receive a new timestamp and become acknowledgeable.

How do I prevent this from recurring on other tags?

Run a full OS compile (not a Changes-Only compile) after any modification to a customised faceplate, block icon, or alarm class. Use the standard APL P_AI faceplate where the process cell allows it. Run a quarterly Cross-Reference audit and resolve every tag that returns quality code 0x4C. Protect the OS server with a UPS and always shut down through the WinCC menu rather than a hard power-off.

14. Standards and References

  • OPC UA Part 4 - Services, status code 0x4C00 (Uncertain_SubstituteValue) and 0x0000 - 0x8000 quality mask.
  • SIMATIC PCS 7 Process Control System - Operator Station manual, chapter "Alarm Logging and CAS".
  • SIMATIC PCS 7 - APL Style Guide, sections on P_AI faceplate and quality code mapping.
  • WinCC Unified documentation - Alarm control overview (WinCC Unified RT).

The WinCC Unified alarm control reference above documents the modern successor to the classic WinCC Alarm Control used in PCS 7 V9.x and earlier. Engineers maintaining legacy PCS 7 cells can use it as a reference for the alarm-control object model when planning an upgrade to PCS 7 V10 / WinCC Unified RT.

Back to blog