Disabling a lower priority alarm via scripting/expression

Hello everyone,

I’ve got a UDT tag that can trigger three separate alarms. Here is a structure of this tag:

image

How this works is I have a separate tag that is reading Kepware values. The alarm setpoint is 12. Once the value falls below 12, the LAlarm, HAlarm, and HHAlarm bits above are all triggered since they share the same setpoint. The client wants the Low, Medium and High alarms to become active after x amount of time. The also want a the lower priority alarms to disappear from the alarm status table after a higher priority alarm becomes active.

For example, if the low alarm is active and x amount of time passes without it clearing, the medium alarm (HAlarm) will be displayed the the low alarm (LAlarm) will disappear. The same situation is the case for the HAlarm and HHAlarm.

The UDT alarm bits have the following expression code on them:

LAlarm:

!{[.]LAlarmDisab} &&
{[.]../../CNR/MEAN_CAT_TEMPA/LAlarm} 
&&
	!isAlarmActive (
	concat (
		{[.]_MetaData/TagPath},
		'/HAlarm'
	)
)
&&
	!isAlarmActive (
	concat (
		{[.]_MetaData/TagPath},
		'/HHAlarm'
	)
)

HAlarm:

!{[.]HAlarmDisab} &&
{[.]../../CNR/MEAN_CAT_TEMPA/HAlarm}
&&
!isAlarmActive (
	concat (
		{[.]_MetaData/TagPath},
		'/HHAlarm'
	)
) 

The HAlarm script works fine, but the LAlarm script fails to a bad quality of “Bad_NotFound.” The kicker is the LAlarm script works if I remove one of the isAlarmActive checks. It works for both the HAlarm and HHAlarm checks if they are the only check. Once the second one is added back in it fails. Does anyone know why this is the case or provide a good way do what I’m trying to do?

Thanks.

PS This code has been tried being bound on the Enabled bit of the alarm config, but it didn’t work (probably for the same reason this isn’t working now).