# Create xml file when alarm happens

**URL:** <https://forum.inductiveautomation.com/t/create-xml-file-when-alarm-happens/6905>\
**Category:** General Discussion\
**Created:** [July 22, 2013, 4:33pm UTC](https://forum.inductiveautomation.com/t/create-xml-file-when-alarm-happens/6905 "2013-07-22T16:33:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sfp\_it](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sfp\_it](https://forum.inductiveautomation.com/u/sfp_it)\
**Post date:** [July 22, 2013, 4:33pm UTC](https://forum.inductiveautomation.com/t/create-xml-file-when-alarm-happens/6905/1 "2013-07-22T16:33:51Z")

</div>

I apologize if there is an already documented way to do what I am asking, but I work in a different department than the one that maintains the Ignition SCADA software and am not very familiar with the software. I have been given a project that has a requirement of sending an SMS message when a particular alarm condition happens in the SCADA software. The tricky part is that the SCADA software is on a network with no connection to the internet and I am not allowed to connect any celluar modems to send out text messages. Which means I can not use the already created SMS modules that the system has.

So what I would like to know is can I have the Ignition software create an xml file when my alarm condition happens? It would be great if I could include a timestamp and a data point.

I have a way that I can take the xml file and ultimately transmit it to an internet connected machine that could then send the text message. Thank you in advance.

-Kyle

---

<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:** [July 22, 2013, 6:24pm UTC](https://forum.inductiveautomation.com/t/create-xml-file-when-alarm-happens/6905/2 "2013-07-22T18:24:36Z")

</div>

I think the most appropriate (and maybe the only?) way to do this is to write a custom module using the Ignition SDK. Unfortunately that requires quite a bit of software development (and preferably, experience with Java) chops, so unless you or someone at your disposal has those skills it might not be an option…

I’ll ask around and see if anyone has a better/alternate suggestion… if someone else on the forum has any ideas feel free to chime in ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [July 22, 2013, 6:47pm UTC](https://forum.inductiveautomation.com/t/create-xml-file-when-alarm-happens/6905/3 "2013-07-22T18:47:13Z")

</div>

Create a module in python. Simple example - [http://stackoverflow.com/questions/3605680/creating-a-simple-xml-file-using-python](http://stackoverflow.com/questions/3605680/creating-a-simple-xml-file-using-python)

---

<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:** [July 22, 2013, 7:11pm UTC](https://forum.inductiveautomation.com/t/create-xml-file-when-alarm-happens/6905/4 "2013-07-22T19:11:39Z")

</div>

Sure, that’ll get him an XML file, but there’s no easy way I can see (from scripting) to hook into the AlarmManager and get notified whenever an AlarmEvent occurs in the first place.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [July 23, 2013, 1:56pm UTC](https://forum.inductiveautomation.com/t/create-xml-file-when-alarm-happens/6905/5 "2013-07-23T13:56:15Z")

</div>

You could run a script on a timer to check for new alarms -

```auto
numberOfAlarms = len(system.alarm.queryStatus(path=['*/*'])
```

Anytime numberOfAlarms increases, you have a new alarm, I would then probably query the Alarm Journal to determine what the new alarm was.

---

<div class="post-metadata">

**Author:** ![sfp\_it](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sfp\_it](https://forum.inductiveautomation.com/u/sfp_it)\
**Post date:** [July 23, 2013, 2:01pm UTC](https://forum.inductiveautomation.com/t/create-xml-file-when-alarm-happens/6905/6 "2013-07-23T14:01:12Z")

</div>

I think what I may do is write my own simple smtp server and use the Alert email notification functionality to send out an email when the alert happens. Then when my program receives an email have it parse out the text I want into an xml file.

So Ignition is sending a simple smtp email correct?

---

<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:** [July 23, 2013, 2:57pm UTC](https://forum.inductiveautomation.com/t/create-xml-file-when-alarm-happens/6905/7 "2013-07-23T14:57:28Z")

</div>

[quote=“sfp\_it”]I think what I may do is write my own simple smtp server and use the Alert email notification functionality to send out an email when the alert happens. Then when my program receives an email have it parse out the text I want into an xml file.

So Ignition is sending a simple smtp email correct?[/quote]

Sure, with the email notification profile.
