Troubleshooting Siemens DBA OPC Alarm Triggers: External Tag Mapping and EventRaw Configuration in WinCC OS

Troubleshooting Siemens DBA OPC Alarm Triggers: External Tag Mapping and EventRaw Configuration in WinCC OS

When integrating external OPC servers (such as HIMA safety systems) into SIMATIC PCS 7 WinCC OS using Siemens Database Automation (DBA), alarms failing to trigger from external tags (.ALM) while working on internal tags is caused by an OPC update event mismatch or quality code rejection. In WinCC Alarm Logging and DBA, messages mapped to EventRaw#1 evaluate raw bit transitions triggered on change. If the OPC server delivers tags with Uncertain or Bad Quality Codes, or if the WinCC OPC DA channel is configured for Cyclic continuous without change-event notification, WinCC ignores the state transition. Configuring the OPC tag with Good quality (0xC0) and enabling proper event evaluation in DBA resolves the alarm triggering.

Table of Contents

Role of Siemens DBA in Integrating Third-Party Controllers into WinCC

In industrial facilities utilizing multi-vendor automation architectures, non-Siemens controllers—such as HIMA safety PLCs, Triconex SIS, or Schneider Electric systems—must integrate into the centralized SIMATIC PCS 7 WinCC supervisory environment. Siemens DBA (Database Automation) is the specialized engineering utility used to import tag structures, alarm messages, and technological types from third-party sources or OPC servers into WinCC OS.

DBA automates the creation of WinCC Tag Management variables, Alarm Logging messages, and Picture Tree navigation nodes, ensuring that third-party alarms appear identically to native PCS 7 APL alarms in the OS alarm banner.

Architecture of EventRaw and Message Triggering in DBA

In Siemens DBA, messages are frequently linked using the EventRaw bitmask mechanism:

  • Instead of creating individual single-bit tags for every possible alarm, DBA packs multiple alarm states into a raw integer tag (e.g. EventRaw#1, Data Type: DWORD).
  • Each bit in EventRaw#1 corresponds to a specific message number defined in WinCC Alarm Logging.
  • When the external OPC tag (e.g., .ALM) updates, DBA or WinCC Alarm Logging evaluates bit transitions (0 -> 1 for alarm incoming, 1 -> 0 for alarm outgoing).
  • If an engineer tests the structure by driving an internal WinCC tag, the WinCC Data Manager immediately notifies Alarm Logging. However, external OPC tags follow a different communication lifecycle.

Why Internal Tags Trigger Alarms While External OPC Tags Fail

When .ALM triggers alarms as an internal tag but fails as an external OPC tag, three root causes are typically identified:

  1. OPC Channel Quality Code Rejection: WinCC Alarm Logging strictly requires an OPC Quality Code of Good (0xC0 or 0x80). If the HIMA OPC Server transmits the .ALM tag with quality Uncertain (0x40) or Bad (0x00), WinCC discards value transitions.

  2. Cyclic Polling vs Event-Driven Change: If the WinCC OPC DA communication channel is configured for pure cyclic reading without subscribing to DataChange events, rapid bit pulses can be missed between scan cycles.

  3. DBA Tag Prefix and Object Hierarchy Mismatch: In DBA, if the external tag address is incorrectly mapped to an absolute OPC item ID or lacks the proper server prefix, the OPC client channel creates an uninitialized tag in WinCC Tag Management that never receives live updates.

OPC Quality Codes and WinCC Alarm Logging Evaluation Rules

The WinCC Alarm Logging engine enforces deterministic safety filtering:

  • Messages configured with 'Trigger on change' evaluate transitions only when QualityCode == 0xC0.
  • If an OPC connection flickers, the OPC channel writes QualityCode = 0x18 (Connection Failure). Alarm Logging does not treat this as a message incoming event.
  • If the OPC tag is mapped via an intermediate C-script or internal helper tag, ensure the script explicitly forwards the value change upon every update event.

Comparative Trigger Matrix: Internal vs External OPC Tags in Siemens DBA

The following table compares characteristics between internal test tags and external OPC tags in DBA:

Configuration ParameterInternal WinCC TagExternal OPC DA TagExternal OPC UA TagData SourceWinCC Data Manager RAMHIMA OPC DA ServerThird-Party OPC UA ServerQuality Code DependencyAlways Good (0x80 / 0xC0)Validated by OPC Client DLLValidated by OPC UA StackUpdate MechanismInstant memory eventSubscription DataChange / PollMonitoredItem Publish / ResponseEventRaw Bitmask UnpackingImmediate executionEvaluated only on Good QualityEvaluated only on Good QualityFailure Mode if Address WrongN/A (local variable)Quality Code 0x00, Tag FrozenConnection Bad, Tag Disconnected

Step-by-Step Diagnostic and Configuration Procedure for OPC Alarms

Follow this troubleshooting procedure to resolve OPC alarm triggering in DBA and WinCC:

  1. Audit Live OPC Tag in WinCC: Open WinCC Tag Management -> select the OPC channel. Locate .ALM. In runtime, check the Value and Quality Code columns using WinCC Channel Diagnosis (WinCC_Sys_01.log or Channel Diagnosis tool). Verify Quality is 0xC0 (Good).
  2. Verify OPC Item ID in HIMA Server: Open an independent OPC test client (e.g., Siemens OPC Scout or Matrikon OPC Explorer). Connect to the HIMA OPC Server. Ensure the Item ID matches the address configured in DBA character-for-character.
  3. Check DBA Message Definition: In Siemens DBA, open the AS-OS mapping editor. Select the technological block type. Under Messages, verify that Message 1 is assigned to bit 0 of EventRaw#1, Message 2 to bit 1, etc.
  4. Compile DBA to WinCC: In DBA, execute Compile OS. Confirm 0 compilation warnings regarding unresolved message tags.
  5. Alarm Logging Trigger Check: In WinCC Explorer, open Alarm Logging. Select the message. In the properties grid, confirm the Message Tag points to the imported external tag, and the trigger is set to 'Upon change'.
  6. Runtime Test: Force the alarm bit in the HIMA controller. Confirm the alarm appears instantaneously in the WinCC Alarm Control banner.

Verification

Validate system resolution using these verification checks:

  1. Channel Diagnosis Audit: Open WinCC Channel Diagnosis. Under OPC Channel, confirm Connection State: OK and zero error counters.
  2. Alarm Banner Validation: Trigger an external alarm in HIMA. Verify the alarm arrives in the OS incoming alarm list with correct timestamp and message text.
  3. Alarm Reset / Outgoing Test: Clear the alarm bit in HIMA. Verify the alarm transitions to outgoing state in the WinCC Alarm journal.
  4. Acknowledgment Handshake: Acknowledge the alarm on the WinCC OS Client. If bidirectional acknowledgment is configured in DBA, verify the ACK signal writes back to the OPC server.

Limitations and Operational Precautions

Observe the following engineering constraints:

  • OPC DA COM/DCOM Settings: If the HIMA OPC server runs on a separate PC, configure Windows DCOM permissions (dcomcnfg) with matching user accounts to prevent intermittent quality code drops.

  • Time Synchronization: Ensure the HIMA system and WinCC OS are synchronized to a common NTP clock master to prevent out-of-order alarm journaling.

  • Commercial Accuracy Disclaimer: Software order numbers (MLFBs), package structures, and hardware capacity prerequisites vary across PCS 7 versions and hardware platforms. System integrators must confirm exact software entitlements and licensing requirements against the official Siemens Catalog CA 01 and obtain an authorized Siemens distributor quotation prior to purchasing.

Engineer FAQ

How do I check the Quality Code of an OPC tag in WinCC Runtime?

Open the WinCC Channel Diagnosis tool (WinCC_Sys_01.log or Channel Diagnosis application), or monitor the tag's Quality Code in WinCC Tag Management.

Can DBA automatically create WinCC faceplates for third-party blocks?

Yes, DBA allows engineers to map third-party PLC types to WinCC customized block icons and standard faceplates.

Does importing OPC tags via DBA consume WinCC tag licenses?

Yes, every external tag imported from an OPC server counts against the installed WinCC OS Runtime Tag license limit (e.g. 2048, 8192, or 65536 PowerTags).

Technical References

Related Articles

Related Tags

  • SIMATIC PCS 7
  • Siemens DBA
  • WinCC Alarm Logging
  • OPC DA
  • HIMA OPC
  • EventRaw
  • Quality Code
  • Alarm Trigger
6 respuestas