> 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-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 shown.

The "AlarmTraversalConsumer" is used to retrieve all alarm data. The data is not read directly via this function block itself; the "AlarmTraversalConsumer" can be understood as a listener. The data is accessed 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 is held 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 is provided in this buffer.

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

With this function block, all alarms are accessible via IEC code, giving you the possibility to use them for other purposes or to define behavior rules. There are some standard rules that can be used. Different field information can be used to filter all alarms. "IMessageExecution" can be implemented to define custom alarm rules.

InOut:

| Scope  | Name                            | Type                                                                                                                     | Comment                                                                                                                                      |
| ------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Input  | `xForceDeactivateAlarmMessages` | `BOOL`                                                                                                                   | <p>Deactivate Alarm Messages (deactivates all alarm messages<br>and ignores the last state of them)</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 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 bound 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
