AlarmCounter (FB)

FUNCTION_BLOCK AlarmCounter

Short Descritpion

Reading out the active alarms from a predefined alarm group

Typical application: display of the number of active alarms

Portrayal

../_images/AlarmCounter_FB.png

Interfaces

Inputs

Name

Datatype

Range

Init-Value

Function

udiAlarmgroup UDINT    

Alarm group ID

sAlarmClass STRING    

Name of the alarm class

Outputs

Name

Datatype

Range

Init-Value

Function

iTotalActiveAlarms INT    

Total Number of active alarms with the following states: “Active”,”Waiting for acknowledgement” and “Active, acknowledged”)

iActive INT    

Number of alarms in “Active” state

iActiveACK INT    

Number of alarms in the state “Active, acknowledged”

iWaitingForACK INT    

Number of alarms in the state “Waiting for acknowledgement”

Functional description

General

This function block is used to read out the number of active alarms in different states.
In order to read out the number of active alarms, the respective alarm group ID and the alarm class name must be specified.

Determine the alarm group ID udiAlarmgroup

The alarm group ID is an internally generated ID of CODESYS.
This ID can be output via the “AlarmManager library” of CODESYS.

Note:
The ID is only available after an alarm group has been created and a build has been carried out.
In addition, the variable is not automatically completed when you enter it.

Alm_AlarmConfiguration_Alarmgroup_InternalIDs.ID_<Alarmgruppen Name>

Determine the name of the alarm class sAlarmClass

The name of the alarm class is the name of the created alarm class object.

Visualisation




Information

Element

Authors

Date

Version

Information

Function

Kevin Rohn 09.2016 1.0

Initial version

Programming

Kevin Rohn 09.2016 1.0

Initial version

Test Lukas Pfänder 10.2016 1.0

Initial version

Documentation

Kevin Rohn 11.2017 1.0

Initial version

Codesys

InOut:
Scope Name Type Comment
Input udiAlarmgroup UDINT

Alarm group ID

sAlarmclass STRING Alarmklassen Name
Output iTotalActiveAlarms INT

Total Number of active alarms with the following states: “Active”,”Waiting for acknowledgement” and “Active, acknowledged”)

iActive INT

Number of alarms in “Active” state

iActiveACK INT

Number of alarms in the state “Active, acknowledged”

iWaitingForACK INT

Number of alarms in the state “Waiting for acknowledgement”