# Display Low priority Alarm on power table through Python script

**URL:** <https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126>\
**Category:** Ignition\
**Tags:** ignition81, python, vision, scripting\
**Created:** [February 10, 2025, 8:42pm UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126 "2025-02-10T20:42:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ganesan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Ganesan](https://forum.inductiveautomation.com/u/Ganesan)\
**Post date:** [February 10, 2025, 8:42pm UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/1 "2025-02-10T20:42:22Z")

</div>

Hello Forum Members,

I would like to display only low priority alarms when they are active. My requirements are as follows: I need to implement this requirement for only a few tags.

1. The power table will be invisible until the low alarm is active.

2. The power table will be visible when the low priority alarm is active, and the background colour must be yellow.

3. The power table will be placed on the overview screen. If I press the active alarm, it will take it to the respective screen where the alarm is active.

Your suggestions and feedback are greatly appreciated.

Thank you

---

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [February 10, 2025, 9:03pm UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/2 "2025-02-10T21:03:42Z")

</div>

If you're looking for someone to do the work for you, I'd recommend one of the many Ignition integrators on the IA website:  
[System Integrator Search | Find an Ignition Integrator](https://inductiveautomation.com/integrators)

If you're asking for help with a project you're working on, it helps to add screenshots and code snippets of what you've tried already.  
[Wiki - how to post code on this forum - General Discussion - Inductive Automation Forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831)

---

<div class="post-metadata">

**Author:** ![Ganesan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Ganesan](https://forum.inductiveautomation.com/u/Ganesan)\
**Post date:** [February 12, 2025, 7:50pm UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/3 "2025-02-12T19:50:16Z")

</div>

Dear All,  
I am encountering an issue while testing the following script:

a) I have a master tag list . I am attempting to move this list to another list called “final list” with an additional column named “Active.” The final header should be [‘TagName’, ‘Active’].  
However, I am receiving an error message indicating that “IndexError: Row 0 does not have the same number of columns as the header list.”

b) I have successfully read the tag, but it only returns the value “BTestTempTag.” I am attempting to loop through all the tags and assign the alarm status to the “Active” column.

Any suggestion much appreciated.

Thanks in Advance

 ![Screenshot 2025-02-12 at 19.11.35](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/c/1c0e2d911a689de7cd2781430b40c5609278766f.jpeg)  
 ![Screenshot 2025-02-12 at 19.20.26](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/5/95dcb13bdfb8b304724a0870f876cab78f80af9a.png)

```python
masterData = event.source.parent.getComponent('masterData').data	
testHeaders = ['TagName', 'Active']
testData = []
	
for row in xrange(masterData.rowCount):
		testData.append([masterData.getValueAt(row, column) for column in xrange(masterData.columnCount)])
		#testData.append([masterData.getValueAt(row, 0)]) #for column in xrange(masterData.columnCount)])
event.source.parent.getComponent('finalData').data = system.dataset.toDataSet(testHeaders, testData)

tagPath = finalData.getValueAt(row, 0)
configTagPath = tagPath+"/ATestMem/A/Alarms/Test Alarm A.IsActive"
configValue=system.tag.readBlocking(configTagPath)
alarmstate = configValue[0].value
print alarmstate

```

---

<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:** [February 12, 2025, 7:58pm UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/4 "2025-02-12T19:58:32Z")

</div>

Perhaps use `system.alarm.queryStatus` and filter based on a tag list?

> **[system.alarm.queryStatus | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-alarm/system-alarm-queryStatus)**
>
> Queries the current state of alarms. The result is a list of alarm events, which can be queried for individual properties.

---

<div class="post-metadata">

**Author:** ![Ganesan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Ganesan](https://forum.inductiveautomation.com/u/Ganesan)\
**Post date:** [February 12, 2025, 9:03pm UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/5 "2025-02-12T21:03:56Z")

</div>

Sure thing! I’ll give it a shot and see if I can figure out how to check the alarm query status.

thank you.

---

<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:** [February 13, 2025, 1:45am UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/6 "2025-02-13T01:45:11Z")

</div>

Careful with calling `queryStatus` from Vision though as it can cause client lag due to it running in the EDT and needing a response from the gateway. Even a few of these calls running in the client can cause operator hair loss or cracks to appear "mysteriously" in your client monitors

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 13, 2025, 2:13am UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/7 "2025-02-13T02:13:28Z")

</div>

> [@nminchin](#):
>
> due to it running in the EDT

Well, you can also run it **not** on the EDT, and then it is much less trouble.

---

<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:** [February 13, 2025, 3:59am UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/8 "2025-02-13T03:59:55Z")

</div>

With 8.3, hopefully you won't have to do _anything_ yourself to get it 🙂

---

<div class="post-metadata">

**Author:** ![Ganesan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Ganesan](https://forum.inductiveautomation.com/u/Ganesan)\
**Post date:** [February 13, 2025, 5:45am UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/9 "2025-02-13T05:45:12Z")

</div>

Hello!

I attempted to use the “system.alarm.queryStatus” function, but it returned all tags, including those from other sites. I do not want to disrupt the Gateway.

Therefore, I have written the following script, which is not working as expected. Could someone please check how to achieve this?

```python
masterData = event.source.parent.getComponent('masterData').data
testData = []
finalHeaders = ['status' , 'TagName']

for row in xrange(masterData.rowCount):
		testData.append([masterData.getValueAt(row, column) for column in xrange(masterData.columnCount)])
		#print testData
		tagPath = masterData.getValueAt(row, 0)
		print tagPath
		configTagPath = tagPath+"/ATestMem/A/Alarms.ActiveUnackCount"
		print configTagPath
		configValue=system.tag.readBlocking(configTagPath)
		#print configValue
		alarmstate = configValue[0].value
		#print alarmstate
		
		mastertagPath = [(tagName) for tagName in tagPath[0:].split(',')]
		#print mastertagPath
		data = [[i, tagPath] for i, (tagPath) in enumerate(mastertagPath)]
		options = system.dataset.toDataSet(finalHeaders, data)
		event.source.parent.getComponent('finalData').data = options

```

 ![Screenshot 2025-02-13 at 17.21.07](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/51f77723a1eb40a317e20e437bee24ac976d9d89.jpeg)

---

<div class="post-metadata">

**Author:** ![Ganesan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Ganesan](https://forum.inductiveautomation.com/u/Ganesan)\
**Post date:** [February 15, 2025, 12:29pm UTC](https://forum.inductiveautomation.com/t/display-low-priority-alarm-on-power-table-through-python-script/102126/10 "2025-02-15T12:29:15Z")

</div>

Hello All,

I have successfully identified the tags with active alarms. I am currently attempting to retrieve data from the source table to Power table(finalData). My focus is on extracting the source and event time data. Is there a way to accomplish this one please?

Thank you.

```python
state = ["ActiveUnacked", "ActiveAcked"]
source = ["*PLC1000*", "*PLC2000*", "*PLC3000*", "*PLC4000*", "*PLC5000*", "*PLC6000*"]
table = event.source.parent.getComponent("Table")
results = system.alarm.queryStatus(source = source, state = state) 
table.data = results.getDataset()
event.source.parent.getComponent('masterData').data= table.data

```

 ![Screenshot 2025-02-15 at 12.15.37](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/b/fb9cd503b525e9e75f7bd9ff7ca3dad434fbb5fb.jpeg)
