Creating an Alarm Group and Alarms
In the section below, as an example you define an alarm group with only one alarm. The alarm is used to monitor a variable whose value returns the parts shortage in a plant. When this value fulfills a certain condition, the alarm is triggered. To do this, use the Digital monitoring type in the example and define the alarm condition there.
The alarm also gets an assigned latch variable. This is a variable which provides additional information from the application at the time when the alarm becomes active. The contents of this variable can be included into the alarm message. Moreover, the variable can be used in the alarm visualization to filter the alarms.
Requirement: A suitable alarm class PartsShortage and alarm storage DatabaseFileAlarmStorage
are already configured in the alarm management of the application.
In the device tree, select the Alarm Configuration object.
Click
. For the example, specify the namePartsShortage
.After it is added, the alarm groups PartsShortage is displayed in the device tree. The object opens in the editor.
CODESYS automatically creates the text list PartsShortage for the alarm group PartsShortage.
Create an alarm: Double-click in the Monitoring Type column and select the Digital monitoring type.
The alarm is created.
- . Configure the monitoring in the Digital section:
In the Expression field, specify the expression to the monitored either directly or use the Input Assistant:
bPart1Empty
.Specify the value
TRUE
in the input field on the right. Leave the comparison operator=
between the two expressions.
The statement
bPart1Empty := TRUE
is displayed in the Details column. Configure the other parameters of the alarm:
Class:
PartsShortage
Message:
Parts shortage at Station 1 – Fill level: <LATCH1>
Note:
<LATCH1>
is a placeholder for Latch Var 1. The value of this variable provides additional information about the alarm (in this example: the fill level at the time when the alarm becomes active). Also note the possibility of configuring the alarm visualization so that the alarms can be filtered by the value of a latch variable.Min. Pend. Time:
T#5s
Latch Var 1:
iFillLevel
For the Archiving, specify the alarm storage
DatabaseFileAlarmStorage
which is already configured.Note: You have to specify an alarm storage here because you have defined an alarm of a class with archiving.
If the variable bPart1Empty
switches to TRUE
at runtime, then a message is issued by the alarm management. The value of the variable iFillLevel
is issued with the message. The acknowledgment response and the display are executed according to the PartsShortage alarm class. The alarm is archived.
According to the value of the latch variables defined for the alarm, you can filter the alarms in an alarm visualization. To do this, configure the Alarm Table or Alarm Banner elements accordingly and program an element for specifying the filter value.
Alarm Display in Online Mode
You can create the alarm management and alarm visualization in such a way that the operator still has options to control the display in online mode: filtering of alarms, display for a specific time period, clear history.