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
- Mechanics of Dynamic Auxiliary Values (SD_x) and Text Library References
- Root Causes: Buffer Overwrites, Asynchronous Fetch, and Queue Saturation
- Static Instance Allocation vs Temporary Scratch Memory Hazards
- Comparative Fault Matrix: ALARM_8P Auxiliary Value Formatting Anomalies
- Step-by-Step Configuration to Ensure Reliable Multi-Instance Messaging
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
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:
-
Temporary Variable Scope Overlap: If the FB code writes values to temporary local data (
TEMParea) and passes pointers (SD_1 := #TempVar) toALARM_8P, the memory content is lost after the block finishes executing. Because message transmission over Industrial Ethernet is asynchronous, WinCC reads uninitialized memory. -
Communication Queue Saturation: Firing four
ALARM_8Pblocks (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. -
Missing Text Library Keys: If
SD_9passes 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_1throughSD_10must reside in the Function Block'sVAR(Static) memory area or dedicated Data Blocks, never in temporary (TEMP) stack variables. -
Each embedded
ALARM_8Pmust possess its own unique, non-overlappingEV_IDgenerated 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:
- 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 - Assign Unique EV_IDs: In the block properties or CFC chart, ensure each
ALARM_8Phas a unique message ID (EV_ID_1,EV_ID_2). - Populate Statics Before Triggering: Ensure the static auxiliary variables are written before pulsing the signal input (
SIG_1). - Audit WinCC Text Library: Open WinCC Text Distributor / Text Library. Verify that every numeric index passed to
SD_1andSD_9exists with valid translated text across all target languages. - 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).
- Compile and Download: Perform full CFC compilation and OS compilation.
Verification
Verify alarm formatting using these diagnostic methods:
- CFC Test Mode Trigger: In CFC test mode, force
SIG_1on instance 1 and instance 2 simultaneously. - Alarm Banner Audit: In WinCC Runtime, open the Alarm List. Verify both messages display complete text headers and descriptions without missing placeholders.
- Multi-Language Test: Switch the WinCC Runtime language from English to German or Spanish. Confirm dynamic text updates cleanly in all languages.
- 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_1toSD_10). Attempting to mapSD_11is illegal. -
Payload Size Constraints: The combined byte length of all auxiliary values in a single
ALARM_8Pcannot 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
- SIMATIC System Software for S7-300/400 System and Standard Functions (Entry ID: 109751825)
- SIMATIC Process Control System PCS 7 Programming Instructions for Blocks (Entry ID: 109746516)
- Siemens Industry Online Support (SIOS) FAQ: Using ALARM_8P with Dynamic Text (Entry ID: 109740190)
- SIMATIC WinCC V7.4 / V7.5 Alarm Logging Manual (Entry ID: 109746517)
Related Articles
- Creating Custom AS Blocks and OS Faceplates in SIMATIC PCS 7
- Resolving WinCC Alarm Logging Segmentation, Automatic Backup, and Long-Term Archiving
- Diagnosing 'F' Symbol on PCS 7 APL Block Icons - Bit 24-25 in EventState
Related Tags
- SIMATIC PCS 7
- ALARM_8P
- SFB35
- Auxiliary Values
- Text Library
- WinCC Alarm Logging
- S7-400