# Alarms missed events

**URL:** <https://forum.inductiveautomation.com/t/alarms-missed-events/15509>\
**Category:** General Discussion\
**Created:** [September 29, 2017, 10:07am UTC](https://forum.inductiveautomation.com/t/alarms-missed-events/15509 "2017-09-29T10:07:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 29, 2017, 10:07am UTC](https://forum.inductiveautomation.com/t/alarms-missed-events/15509/1 "2017-09-29T10:07:31Z")

</div>

I need to send an email for each and every alarm that fires in the software and I’m facing an issue of **alarms missed events** in the **Alarm Active** tag alarm event. My tag is a 16 bits SHORT tag. On that tag I’ve defined 16 **Bit state** alarms, one for each bit. I then programmed the **Alarm Active** tag event like this:

```auto
	if missedEvents:
		print "ALARMS MISSED EVENTS"
	shared.alarms.sendEmail("Allarmi produzione",alarmEvent.displayPath)

```

where the **sendEmail** function is:

```auto
def sendEmail(subject,body):
	print "MAIL ALLARMI: ",str(body)
	system.net.sendEmail(
		"%s:%d" % (smtpServerAddress,smtpServerPort)
		,mailAccountOwner
		,subject
		,str(body)
		,False
		,mailAddressTo
		,None
		,None
		,60000*5
		,mailAccountOwner
		,mailAccountPassword
		)

```

If I set the tag value to 32767 to fire 14 alarms all together, what I read in the wrapper log is:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d94719e02078b90be1a69681ea5788c2ad9e15f5.png)  
i.e. only 5 alarms out of 14 get notified and the MISSED EVENTS warning gets printed.  
Any suggestion to get all alarms notified? Should I split the tag into 16 boolean tags and apply the notification function to each of them?

Thanks in advance, regards

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 29, 2017, 3:22pm UTC](https://forum.inductiveautomation.com/t/alarms-missed-events/15509/2 "2017-09-29T15:22:59Z")

</div>

> Any suggestion to get all alarms notified?

Is there a reason you're not using the alarm notification built into Ignition directly? I just ran a test, and got 15 alarms just as expected. Pipelines are definitely the best option here, because tag event scripts have a limited pool to run in and can block each other (hence, the `missedEvents` flag in the first place).

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 29, 2017, 7:47pm UTC](https://forum.inductiveautomation.com/t/alarms-missed-events/15509/3 "2017-09-29T19:47:03Z")

</div>

Hallo PGriffith, thanks for your answer. Main reason is that **system.net.sendEmail** comes with the base package, whereas the module you suggest me has a cost and the budget is limited.  
But my question is more general perhaps, than sending an email notification of an alarm, i.e. it sounds like this: as far as the experience I did, we cannot be sure that the **Alarm Active** event fires for each and every alarm, if there are many simultaneous alarms, can we? So it is unreliable, isn’t it? Or is there a parameter which configures Ignition, so that we can always trust that the event fires? I tried also with **invokeAsynchronous** but with no benefit at all.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [September 30, 2017, 7:04am UTC](https://forum.inductiveautomation.com/t/alarms-missed-events/15509/4 "2017-09-30T07:04:20Z")

</div>

This is how I’m using to send emails for alarms and is working great:

This are my alarms:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a7a440ed093f49bf9504d8896ab20ae13afe614a.PNG)

This is my Tag Events:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6ceb4af3d12f973f447efcbe5e10a3505c93a72e.PNG)

This is my shared script:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6eaba1ed873d1395b26e83e9ed6485bc3479f36e.PNG)

And this is my SMTP profile in Ignition:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5e2ce604fa0524cc9e0f3ff3a049315b131845d2.PNG)

And this are my modules in Ignition (it’s limited to 3 clients and 500 tags):

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d1f0369abb1cb90a8ae6617fa8d09337534e61b1.PNG)

And I always get all alarms, either is only one alarm active or all eight in one byte…

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 30, 2017, 7:46am UTC](https://forum.inductiveautomation.com/t/alarms-missed-events/15509/5 "2017-09-30T07:46:09Z")

</div>

Thanks Zxcslo, it seems you have just the same configuration as me. One question: have you ever tried to put the tag value from 0 to 255 with the tag browser or a `system.tag.write` in a button script so to activate all alarms at the same time? May be you should also add an `if` branch like this in your `Alarm Active` event script:

```auto
if missedEvents:
  print "MISSED ALARMS EVENTS"

```

so that it’s easier to catch a missed events issue in the **wrapper.log** file.

Regards

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [September 30, 2017, 8:10am UTC](https://forum.inductiveautomation.com/t/alarms-missed-events/15509/6 "2017-09-30T08:10:23Z")

</div>

When I was testing it, that’s the only way to set multiple alarms. So yes, I was putting 255 to the tag and got all 8 alarms…

Thanks for the ‘missedEvents’ tip… I’ll implement it right away… 👍
