Configuring ALARM_8P Attributes and Message Event IDs for Custom Blocks in PCS 7
In SIMATIC PCS 7, when implementing system function block SFB35 (ALARM_8P) in custom function blocks, the 'Messages' configuration button in block properties remains grayed out if essential system attributes are missing from the block interface. To activate the PCS 7 message configuration dialog, assign the block attribute S7_alarm_ui := 'true' to the block header, and declare an input parameter MsgEvId of type DWORD with attributes S7_server := 'alarm_archiv' and S7_a_type := 'alarm_8p'. This instructs the compiler to assign unique message numbers and open message dialogs in SIMATIC Manager.
Table of Contents
- Architecture of ALARM_8P Integration in Custom PCS 7 Blocks
- Mandatory S7 Attributes for Message Number Assignment
- Declaring MsgEvId and S7 Attributes in SCL and CFC
- Compiling and Configuring Alarm Messages in SIMATIC Manager
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Architecture of ALARM_8P Integration in Custom PCS 7 Blocks
In SIMATIC PCS 7, process alarm generation is standardized on the system function block SFB35 (ALARM_8P). Technological function blocks (such as MotL, VlvL, or custom user FBs) encapsulate instances of ALARM_8P to transmit up to 8 discrete process signals (SIG_1 through SIG_8) and up to 10 dynamic associated values (SD_1 through SD_10) directly to WinCC Alarm Logging with millisecond controller timestamps.
When an engineer creates a custom FB, simply calling SFB35 inside the code is insufficient for the PCS 7 engineering environment to recognize it as a message-capable block. The STEP 7 / PCS 7 message compiler relies on metadata attributes (pragmas) declared in the block header and parameter interface to assign message ID ranges and enable the graphical message editor.
Mandatory S7 Attributes for Message Number Assignment
The following table details the mandatory attributes required to enable the PCS 7 message configuration dialog:
S7_alarm_uiFUNCTION_BLOCK)'true'S7_serverMsgEvId / MsgEvId1)'alarm_archiv'S7_a_typeMsgEvId / MsgEvId1)'alarm_8p'ALARM_8P (SFB35).S7_visibleMsgEvId / MsgEvId1)'false'S7_linkMsgEvId / MsgEvId1)'false'Table 1: System attributes required for ALARM_8P messaging in PCS 7.
Declaring MsgEvId and S7 Attributes in SCL and CFC
When authoring custom blocks in Structured Control Language (SCL), declare the parameters and attributes as follows:
FUNCTION_BLOCK FB1500
TITLE = 'Custom Motor Controller'
{ S7_m_c := 'true';
S7_alarm_ui := 'true';
S7_tasklist := 'OB100' }
AUTHOR : 'Author'
FAMILY : 'USER'
VERSION : '1.0'
VAR_INPUT
// Message Event ID parameter for ALARM_8P
MsgEvId1 { S7_server := 'alarm_archiv';
S7_a_type := 'alarm_8p';
S7_visible := 'false';
S7_link := 'false' } : DWORD := 16#00000000;
END_VAR
VAR
// Static instance of ALARM_8P
Inst_Alarm8P : SFB35;
END_VAR
BEGIN
// Call ALARM_8P with assigned MsgEvId1
Inst_Alarm8P(EN_R := TRUE,
ID := 16#EEEE,
EV_ID := MsgEvId1,
SIG_1 := FaultTrip,
SIG_2 := WarningTrip);
END_FUNCTION_BLOCK
Listing 1: SCL interface declaration for ALARM_8P message enablement.
Compiling and Configuring Alarm Messages in SIMATIC Manager
Once the SCL source is compiled into a block in the offline block folder:
1. In SIMATIC Manager, locate FB1500 in the Blocks folder.
2. Right-click FB1500 and select Object Properties.
3. Under the Attributes tab, verify that S7_alarm_ui is set to true.
4. Switch to the General - Part 2 or Special Object Properties tab: the Messages button is now active.
5. Click Messages: the PCS 7 message configuration dialog opens, allowing you to define message classes (e.g., Alarm, Warning, Tolerance), message texts, and format associated values (@1%s@).
6. In CFC, insert the block: every instance receives a unique message number automatically upon placement.
Verification
To confirm proper message block operation:
- Insert an instance of the custom block into a CFC chart in SIMATIC Manager.
- Double-click the block: click the Messages button and verify that message texts are configured.
- Execute Options > Compile OS (Changes Only): verify that the compiler assigns message IDs without warnings.
- Open WinCC Alarm Logging: verify that the 8 message events corresponding to the block instance appear in the message list with correct message classes.
- In runtime, trigger
SIG_1: verify that the alarm appears instantly in the WinCC alarm banner with accurate timestamping.
Limitations and Operational Precautions
- Never manually enter or edit hex values in the
MsgEvIdparameter in CFC; let the PCS 7 message generator manage message ID allocation to avoid duplicate message numbers. - Standard S7-300 CPUs do not support
SFB35 ALARM_8P; custom blocks utilizingALARM_8Pmust execute on S7-400 or CPU 410-5H controllers (6ES7410-5HX08-0AB0). - If multiple
ALARM_8Pinstances are called within a single FB, define distinct event parameters (MsgEvId1,MsgEvId2) with identical attributes for each instance.
Engineer FAQ
Can I add ALARM_8P attributes to a block created entirely in CFC?
No. In CFC, you cannot declare low-level system attributes on block headers or inputs. Custom message-capable blocks must be authored in SCL or compiled as user blocks in STEP 7 before placement in CFC.
What happens if S7_server := 'alarm_archiv' is omitted?
Without this attribute, the message compiler cannot assign a message number from the central project pool, leaving the Messages button permanently disabled.
What is the function of the ID parameter on ALARM_8P?
The ID parameter defines the communication connection identifier. In PCS 7, setting ID := 16#EEEE directs the operating system to route the alarm through the standard internal message buffer to WinCC.
Technical References
- SIMATIC System Software for S7-300/400 System and Standard Functions (A5E02789624)
- SIMATIC Process Control System PCS 7 Advanced Process Library (A5E35003921)
- SIMATIC S7-SCL V5.6 for S7-300/400 Programming Manual (A5E41662960)
- Siemens Industry Online Support: Creating Custom Blocks with ALARM_8P (Entry ID 109739941)
Related Articles
- Constructing Status Words and Signal Status Logic for Custom APL Blocks in SCL
- Configuring Multi-Signal Alarms and Dynamic Associated Values with ALARM_8P and APL Event Blocks
- Integrating PCS 7 APL Technological Blocks and Faceplates into S7-300 and WinCC Projects
- Configuring Free Text Fields and Macro Expansion in PCS 7 Process Object View Messages
Related Tags
- ALARM_8P
- SFB35
- SCL
- MsgEvId
- S7_server
- S7_alarm_ui
- PCS 7