It’s not. Or rather, it’s in Ignition’s internal DB, not any DB connection. The supported way to get comprehensive information about tags would be to export the entire tag hierarchy as XML. From the designer’s tag browser.
Its not easy to get. You could export as @pturmel said, however if you use any bindings for priority, enabled etc - they will not be evaluated. I’ve been trying to do something like this for a while and unfortunately haven’t found something reliable that will find all alarms, enabled or not, and will give their evaluated statuses.
seems like you could use a combination of the browseTags and getAlarmStates functions to accomplish what you want. But like what was said already, if you have a binding on your priority, that will be an issue.
Here is a start for you…
tags = system.tag.browseTagsSimple("5000-003","ASC")
for tag in tags:
tagDefs = system.tag.getAlarmStates(tag.path)
for tagDef in tagDefs:
for prop in tagDef.getAlarmProperties():
if prop.property == 'priority':
print tag.path, tagDef.alarm, prop.value
Thanks for the answers. I did try a tag export but did not see a field which would denote an alarm is set on the tag. Rather, I see a complete tag listing. How would I filter this so I can work with just tags with alarms?
Thanks again. I do get output this way but don’t see anything which would denote the priority field. We’re trying to make better use of the priorities for report and messaging purposes, and it would be of great help to see what tags are alarmed and if alarmed…what priority they might be…
Is this something I should be perhaps contact support about?
I have around 2,400 tags…although many of them are not alarmed. I’ll look through the literature (with your suggestion) and work through it. I’m also planning on speaking with support to perhaps find the ‘best’ way to do this.
For everyone’s future reference, I worked with Kevin at Inductive and we (he) came up with this script which does what I asked. Simply replace the sample file path with your own. This script outputs a CSV file.
Many thanks for all the help here…much appreciated!!
import xml.etree.ElementTree as ET
def DFS(root, tagpath):
if 'path' in root.attrib and 'name' in root.attrib:
name = root.attrib['name']
path = root.attrib['path']
if path != "": tagpath += path + '/'
if name != "": tagpath += name + '/'
for child in root:
elif root.tag == "Alarms":
for alarm in root:
alarmName = alarm.attrib['name']
alarmPriority = 1
# If the alarm doesn't have a priority property,
# it's implied to have an priority of 1
for prop in alarm:
if prop.attrib['name'] == 'priority':
alarmPriority = int(prop.text)
data.append([tagpath, alarmName, alarmPriority])
for child in root:
filepath = r"**C:\Users\sample_user\Documents\tags_all.xml**"
tree = ET.parse(filepath)
root = tree.getroot()
header = ['tag Path', 'alarm', 'priority']
data = 
dataset = system.dataset.toDataSet(header, data)
system.dataset.exportCSV('alarm priorities.csv', 1, dataset)
I’m trying to run this on a tag export from a 8.04 system. The script runs and creates the xml file but it is empty with the exception of the header columns. I see in the export that the “Alarms” property is listed as a Compound Property. Is this causing my empty file perhaps?
It can, but you'll need to modify it a bit:
Instead of exporting to an xml, you can use system.tag.getConfiguration. Pass it recursive=True if you have folders or UDTs.
Note that you can use getConfiguration on UDTs as well: system.tag.getConfiguration("[provider]_types_")
Then, instead of exporting the dataset to a CSV, send it to your table.
Or bind the whole thing to the table, which should also work.
This is all assuming the script works as expected, I didn't go into its details.
If you're having trouble with it, I'll take a closer look.