Resolving Incomplete ALARM_8P Auxiliary Values and Message Text Truncation in SIMATIC PCS 7

Resolving Incomplete ALARM_8P Auxiliary Values and Message Text Truncation in SIMATIC PCS 7

When a custom Function Block containing multiple embedded ALARM_8P instances (SFB35) generates messages with missing or truncated text placeholders (@9W%t#Block@ or @1W%t#Block@), the failure is caused by auxiliary value buffer overwrites or communication queue saturation. In S7-400 CPUs, ALARM_8P transmits associated values (SD_1 to SD_10) asynchronously. If multiple embedded ALARM_8P blocks trigger simultaneously within the same cyclic scan while sharing dynamic scratch variables, or if the CPU message buffer overflows before WinCC fetches the text library strings, placeholders cannot resolve. Storing auxiliary values in unique static instance memory and staggering message triggers resolves the truncation.

Table of Contents

Architecture of ALARM_8P (SFB35) Message Transmission in S7-400 CPUs

In SIMATIC PCS 7, alarm generation is event-driven and executed at the controller layer using the system function block ALARM_8P (SFB35). Each ALARM_8P block monitors up to eight binary alarm signals (SIG_1 to SIG_8) and packages up to ten associated auxiliary values (SD_1 to SD_10) into an S7 communication telegram.

When a signal transitions, the CPU places an alarm packet into the internal S7 communication message buffer. WinCC OS queries this buffer, matches the event ID (EV_ID), formats the message text using the configured Text Library strings, substitutes dynamic auxiliary values, and inserts the record into the WinCC Alarm Logging database.

Mechanics of Dynamic Auxiliary Values (SD_x) and Text Library References

Message text formatting frequently employs dynamic text insertion strings such as:
@9W%t#Block@: @1W%t#Block@

  • @9W%t#Block@: Specifies that Auxiliary Value 9 (SD_9) is interpreted as a 16-bit WORD (W) representing an index key (%t) into the WinCC Text Library under text block #Block.

  • @1W%t#Block@: Similarly looks up the text string referenced by Auxiliary Value 1 (SD_1).

For WinCC to resolve both placeholders, the S7 message telegram must arrive with intact pointers and stable data words matching valid entries in the WinCC Text Library.

Root Causes: Buffer Overwrites, Asynchronous Fetch, and Queue Saturation

When an engineer nests four ALARM_8P instances inside a single custom FB and messages arrive with missing prefixes or partial text, the failure typically stems from one of three factors:

  1. Temporary Variable Scope Overlap: If the FB code writes values to temporary local data (TEMP area) and passes pointers (SD_1 := #TempVar) to ALARM_8P, the memory content is lost after the block finishes executing. Because message transmission over Industrial Ethernet is asynchronous, WinCC reads uninitialized memory.

  2. Communication Queue Saturation: Firing four ALARM_8P blocks (up to 32 alarms) in a single CPU scan cycle can exhaust the CPU's configured communication job buffer (PDU buffer). The CPU prioritizes core message timestamps while truncating secondary auxiliary payload bytes.

  3. Missing Text Library Keys: If SD_9 passes an integer ID that has no corresponding translation in the WinCC Text Library for the active runtime language, WinCC renders a blank string or partial punctuation.

Static Instance Allocation vs Temporary Scratch Memory Hazards

To guarantee data persistence until the message is acknowledged across the network:

  • Auxiliary variables connected to SD_1 through SD_10 must reside in the Function Block's VAR (Static) memory area or dedicated Data Blocks, never in temporary (TEMP) stack variables.

  • Each embedded ALARM_8P must possess its own unique, non-overlapping EV_ID generated during compilation, and separate static storage for its associated values.

Comparative Fault Matrix: ALARM_8P Auxiliary Value Formatting Anomalies

The following table correlates message text symptoms with their underlying technical causes:

| Message Output Display | Underlying Failure Mechanism | Memory / Protocol Fault |
|---|---|---|---|
| @9W%t#Block@: Motor Trip | Auxiliary Value 9 missing or unresolvable | Text Library ID not found or SD_9 value is 0 |
| Compressor 1: (Missing text 2) | Auxiliary Value 1 dropped during transfer | Communication buffer truncation or SD_1 out of range |
| : Motor Trip (Missing text 1) | SD_9 corrupted by temporary memory overwrite | Variable assigned in TEMP memory rather than VAR |
| ??? displayed in place of value | Data type mismatch in format string | Passed REAL (%f) where string specified WORD (%t) |
| Full message renders perfectly | Normal operation | Static memory allocated; queue within PDU limits |

Step-by-Step Configuration to Ensure Reliable Multi-Instance Messaging

Follow these engineering rules when embedding multiple ALARM_8P instances within a custom FB:

  1. Declare Static Storage: In the FB variable declaration, define distinct static variables for each message's auxiliary values:
    scl VAR Msg1_Aux1 : WORD; Msg1_Aux9 : WORD; Msg2_Aux1 : WORD; Msg2_Aux9 : WORD; AlarmInst1 : ALARM_8P; AlarmInst2 : ALARM_8P; END_VAR
  2. Assign Unique EV_IDs: In the block properties or CFC chart, ensure each ALARM_8P has a unique message ID (EV_ID_1, EV_ID_2).
  3. Populate Statics Before Triggering: Ensure the static auxiliary variables are written before pulsing the signal input (SIG_1).
  4. Audit WinCC Text Library: Open WinCC Text Distributor / Text Library. Verify that every numeric index passed to SD_1 and SD_9 exists with valid translated text across all target languages.
  5. Tune CPU Communication Load: In HW Config, open CPU Properties -> Cycle/Clock Memory. Increase the Communication Load parameter (default 20%, increase to 30–40% if burst alarm generation is high).
  6. Compile and Download: Perform full CFC compilation and OS compilation.

Verification

Verify alarm formatting using these diagnostic methods:

  1. CFC Test Mode Trigger: In CFC test mode, force SIG_1 on instance 1 and instance 2 simultaneously.
  2. Alarm Banner Audit: In WinCC Runtime, open the Alarm List. Verify both messages display complete text headers and descriptions without missing placeholders.
  3. Multi-Language Test: Switch the WinCC Runtime language from English to German or Spanish. Confirm dynamic text updates cleanly in all languages.
  4. Diagnostic Buffer Check: Check the S7-400 CPU diagnostic buffer. Confirm zero entries for 'Message buffer overflow' or 'PDU queue full'.

Limitations and Operational Precautions

Observe the following programming precautions:

  • Maximum 10 Associated Values: SFB35 supports a hard maximum of 10 auxiliary values (SD_1 to SD_10). Attempting to map SD_11 is illegal.

  • Payload Size Constraints: The combined byte length of all auxiliary values in a single ALARM_8P cannot exceed the maximum S7 PDU size (typically 480 bytes in S7-400).

  • 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

What does the format string @9W%t#Block@ signify?

It indicates that auxiliary value SD_9 is evaluated as a 16-bit word key that looks up a text string in the WinCC Text Library under text block #Block.

Why did standalone ALARM_8P calls work when the embedded FB failed?

Standalone blocks typically have dedicated instance DBs with persistent memory, whereas embedded calls often fail when programmers accidentally map temporary scratch variables to SD inputs.

Does increasing the CPU communication load affect cycle time?

Increasing the configured communication load from 20% to 30% allows the CPU to process more message telegrams per cycle, which can slightly increase OB1 scan time during alarm bursts.

Technical References

Related Articles

Related Tags

  • SIMATIC PCS 7
  • ALARM_8P
  • SFB35
  • Auxiliary Values
  • Text Library
  • WinCC Alarm Logging
  • S7-400
6 respuestas