EnumAlarm
EnumAlarm(AlarmId As String/Integer, AlarmState As Integer[, AckUserId As Integer[, bDataServer As Boolean[, StationId As Integer]]]) As Integer
Returns in <AlarmId> the next alarm id from the alarm id specified in input in <AlarmId>. The parameter <AlarmId> can be the numeric object id of the alarm tag or its alphanumeric identifier, according with the type of <AlarmId> (Integer or String).
To initialize the enumeration set <AlarmId> to 0 (Integer) or set it empty (String).
If <bDataServer> is specified with the TRUE value, the function only enumerates the alarms of the contextual data server.
The optional <StationId> parameter when defined means the alarms will be searched on the defined station, otherwise it will be searched on all stations. By default it is set to 0.
The alarm state is returned in <AlarmState>. It is defined by the following bit masks:
- bit 0 (mask &h01): activation state of the alarm (1 = active alarm)
- bit 1 (mask &h02): acknowledgment state of the alarm (1 = alarm not acknowledged)
- bit 2 (mask &h04): alarm masked by a user (1 = masked alarm)
- bit 5 (mask &h20): current masking state of the alarm (1 = masked alarm by a user, a masking condition, another alarm or by program)
- bit 6 (mask &h40): connection failure (red cross)
- bit 7 (mask &h80): tag not polled (blue cross)
If <nAckUserId> is specified, the function returns in <AckUserId> the object id of the acknowledgement user (0 if alarm not acknowledged).
The function returns:
- 0: If no error.
- 6: If no more alarm.