# Creating Multiple Alarms

**URL:** <https://forum.inductiveautomation.com/t/creating-multiple-alarms/16373>\
**Category:** Ignition\
**Created:** [December 20, 2017, 10:15am UTC](https://forum.inductiveautomation.com/t/creating-multiple-alarms/16373 "2017-12-20T10:15:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![c.bertulli](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@c.bertulli](https://forum.inductiveautomation.com/u/c.bertulli)\
**Post date:** [December 20, 2017, 10:15am UTC](https://forum.inductiveautomation.com/t/creating-multiple-alarms/16373/1 "2017-12-20T10:15:23Z")

</div>

Hello,  
Is there an easy way to create multiple tags with an associated alarm? I’ve thought at 3 possible ways:

1. Do it one at the time:  
Handly create a tag and set the alarm, but if I have to create 200 alarms it will be an insane waste of time.
2. Export in an .xml file:  
I can create a tag as I want, then export it in an .xml file ( only .xml because the .csv does not support the alarm properties),  
open it with Notepad++, copy / paste the “code” and manually modify the right line. Even this will be an insane waste of time.
3. Scripting:  
I can create a DB table with x column where x is the number of dynamic properties I need. ( for example: Tag\_Name, OPC\_Path, Alarm\_Name, and so on ) Create a script where I do a SELECT query for read all the data and put them into List ( one List for every column), use the function system.tag.addTag(“the right configuration”)giving it the Lists as a dynamic array and finally put all of this inside a loop. Well, I found this very obsolete for being in 2017 ( almost 2018 ).

---

<div class="post-metadata">

**Author:** ![WildeKurt](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@WildeKurt](https://forum.inductiveautomation.com/u/WildeKurt)\
**Post date:** [January 2, 2018, 2:23pm UTC](https://forum.inductiveautomation.com/t/creating-multiple-alarms/16373/2 "2018-01-02T14:23:11Z")

</div>

I often import tags from a csv to do large tag creations. I set up a spreadsheet with the columns I need (tag name, parent path, tag and data type, etc) and any tag attributes (Tooltip, EngUnit, etc) then write some scripts to import the csv and create the tags. It’s a pretty straight forward process. Here’s a bit of sample code without alarms.

```auto
import csv

# imports from csv with columns Tag Name,Address,Data Type,Tooltip,Documentation

pp = '[default]Some Machine' 
tagType = "OPC"
attributes = {}
attributes["OPCServer"] = "Ignition OPC-UA Server"

filepath = system.file.openFile('csv')
if filepath is not None:
	inData = csv.reader(open(filepath))
	pDs = [x for x in inData]
	for i in range(1,len(pDs)):
		if i &gt; 0:					
			tagName = pDs[i][0]
			attributes["OPCItemPath"] = "[Mahine1]" + pDs[i][1]
			dataType = pDs[i][2]
			attributes["Tooltip"] = pDs[i][3]
			attributes["Documentation"] = pDs[i][4]
			system.tag.addTag(parentPath=pp,name=tagName,tagType=tagType,dataType=dataType,attributes=attributes)

```

---

<div class="post-metadata">

**Author:** ![c.bertulli](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@c.bertulli](https://forum.inductiveautomation.com/u/c.bertulli)\
**Post date:** [January 3, 2018, 6:37pm UTC](https://forum.inductiveautomation.com/t/creating-multiple-alarms/16373/3 "2018-01-03T18:37:50Z")

</div>

> [@c.bertulli](#):
>
> only .xml because the .csv does not support the alarm properties),

Thanks a lot for your help WildeKurt, but I need to create lots of tag with the associated alarms property and this is not possible with the .csv format ( this is what Ignition wrote on their Manual )

---

<div class="post-metadata">

**Author:** ![WildeKurt](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@WildeKurt](https://forum.inductiveautomation.com/u/WildeKurt)\
**Post date:** [January 3, 2018, 10:16pm UTC](https://forum.inductiveautomation.com/t/creating-multiple-alarms/16373/4 "2018-01-03T22:16:40Z")

</div>

To do a direct import you can’t use a csv but you can set alarm properties through scripting. See system.tag.addTag or system.tag.editTag and system.tag.editAlarmConfig in the docs.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [January 4, 2018, 6:54am UTC](https://forum.inductiveautomation.com/t/creating-multiple-alarms/16373/5 "2018-01-04T06:54:29Z")

</div>

Why don’t you define the alarm on an UDT, and import the tags as UDT members? We always import a list of our devices and have alarms defined on them through UDTs.
