IsAlarmActive() expression function poor performance

Can anyone shed light on some performance issues I’ve had with this expression function? I tried using this expression an alarm tag inside of a UDT in the following way:

High Level Tag (Bool):

If (Level > SP || ( isAlarmActive("[.]High Level Tag") && Sensor_Error ) , True, False)

My actual function is a little more complex, but the point is I was using the isAlarmActive() function as a kind of latch in case of sensor error and comm errors or things that might make a process value falsely drop to a safe value.

I implemented over a hundred instances of this in a few different flavors. Then, I checked out the scanclass performance and found that the 5 sec scanclass was averaging over 30 sec per execution. I narrowed it down to this function. I replaced each instance of this function with the following:
({[.]High Level Tag.AlarmActiveUnackCount}+{[.]High Level Tag.AlarmActiveAckCount}>0)

This is not as concise, but the execution time of the same scanclass was reduced to 10ms. That was the only change made. Is this behavior expected? Is the function searching through all active alarms or something to cause poor performance?

What version of Ignition are you on? I know that the alarming expression functions recently went through some optimizations, so if you’re on an older build this could be something we’ve already fixed.

I’m on version 7.9.3. I will also add that this caused a large increase in memory utilization. The memory usage approached the heap limit much faster before garbage collection. I was getting multiple clock drift alerts. Heap is set to 3GB.

1 Like

I’d still like to know if this is a problem with my implementation or an issue with the expression function. Does anyone have any other ways that they have implemented latching signals?

Hello all,

We are bumping on the same performances issues with isAlarmActive(). Opening a view with about 30 expressions using the function causes the CPU to stay at 100% for seconds.
We are on a 7.9.9.
Have the optimization been implemented ?

I’d like to bump this too. I have 8 templates with 16 bindings total, calling this expression function 2-8 times each. There’s a lot of CPU activity related to our corporate anti-virus software (Trend Micro) associated with it, and doubling the number of components with it basically freezes the system entirely. I think the performance has suddenly degenerated in the last couple of days, and I’m not sure why. It didn’t correspond to an Ignition update.

What Ignition version are you using? The OP and all replies to date have been 7.9.x

7.9 is now EOL and if possible you should be upgrading to 8.1.x

I discovered the issue with 8.1.17 and upgraded to 8.1.18 with no improvement. My current work-around is to just use other methods to determine if a tag is in an alarm state, although I’ve got a support request in the pipeline as well.