Generate a list of alarm display paths in project?

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?

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

1 Like

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.

1 Like

@ 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 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!

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

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

"""
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'

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

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

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.