Skip to content

Alarms

Parsing of the alarm list communication object (C.O. 24545). Controller.read_alarms() calls this internally.

pycomap.alarms.AlarmRecord dataclass

AlarmRecord(
    is_active: bool,
    is_confirmed: bool,
    reason: str,
    prefix: str,
    occurred: int,
    source: int,
    fault_code: int,
)

One entry from the controller's alarm list (CommunicationObject.ALARM_LIST, C.O. 24545).

Source: AlarmListRecord.LoadIL3 + LoadCommonPart in ComAp.Controller.dll. The IL3 format is 112 bytes = up to 16 x 7-byte records; records stop at the first unused slot (all fields at max value) or end of buffer.

reason is resolved from AlarmReasonNames and matches the value's display name (e.g. "Generator Voltage L1-N"). prefix comes from HistoryPrefixNames and encodes the protection type (e.g. "Wrn", "Sd").

For non-ComAp diagnostic codes (ECU alarms from CAN bus), reason and prefix will be empty strings and fault_code carries the raw ECU fault code.

pycomap.alarms.parse_alarm_list

parse_alarm_list(
    config_data: bytes, alarm_data: bytes
) -> list[AlarmRecord]

Parse the controller's ALARM_LIST blob (C.O. 24545) into a list of AlarmRecord objects, in list order (most recent first per controller behaviour).

Only active (IsUsed) slots are returned; the list will be empty if there are no current alarms. Pass the full raw ConfigurationTable blob as config_data — it is used to resolve the AlarmReasonNames and HistoryPrefixNames heaps.