# Looking for efficient solution for generating alarms from a PLC alarms buffer

**URL:** <https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [July 24, 2023, 7:58am UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766 "2023-07-24T07:58:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptharin](https://avatars.discourse-cdn.com/v4/letter/p/6a8cbe/32.png) [@ptharin](https://forum.inductiveautomation.com/u/ptharin)\
**Post date:** [July 24, 2023, 7:58am UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766/1 "2023-07-24T07:58:37Z")

</div>

I have a PLC program that provides an alarm buffer. This buffer contains a maximum of 30 alarms. An alarm is activated by writing 3 values to a location in the buffer along with a short optional text (10 chars). The combination of these three values gives a single value which corresponds to one of the \>1000 possible alarms. I already have an idea how to do this, but there may be a more efficient way of doing it. Any suggestion ?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 24, 2023, 8:10am UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766/2 "2023-07-24T08:10:02Z")

</div>

> [@ptharin](#):
>
> I already have an idea how to do this,

what idea?

---

<div class="post-metadata">

**Author:** ![ptharin](https://avatars.discourse-cdn.com/v4/letter/p/6a8cbe/32.png) [@ptharin](https://forum.inductiveautomation.com/u/ptharin)\
**Post date:** [July 24, 2023, 8:37am UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766/3 "2023-07-24T08:37:20Z")

</div>

The idea is to have the structured tag and generate an alarm when the one of the 3 values is not null and get the alarm info from a database using the 3 values (= alarme unique code).  
Any better idea ?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 24, 2023, 9:28am UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766/4 "2023-07-24T09:28:58Z")

</div>

Your approach is reasonable, but keep in mind that PLC polling doesn't not guarantee that the three elements of a single alarm will be consistent. That is, the PLC could be changing them at the same time Ignition is reading them, and you get a mix of old and new values. The simplest way to handle that is to use Ignition's delay feature for alarms to wait one polling cycle before acting.

---

<div class="post-metadata">

**Author:** ![kyler.kamyszek](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kyler.kamyszek](https://forum.inductiveautomation.com/u/kyler.kamyszek)\
**Post date:** [July 24, 2023, 1:12pm UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766/5 "2023-07-24T13:12:51Z")

</div>

You're going to have a hard time with the alarms being active/ack'd/cleared on Ignition when that buffer starts rolling through the alarms.

Couldn't you just monitor the tags that send the 'alarms' to your buffer? I assume that buffer is probably just used for an HMI function. Ignition doesn't really have those limitations and could handle the 1000+ alarms all at once.

---

<div class="post-metadata">

**Author:** ![ptharin](https://avatars.discourse-cdn.com/v4/letter/p/6a8cbe/32.png) [@ptharin](https://forum.inductiveautomation.com/u/ptharin)\
**Post date:** [July 24, 2023, 2:20pm UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766/6 "2023-07-24T14:20:18Z")

</div>

I know it's not a very logical way to do it, but the alarms are directly written in the buffer by the PLC software, which is already done and was supposed to be connected to a custom HMI. We don't want to modify the PLC software. I should have mentionned that the buffer is just an array of 30 alarms which means also only 30 alarms can be monitored at the same time. A new alarm is not shown until a buffer position get free (alarm buffer full is the last shown alarm).

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [July 24, 2023, 3:09pm UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766/7 "2023-07-24T15:09:03Z")

</div>

What happens if you have 31 alarms going off? Is the 31st alarm just lost?

---

<div class="post-metadata">

**Author:** ![ptharin](https://avatars.discourse-cdn.com/v4/letter/p/6a8cbe/32.png) [@ptharin](https://forum.inductiveautomation.com/u/ptharin)\
**Post date:** [July 24, 2023, 3:39pm UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766/8 "2023-07-24T15:39:13Z")

</div>

No, it's not lost, it will be displayed when a position of the buffer get free. That means we can show only the first 30 alarms, not the last 30.

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [July 24, 2023, 4:24pm UTC](https://forum.inductiveautomation.com/t/looking-for-efficient-solution-for-generating-alarms-from-a-plc-alarms-buffer/76766/9 "2023-07-24T16:24:56Z")

</div>

I am trying to clarify how the alarm gets reset. If you show alarms 1-30 and then show alarm 31 after a few seconds you need a way to identify when the alarm has been cleared. If you consider the only active alarms are what is shown in the buffer then I think you had the right idea.
