General
This Siemens function block for TIA Portal is quite simple and not function is not very complicated. It is placed instead of your “Program_Alarm” right after your alarm/warning/message condition. This block looks at its inputs and writes in the structure of the PLC_Alarm_Handler.
Inputs
| Name | Data type | Comment |
|---|---|---|
| Active | Bool | Alarm active |
| MessNo | UInt | Message Number This number is linked to the textlist “PLC-Alarm_List”. It has to be a static number, NOT a dynamic one. |
| Class | USInt | Enter here the message class, more infos below x2=Alarm, x1=Warning, x0=Message |
| AddMessNo | UInt | Additional Message Number This number is linked to the additional list “PLC-Alarm-Add”. It can be dynamic |
Function
With an rising edge on the “Active” input the block takes the values (MessNo, AddMessNo) and writes it in a free place to the right class in the “PLC_Alarm_Handler_DB”. The FB “PLC_Alarm_Handler” is then activating the “Program_Alarm” blocks. If an additonal value is changing after the rising trigger, the message will NOT be refreshed. To acknowledge the message, the active input have to be “0” and rising edge have to be indicated on the input “Ack” in the FB “PLC_Alarm_Handler”.
Class
The message class is important assign every message to a machine part and to define it’s weighting. You can select between three kinds of messages: alarms, warnings and informations.
The second fact about the classes is that we have predefined 10 zones (0 to 9) in the PLC_Alarm_Handler DB.
As the input for the class on this FB is decimal we dicided to make the following system. The first number, the tens number, is the zone from 0 to 9. And the second number defines the kind of message (alarms = 2, warnings = 1 or informations = 1).
Some examples:
Class = 52 => An alarm because the ones digit is 2, in the 5th zone because the tens digit is 5.
Class = 01 or 1 => A warning because the ones place is 1, in the 0th zone because the tens place is 0.
Class = 90 => On message because the units digit is 0, in the 9th zone because the tens digit is 9.