Download project
This sample project describes how to access alarm objects by means of a program.
With the AlarmManager
object, it is possible to access active and stored alarms.
It is also possible to register a client to receive alarm events.
This sample project demonstrates how to access an alarm object by means of a program.
With the AlarmManager
object, it is possible to access active and stored alarms.
It is also possible to register a client to receive alarm events.
The sample project contains two alarm tables. The first one (type Alarmtable
) shows the active and stored events.
New alarms can be created by means of the buttons below the table.
The second table simulates an alarm table and shows the stored alarms.
A client has to implement the IAlarmManagerClient
interface to get access to the alarm objects by means of a program.
The IAlarmManagerClient
interface includes the following methods:
GetFilterCriteria
: A filter criteria for active and stored alarmsActiveAlarmChanged
: Notification when an active alarm has changed (for example, if a new alarm is active or the status has changed). The list of active alarms can be read by the IAlarmHandler2.GetActiveAlarms
method. AlarmStorageModified
: Notification when a stored alarm has changed. The list of the stored alarms can be read by the IAlarmHandler2.GetAlarmsFromStorage
method.A filter can be set via the IAlarmFilterCriteria
interface.
The AlarmFilterCriteria
function block implements the IAlarmFilterCriteria
interface.
In the example, the IAlarmManagerClient
interface is implemented by the AlarmManagerClient
function block.
The client is registered at the AlarmManager
in the PLC_PRG
program.
The ProcessAlarms
function writes the alarms to the console of the controller.
System requirements and restrictions | Info |
---|---|
Programming System | CODESYS Development System Version 3.5.14.0 or higher |
Runtime System | CODESYS Control Version 3.5.14.0 |
Required Accessories | - |