Niagara alarm extensions

Curious if there is a way to reset the alarm count on alarm extensions. This count persist even after the alarm database is wiped.

It’s possible maybe through a program object but I’ve never had that request.

Yes, it can be reset, but only from station-side code. There is no action, right-click command or ack that clears it.

The number you have highlighted is not held in the alarm database at all, which is exactly why wiping that database leaves it alone. Every alarm extension in the palette - OutOfRange, FloatLimit, BooleanChangeOfState, BooleanCommandFailure, Status and the rest - is the same class, AlarmSourceExt, with different fault and offnormal algorithms plugged in. That class has two frozen struct properties, toOffnormalTimes and toFaultTimes, and each is an AlarmTimestamps holding alarmTime, ackTime, normalTime and count. So your 468 is an ordinary property sitting in the station’s component tree, saved in the bog with everything else. The alarm database is a separate space, so clearing it cannot touch this, and a restart just reloads the saved value. Nothing in the extension’s start-up or property-change handling resets it either; the only line in the whole framework that writes it is the one that adds one on each transition to offnormal or fault.

It is flagged readonly, which is why Workbench will not let you type in the field, but readonly in Baja is a presentation flag rather than access control. It stops the slot being a link target and makes the editor refuse, and that is all - the set path itself never tests it, and the only thing a property write is refused on is the user’s write permission. The framework proves the point, because the line that increments the counter calls setCount on that same readonly property.

So from a Program object, resolve the extension and call getToOffnormalTimes().setCount(0), plus getToFaultTimes().setCount(0) for the fault counter. That is BAlarmTimestamps.setCount(int), which underneath is BComplex.setInt(Property, int, Context) with a null context. You do not need to clear the flag with setFlags first.

Without code, the other route is copy and paste. count, alarmTime, ackTime and normalTime are all marked defaultOnClone, so a normal paste of the extension, or of the whole point, comes back with the counter at zero; deleting and re-adding the extension does the same. Keep the same slot name and the source ord is unchanged, so old alarm records still resolve to it. But if the point is in alarm at the time you strand the open record, because nothing is left to send it to normal, and alarmState and ackedTransitions get reset as well.

The caveat worth saying plainly: nothing reads this counter. Its only job is to stamp a Count field onto the outgoing alarm record, which the console can show as a column. Routing is by alarm class, not by count. Resetting it changes what future alarms display, and nothing else.