# Complex alarm trigger

**URL:** <https://forum.inductiveautomation.com/t/complex-alarm-trigger/100658>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 9, 2025, 2:34pm UTC](https://forum.inductiveautomation.com/t/complex-alarm-trigger/100658 "2025-01-09T14:34:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![liam1](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@liam1](https://forum.inductiveautomation.com/u/liam1)\
**Post date:** [January 9, 2025, 2:34pm UTC](https://forum.inductiveautomation.com/t/complex-alarm-trigger/100658/1 "2025-01-09T14:34:12Z")

</div>

Hi all,

I want to setup an alarm that will trigger when a process value has been out of range accumulatively for more than a set percentage of an hour. Note the hour window is also moving

Here is an example

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/a/4a6d567f5e1004d7a87a2d46cfc28d8d90cb680c.png)

What would be the simplest way of implementing this?

Thanks,

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 9, 2025, 2:42pm UTC](https://forum.inductiveautomation.com/t/complex-alarm-trigger/100658/2 "2025-01-09T14:42:24Z")

</div>

Sounds like you need to historize this tag and run a tag history query to get your accumulation.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 9, 2025, 2:45pm UTC](https://forum.inductiveautomation.com/t/complex-alarm-trigger/100658/3 "2025-01-09T14:45:11Z")

</div>

Yeah, I don't think there is any "simple" way to do this.

Maybe:

- create a boolean expression tag that is true when the process value is \>= limit, false otherwise
- historize this expression tag
- periodically (timer script?) run a tag history query on this tag, using aggregation mode duration on (or duration off if you flip the logic)
- if the duration on \> 40% of an hour, set another boolean memory tag on which you've defined an alarm

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 9, 2025, 2:49pm UTC](https://forum.inductiveautomation.com/t/complex-alarm-trigger/100658/4 "2025-01-09T14:49:44Z")

</div>

He might can combine the alarm boolean expression with a transaction group hour meter?  
[Hour and Event Meters | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/sql-bridge-transaction-groups/hour-and-event-meters)
