Logging Alarms and Operator Actions from Custom Shared DBs in SIMATIC PCS 7

Logging Alarms and Operator Actions from Custom Shared DBs in SIMATIC PCS 7

In SIMATIC PCS 7, when an automation engineer creates custom Shared Data Blocks (DBs) containing Boolean operational flags outside the standard Advanced Process Library (APL), alarms and operator actions cannot be logged by simply compiling the charts. To integrate custom DB signals into WinCC Alarm Logging with millisecond timestamping, engineers must either encapsulate the signals using the system block ALARM_8P (SFB 35) or Event (FB 43) in CFC, or manually configure Bit Alarms and Operator Messages in WinCC Alarm Logging pointing directly to the DB addresses.

Table of Contents

Standard APL Alarming vs. Custom Shared DB Architecture

In native SIMATIC PCS 7 applications, alarm generation is completely automated:
* Standard APL technological blocks (MonAnL, MotL, PIDConL) contain internal instances of ALARM_8P (SFB 35).
* When the OS is compiled, the system automatically creates message definitions, links tag values, assigns message classes, and configures alarm display attributes in WinCC Alarm Logging.

However, during brownfield expansions, package skid integrations, or custom mathematical calculations, engineers frequently create custom user logic in SCL or STL stored inside Shared Data Blocks (e.g. DB100):
* DB100.DBX0.0 – Interlock condition active
* DB100.DBX0.1 – Pump bearing high temperature switch
* DB100.DBD2 – Calculated thermal efficiency value

Because these raw DB tags are not encapsulated within PCS 7 library blocks, the OS Compiler completely ignores them for alarm generation. If the engineer wants alarms to appear in the WinCC alarm banner with precise timestamps and operator audit logging, specific engineering mechanisms must be deployed.

Mechanisms for Generating Alarms from Custom Data Blocks

Engineers can bridge custom DB signals into WinCC Alarm Logging using two primary architectures:

Architecture 1: Controller-Based Alarming (ALARM_8P / Event Blocks) - Recommended

In this approach, the alarm is evaluated inside the S7-400 controller using standardized system blocks:
* ALARM_8P (SFB 35): Generates up to 8 distinct messages with associated process values.
* Event (FB 43 / FB 851): A simplified PCS 7 Basis Library block wrapping ALARM_8P for rapid integration into CFC.
* Benefit: Guarantees millisecond-accurate controller timestamping at the moment the Boolean tag changes in the cyclic OB, independent of network polling latency.

Architecture 2: HMI-Based Alarming (WinCC Bit Alarms)

In this approach, WinCC Server polls the DB variables over the Industrial Ethernet plant bus:
* In WinCC Alarm Logging, the engineer manually creates a new message with Message Type 'Alarm' or 'Warning'.
* The trigger tag is assigned directly to the WinCC S7 tag representing DB100.DBX0.0.
* Drawback: The alarm timestamp reflects when the WinCC polling cycle detected the bit change, introducing up to 500 ms to 1000 ms timestamp jitter, and increasing plant bus polling traffic.

Implementing ALARM_8P and Event Blocks in CFC

To adhere to PCS 7 best practices, controller-based alarming using the Event (FB 43) block is strongly preferred:
* In a CFC chart, insert an instance of Event.
* Connect the Boolean signals from your custom DB (e.g. DB100.DBX0.0) to the inputs In1 through In8.
* If associated values are required (e.g. recording the exact pressure when the trip occurred), connect the analog value to associated value inputs (ExtVal1 .. ExtVal8).
* Select the Event block, right-click, and open Special Properties -> Messages...:
- Assign custom message texts (e.g. Reactor 1: High Pressure Interlock Tripped).
- Assign Message Class (e.g. Alarm - High or Operating Message).
* When the OS is compiled, the compiler automatically generates the message in WinCC Alarm Logging.

Custom DB Alarm Generation Method Comparison Matrix

The following matrix compares methods for logging alarms from custom shared DBs in PCS 7:

Evaluation MetricController-Based (ALARM_8P / Event)WinCC HMI Bit AlarmsTimestamp AccuracyMillisecond (Controller Clock)Polling interval dependent (100–1000 ms)Plant Bus Network LoadExtremely Low (Event-driven)High (Continuous cyclic tag polling)Chronological Audit TrailCertified for Sequence of Events (SOE)Inaccurate for fast root-cause analysisEngineering EnvironmentCFC / STEP 7WinCC Alarm Logging GUIAssociated ValuesSupported natively (Up to 10 process tags)Limited / Manual configurationRecommended by Siemens?Official PCS 7 StandardDiscouraged for DCS applications

Step-by-Step Procedure to Implement Alarms via Event / ALARM_8P

Follow this standardized procedure to log custom DB alarms:
1. Create and Symbolize the Shared DB:
- In SIMATIC Manager, create DB100 in the S7 Program block folder.
- Define Boolean alarm flags with descriptive names (e.g. Alm_HighTemp, Alm_PressTrip).
- Assign a symbol name to DB100 in the Symbol Table (e.g. DB_CustomAlarms).
2. Insert the Event Block in CFC:
- Open a CFC chart in your target hierarchy folder.
- From the CFC Catalog under PCS 7 Basis Library -> Blocks -> Event (FB 43), drag Event onto the chart.
- Interconnect inputs: Connect DB_CustomAlarms.Alm_HighTemp to input In1.
3. Configure Alarm Message Text:
- Select the Event block instance. Right-click and select Object Properties.
- Click the Messages... button.
- In the Message Configuration dialog, select Message Identifier SIG_1:
- Set Message Class to Alarm - High (or Operating Message if logging an operator action).
- Enter Message Text: Area 1 / Skid B: High Temperature Safety Trip.
- Click OK.
4. Compile AS and OS:
- Compile CFC charts with Scope: Changes only.
- In SIMATIC Manager, execute Compile OS.
- The OS Compiler reads the message attributes from Event and automatically instantiates the message in WinCC Alarm Logging.
5. Download and Test:
- Download the program changes to the AS controller in RUN mode.
- Activate WinCC Runtime to verify live alarm triggering.

Verification

Verify alarm logging and operator tracking:
1. In CFC test mode (or via field sensor excitation): Force the Boolean tag DB100.Alm_HighTemp from 0 to 1.
2. Observe WinCC OS Alarm Screen:
- Verify that the alarm appears immediately in the incoming alarm banner with state Incoming (+) and red background.
- Verify that the message text matches the configured string exactly.
- Inspect the alarm timestamp: Confirm the timestamp matches the exact millisecond controller time.
3. Reset the condition (1 -> 0): Confirm the alarm transitions to Outgoing (-) and clears upon operator acknowledgment (A).

Limitations and Operational Precautions

  • A single ALARM_8P block instance consumes operating system communication resources (S7 message credits); avoid placing hundreds of individual ALARM_8P blocks if signals can be grouped 8-per-block.
  • Never create thousands of raw WinCC Bit Alarms over Industrial Ethernet, as continuous cyclic polling can saturate OS Server CPU and CP 1623 bandwidth.
  • Ensure time synchronization (SICLOCK / NTP) is properly configured on the controller to guarantee meaningful historical alarm sequencing.

Engineer FAQ

Can I log operator actions (who clicked a button) using ALARM_8P?

Yes. By assigning the message class to Operation Message (Class 17 in PCS 7) and passing the operator username via an associated string tag, ALARM_8P records an indelible operator audit entry in WinCC Alarm Logging.

What is the difference between SFB 35 ALARM_8P and SFB 34 ALARM_8?

ALARM_8P supports up to 10 associated process values (ExtVal) that are transmitted alongside the alarm telegram. ALARM_8 transmits only the Boolean state changes without associated analog values.

Does using the Event block consume an AS Process Object (PO) license?

No. Basic signaling and utility blocks from the PCS 7 Basis Library (such as Event, CountOh, or SelA16In) do not consume AS Process Object licenses.

Technical References

Related Articles

Related Tags

  • SIMATIC PCS 7 V8.1
  • Alarm_8P
  • Event FB 43
  • Shared DB
  • WinCC Alarm Logging
6 respuestas