Usage
Initialization
To use AlarmLib functions, you must first initialize an Alarm Collector. This will be used internally to set and monitor alarms. The following example assumes that a properly configured mapp AlarmX configuration called gAlarmXCore and a variable of type alarmCol_typ called alarmCollector are declared. Only a single Alarm Collector is required per project.
alarmCollector.in.par.coreMpLink := ADR(gAlarmXCore);
alarmCollectorInit(ADR(alarmCollector));
Cyclic Operation
For the Alarm Collector to work properly, a cyclic function must be called.
alarmCollectorCyclic();
Setting Alarms
Alarms can be set using alarmColSetError or alarmColSetErrorExt. Alarms are not required to be configured prior to use. Alarm Collector will configure a mapp alarm with the name provided; because of this, the name should be unique throughout the application. Note: If no name is provided, Alarm Collector will generate one.
alarmColSetErrorExt(ADR('MyAlarm'), ADR('This is an Alarm set with Alarm Collector'), 101, 1, ADR(error1Ack), ADR('some additional info'), ADR('and maybe more info :)'));