# Generate a list of alarm display paths in project?

**URL:** <https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103>\
**Category:** Ignition\
**Created:** [July 8, 2023, 10:38pm UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103 "2023-07-08T22:38:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tACO](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@tACO](https://forum.inductiveautomation.com/u/tACO)\
**Post date:** [July 8, 2023, 10:38pm UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103/1 "2023-07-08T22:38:55Z")

</div>

Ignition newbie here, so sorry if this is obvious.

I'd like a list of alarms that the project can generate.

Is there a way to generate a list of display paths in the project?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 8, 2023, 10:57pm UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103/2 "2023-07-08T22:57:43Z")

</div>

The alarm display path property isn't always a reliable property to use as this can be bound and therefore can essentially be used for anything. The source will always contain the tagpath.

While I have used it for this before, you can most likely use the tag report tool to generate the list

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [July 9, 2023, 12:05am UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103/3 "2023-07-09T00:05:37Z")

</div>

[https://docs.inductiveautomation.com/display/DOC81/system.alarm.queryStatus](https://docs.inductiveautomation.com/display/DOC81/system.alarm.queryStatus)

This is the best method I have seen that can return all alarms. One caveat, any indirect values will not update unless the alarm is active. However, you can force this by restarting the tags.

---

<div class="post-metadata">

**Author:** ![tACO](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@tACO](https://forum.inductiveautomation.com/u/tACO)\
**Post date:** [July 9, 2023, 9:22am UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103/4 "2023-07-09T09:22:21Z")

</div>

@ [nminchin](https://forum.inductiveautomation.com/u/nminchin) This is great for seeing the display path with no binding which is very useful for me as I'm working with projects I didn't create.

@ [jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen) This seems like a good solution. But I was wondering if you knew of a way to get a list of just indirect values?

This has been very insightful for me. Thank you both very much!

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [July 9, 2023, 2:54pm UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103/5 "2023-07-09T14:54:05Z")

</div>

I don't know how to get a list of tags that use bindings. Not sure if that's even possible.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 10, 2023, 1:38am UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103/6 "2023-07-10T01:38:28Z")

</div>

I remember there being an issue with using queryStatus - I remember it excluding some tags.

Here's what I use to get a list of all configured alarms and their properties, originally written by @Kyle_Chase

> [@How to Generate a List of all Configured Alarms](https://forum.inductiveautomation.com/t/how-to-generate-a-list-of-all-configured-alarms/36651/6):
>
> Here is what we use. Put this in a project script or on a button, and call getAlarms(rootPath). It will return a list. You will want to run this from the gateway, as it is a recursive browse. Invoke with sendRequest or sendRequestAsync. def getAlarms(tagPath): from com.inductiveautomation.ignition.common.tags.paths.parser import TagPathParser alarms = [] def iterTagConfig(dictIn, folderIn = ''): keys = dictIn.keys() #Move tags and alarms to end of list. I do not recall why, but it…

```auto
"""
Description:
	Finds all alarms within a given tagpath and return a bunch of the alarm properties.
	https://forum.inductiveautomation.com/t/how-to-generate-a-list-of-all-configured-alarms/36651/6?u=nminchin
Revision History:
    Rev Date Author Comment
    1.0 ?? Kyle Chase Original
    1.1 2022-10-21 Nick Minchin Fixed bit in tagpath. Wrote results to clipboard as a CSV
Return:
    CVS to clipboard with alarm tag paths and collection of alarm properties.
"""

path = '[default]Wynns/Winery/Tank Farms/Fermenters/SWAP/Tanks/C168'

def getAlarms(tagPath):	

	from com.inductiveautomation.ignition.common.tags.paths.parser import TagPathParser
	alarms = []
	def iterTagConfig(dictIn, folderIn = ''):
		keys = dictIn.keys()
		#Move tags and alarms to end of list. I do not recall why, but it is really, really important.
		if 'tags' in keys:
			keys.append(keys.pop(keys.index('tags')))
		if 'alarms' in keys:
			keys.append(keys.pop(keys.index('alarms')))
			
		for key in keys:
			#If the value of dictIn[key] is a dict, then it is a folder like structure that has child tags. Iterate through this
			if isinstance(dictIn[key], dict):
				iterTagConfig(dictIn[key])
			elif key == 'tags':
				for tag in dictIn[key]:
					if str(tag["path"]) != "_types_":
						iterTagConfig(tag, folderIn = folderIn + '/' + str(dictIn['path']) + '/' if folderIn else str(dictIn['path']))	  
			elif key == 'alarms':
				#This is what we are looking for. Each tag in this alarm item is an alarm, so we add them to the list. Use qualified tag paths because they are exact, and I hear they make you look cooler.
				for tag in dictIn[key]:
					tp = TagPathParser.parseSafe(folderIn+"/"+str(dictIn['path']) if folderIn else str(dictIn['path']))
					qp = "prov:%s:/tag:%s:/alm:%s"%(tp.source,tp.toStringPartial(),tag["name"])
					p = tag.get('priority', '')
					a = tag.get('activePipeline', '')
					dp = tag.get('displayPath', '')
					label = tag.get('label', '')
					name = tag.get('name', '')
					
					alarms.append([tp, p, a, dp, label, name])
					iterTagConfig(tag,folderIn = folderIn + str(dictIn['path']))	
	if tagPath:
		folder = tagPath
		#Root level browse
		nodes = system.tag.getConfiguration(folder, True)
	
		for item in nodes:
			iterTagConfig(item)
	
	return alarms

csv = '"tagpath","priority","activePipeline","displayPath","label","name"\r\n'
for t in getAlarms(path):
	csv += '"' + '","'.join([str(tt) for tt in t]) + '"\r\n'

```

---

<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:** [July 10, 2023, 1:47am UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103/7 "2023-07-10T01:47:35Z")

</div>

`system.tag.query`/the tag report tool can probably do it as well:  
[https://docs.inductiveautomation.com/display/DOC81/system.tag.query](https://docs.inductiveautomation.com/display/DOC81/system.tag.query)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 10, 2023, 2:01am UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103/8 "2023-07-10T02:01:26Z")

</div>

> [@nminchin](#):
>
> you can most likely use the tag report tool to generate the list

> [@tACO](#):
>
> This is great for seeing the display path with no binding which is very useful for me as I'm working with projects I didn't create.

The tag report tool returns the configuration rather than the evaluated values though which is the problem. Although the script I posted uses getConfiguration as well, so maybe it suffers from the same fate? I don't have time atm to check

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [July 10, 2023, 2:48am UTC](https://forum.inductiveautomation.com/t/generate-a-list-of-alarm-display-paths-in-project/76103/9 "2023-07-10T02:48:51Z")

</div>

> [@nminchin](#):
>
> I remember there being an issue with using queryStatus - I remember it excluding some tags.

I don't see that issue. It's the only option I see that evaluates the values on bindings without writing a bunch of scripting.

Perhaps it excluded tags that hadn't evaluated yet?? I know that is a problem for getting the values, but restarting the tags gets around this hurdle.
