Lax

Description

This library is an extension to the AlarmX library in the B&R Automation system. It provides a set of functions that can be used to easily configure and use alarms within the AlarmX system. It provides a simple interface to configure alarms at runtime and to easily use them in applications.

Why did we create this library?

The AlarmX system is a great library for configuring and using alarms in the B&R Automation system, however:

  • Alarms are labor-intensive to configure, and difficult to bundle with common code between projects.
  • Alarms are referenced by a string in code, which is error prone because of spelling mistakes.
  • Alarms are specific to “cores” and raising alarms on other cores is a common mistake.
  • It is cumbersome to add a snippet to your alarm message.
  • Creating alarms at runtime using the AlarmX library is possible but has implications to performance and boot up times.

This library aims to simplify the use of alarms in applications by providing an interface to configure alarms at runtime, ensure the strings match and are used with the correct core, and are easy to use in applications.

How does it work?

Lax has two main functions:

Alarm Creation

This is done in the init routines and creates the alarms in the AlarmX system. The idea is that the alarms are created using structures that are also used to raise the alarms. This ensures that the strings match and are used with the correct core. It also add a snippet structure so all alarms can easily use snippets as part of their alarms.

The alarms are added to the “Alarm Builder” object which is then used to create the alarms in the AlarmX system by writing them to an XML file. This file is then imported into the AlarmX configuration.

A default TMX file is provided that contains the Alarm Message Provided and a placeholder for a snippet. This TMX file can be added to the project and customized, or handed off to a translator for multilingual support.

Alarm Raising

This is done in the cyclic routines and raises the alarms in the AlarmX system. The idea is that the alarms are raised using structures that are also used to create the alarms. This ensures that the strings match and are used with the correct core. The structure also contains an ID so that it can support level alarms out of the box.

Use Cases

Projects that:

  • Use MpAlarmX
  • Use static AlarmX configuration and/or want to add dynamic alarms at runtime based on configuration
  • Use dynamic error messages

Overview