How to Transfer External Real-Time Alarms into PCS 7 Alarm Logging Using OPC A&E and EventTs

How to Transfer External Real-Time Alarms into PCS 7 Alarm Logging Using OPC A&E and EventTs

To transfer real-time alarms from an external system into PCS 7 Alarm Logging without manually configuring redundant alarm lists, use OpenPCS 7 or WinCC OPC Alarms and Events (OPC A&E). Because standard PCS 7 WinCC natively operates as an OPC A&E Server rather than an OPC A&E Client, external systems must either implement an OPC A&E Client to push alarms, or pass alarm triggers with millisecond-accurate timestamps into the AS controller using the EventTs block (FB1817). Alternatively, external alarms can be injected directly into the WinCC Alarm Logging database using the WinCC Open Development Kit (ODK) function MSRTCreateMsg via C-scripts.

Table of Contents

Challenges of Synchronizing External Alarms with PCS 7 Alarm Logging

In modern industrial processing facilities, SIMATIC PCS 7 operates alongside third-party automation systems: vibration monitoring skids, power management systems (PMS), burner management systems (BMS), and emergency shutdown systems (ESD).

Plant managers frequently mandate that all alarms across the facility appear in a unified, chronological sequence of events (SOE) on the PCS 7 WinCC alarm banner. However, manually recreating external alarms inside WinCC Alarm Logging presents severe engineering drawbacks:
* As external alarm lists expand over time, maintaining two synchronized alarm databases across different vendors becomes an administrative nightmare.
* Polling alarms across standard communication drivers (such as Modbus or OPC DA) introduces latency, losing the original microsecond-accurate event timestamp generated by the external device.
* Operators receive out-of-sequence alarms, complicating post-trip root cause analysis.

OPC Alarms and Events (OPC A&E) Client vs Server Roles in PCS 7

When evaluating standard industrial communication protocols, engineers frequently identify OPC Alarms and Events (OPC A&E) as the ideal standard:
* The PCS 7 Role: By default, SIMATIC PCS 7 and OpenPCS 7 operate as OPC A&E Servers. They expose internal PCS 7 alarms to external supervisory platforms (such as enterprise historians or corporate SCADA).
* The Client Limitation: Standard WinCC Explorer does not include an off-the-shelf, configurable OPC A&E Client channel to browse and subscribe to external OPC A&E servers directly.
* Architectural Inversion: To transfer alarms using OPC A&E, the external system must host an OPC A&E client application that connects to PCS 7, or an intermediate gateway service must be deployed on the terminal bus to bridge external A&E events into WinCC.

High-Precision Chronological Alarming with EventTs (FB1817)

The most robust, Siemens-certified method for bringing external alarms into PCS 7 with full chronological integrity is utilizing the EventTs (FB1817) block in the Automation Station:

  1. Transfer Discrete Trigger Bits to the AS:
    * Map digital alarm bits from the external system into an S7-400 or CPU 410 Data Block via Industrial Ethernet (Modbus TCP, PROFINET, or S7 communication).
  2. Instantiate EventTs in CFC:
    * Insert EventTs from the PCS 7 APL library into a cyclic interrupt chart (OB35).
    * Interconnect the external alarm bits to inputs In1 through In16.
  3. High-Resolution Timestamping:
    * EventTs time-stamps incoming signal transitions with millisecond accuracy based on the CPU system clock.
    * If the external hardware supports hardware-in-the-loop time stamping (e.g., ET 200M with high-resolution digital inputs), EventTs captures the field timestamp directly.
  4. Automatic Alarm Logging Generation:
    * Compile the CFC chart and execute an OS Compilation.
    * PCS 7 automatically creates the alarm messages in WinCC Alarm Logging with appropriate alarm classes, colors, and acknowledgment properties.

Injecting Real-Time Alarms via WinCC ODK and C-Scripting

If alarms must be created dynamically without touching the AS controller program, engineers can utilize the WinCC Open Development Kit (ODK) API from a C-script or external service:

  • The WinCC message runtime engine provides the unmanaged C-function MSRTCreateMsg:
    ```c
    #include "msrtapi.h"

void InjectExternalAlarm(long msgNumber, char msgText, SYSTEMTIME pTimestamp)
{
MSG_RTDATA_STRUCT msgData;
memset(&msgData, 0, sizeof(msgData));

  msgData.dwMsgNr = msgNumber;
  msgData.stMsgTime = *pTimestamp; // Pass exact external timestamp
  msgData.dwMsgState = MSG_STATE_COME; // Come (Active) or Go (Inactive)

  // Inject message into WinCC Message System
  MSRTCreateMsg(NULL, &msgData, NULL);

}
```
* This function injects an alarm event directly into the active alarm list with an external timestamp, bypassing PLC memory registers entirely.

Comparison of External Alarm Integration Pathways

The table below compares the technical mechanisms for importing external real-time alarms into SIMATIC PCS 7.

Integration MethodProtocol / TechnologyTimestamp AccuracyRequires AS Blocks?Maintenance OverheadEventTs (APL Block)S7 / PROFINET / Modbus to ASMillisecond accurate (CPU time)Yes (FB1817 in CFC)Low (Standard PCS 7 engineering)WinCC ODK (MSRTCreateMsg)C-API / ODK LibraryExact external timestampNo (Direct WinCC injection)High (Requires custom C software)OPC A&E GatewayOPC A&E Bridge to WinCCDependent on gateway latencyNo (External gateway service)Moderate (Third-party software)Raw Polling via OPC DAModbus / OPC DA to WinCC tagsPoor (PC poll time, not event time)Optional (Can use internal tags)High (Requires static tag mapping)

Verification

To confirm that external alarms are successfully logged in real time:
1. Trigger a test alarm condition on the external skid or subsystem.
2. In WinCC Runtime, open the active alarm list and alarm journal.
3. Verify that the alarm appears immediately with the correct technological source, alarm class, and descriptive text.
4. Compare the timestamp recorded in the WinCC alarm journal with the external system's internal event log: confirm that event timestamps align within acceptable millisecond tolerances.
5. Clear the alarm on the external system: verify that the alarm state transitions to 'Go' and clears from the active alarm banner upon acknowledgment.

Limitations and Operational Precautions

  • Never attempt to flood the WinCC alarm system with high-frequency cyclic alarm injections; exceeding 100 messages per second will trigger alarm buffer overflows in CCAlgRtServer.exe.
  • Ensure that the external system and the PCS 7 automation station are synchronized to the exact same master NTP/SICLOCK time server; clock discrepancies will corrupt chronological sorting.
  • WinCC ODK functions require appropriate development licenses and deep C-programming expertise; improper memory allocation in MSRTCreateMsg can crash the WinCC runtime engine.
  • Always validate final license quantities and MLFBs for optional packages like OpenPCS 7 or ODK against the applicable Siemens catalog and authorized distributor quotation before deploying production interfaces.

Engineer FAQ

Does WinCC have a native OPC A&E Client channel?

No. WinCC features an OPC A&E Server, but does not provide a standard off-the-shelf OPC A&E Client channel in Tag Management. To bring alarms in via OPC, third-party middleware or AS-level blocks (EventTs) must be used.

What is the advantage of using EventTs over standard CFC alarm messages?

EventTs is optimized specifically for chronological sequence of events (SOE) recording. It supports 16 independent digital alarm inputs per block and binds high-precision timestamps at the moment of signal acquisition, preserving the true sequence of events.

Can external alarm text be passed dynamically without configuring Alarm Logging?

When using EventTs, the static message text is configured during engineering in the block properties. However, dynamic process values (such as temperatures, pressures, or string codes) can be attached to the message via the block's associated value inputs (ExtVal1, ExtVal2), which WinCC displays dynamically in the alarm message line.

Technical References

Related Articles

Related Tags

  • Alarm Logging
  • EventTs
  • OPC A&E
  • Sequence of Events
  • WinCC ODK
6 respuestas