> For the complete documentation index, see [llms.txt](https://support.powerio.com/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.powerio.com/hub/codesys-hvac/en/hvac-alarm-message-library/funktionsbausteine/alarmmanagerhandler.md).

# AlarmManagerHandler

## `AlarmManagerHandler` (FB)

FUNCTION\_BLOCK AlarmManagerHandler

This function block provides an alarm buffer list for each alarm configured in the configuration list. It is independent of the alarm state; even inactive alarms and alarms in the normal state are displayed.

The “AlarmTraversalConsumer” is used to retrieve all alarm data. The data are not read directly via this function block itself; the “AlarmTraversalConsumer” can be understood as a listener. Access to the data is exclusively via the pointer to the “AlarmManagerBuffer”. This pointer is returned by the “AlarmTraversalConsumer”, which provides a Get method for this purpose.

All data for each alarm row are stored in the “stAlarmRowStructure”, and each row is stored in the buffer array “m\_paAlarmBuffer”. The buffer can be accessed via the “ppaFilterAlarms” pointer. Only the filtered data are provided in this buffer.

Please note that only the data within the maximum configured number of alarms are read. This results in a significant performance gain. The data are also stored only once in the “AlarmManagerBuffer”; the buffer is accessed exclusively via the pointer.

With this function block, all alarms are accessible via IEC code, giving you the option to use them for further purposes or define behavior rules. There are some standard rules that can be used. Different field information can be used to filter all alarms. The “IMessageExecution” can be implemented to define your own alarm rules.

InOut:

| Scope  | Name                            | Type                                                                                                                     | Comment                                                                                                                                        |
| ------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| Input  | `xForceDeactivateAlarmMessages` | `BOOL`                                                                                                                   | <p>Deactivate Alarm Messages (deactivates all alarm messages<br>and ignores their last state)</p>                                              |
| Input  | `itfMessageExecution`           | IMessageExecution                                                                                                        | Interface to define message execution rules.                                                                                                   |
| Input  | `paPolicyList`                  | <p>POINTER TO ARRAY<br>\[0..ConstantParameters.gc\_iMaxPolicyRules]<br>OF stPolicy</p>                                   | The list which holds all policy rules.                                                                                                         |
| Input  | `paGroupList`                   | <p>POINTER TO ARRAY<br>\[0..ConstantParameters.gc\_iMaxGroupRules]<br>OF stGroup</p>                                     | The list which holds all groups.                                                                                                               |
| Input  | `xCreateFilterList`             | `BOOL`                                                                                                                   | <p>On a rising edge the “ppaFilteredAlarms” list will be created<br>with the configured parameters “sFilterByType” and<br>“sFilterString”.</p> |
| Input  | `sFilterByType`                 | eFilterType                                                                                                              | Filter by type (e.g.: “AlarmClass” or “AlarmGroup”)                                                                                            |
| Input  | `sFilterString`                 | `STRING`                                                                                                                 | <p>Filter the list with the configured type and the matching<br>filter string</p>                                                              |
| Inout  | `ppaFilteredAlarms`             | <p>POINTER TO POINTER TO<br>ARRAY<br>\[0..ConstantParameters.gc\_iMaxAlarms]<br>OF POINTER TO<br>stAlarmRowStructure</p> | <p>The filtered list, which is dynamically created by the given<br>filter parameters.</p>                                                      |
| Output | `iFilteredAlarmRows`            | `INT`                                                                                                                    | <p>the upper limit for the size of the filtered alarm buffer<br>list.</p>                                                                      |
| Output | `eError`                        | ERROR                                                                                                                    |                                                                                                                                                |
| Output | `stEmailStateInfo`              | stEmailState                                                                                                             |                                                                                                                                                |
| Output | `sAlarmTextPortal`              | `STRING(255)`                                                                                                            |                                                                                                                                                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://support.powerio.com/hub/codesys-hvac/en/hvac-alarm-message-library/funktionsbausteine/alarmmanagerhandler.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
