# Edit alarm property in multiple byte tags

**URL:** <https://forum.inductiveautomation.com/t/edit-alarm-property-in-multiple-byte-tags/27700>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [August 23, 2019, 8:44am UTC](https://forum.inductiveautomation.com/t/edit-alarm-property-in-multiple-byte-tags/27700 "2019-08-23T08:44:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [August 23, 2019, 8:44am UTC](https://forum.inductiveautomation.com/t/edit-alarm-property-in-multiple-byte-tags/27700/1 "2019-08-23T08:44:04Z")

</div>

I have around 200 byte tags with alarms defined for each bit in that byte. That 1600 alarms.  
What I need to do is change the priority property from 1-Low to 2-Medium on all alarms, which name includes a word “ERROR”.  
Here is one byte:

```auto
   <Tag name="MB590" path="Napake2" type="OPC">
      <Property name="Value">0</Property>
      <Property name="DataType">1</Property>
      <Property name="OPCServer">Ignition OPC-UA Server</Property>
      <Property name="OPCItemPath">[DKC_Bulky1]MB590</Property>
      <Property name="ScanClass">Alarms_1s</Property>
      <Property name="SourceDataType">0</Property>
      <Alarms>
         <Alarm name="ERROR STRAPPING MACHINE 2235 -R2235 (M590.6)">
            <Property name="mode">9</Property>
            <Property name="bitPosition">6</Property>
            <Property name="displayPath">R2235</Property>
            <Property name="ackMode">1</Property>
         </Alarm>
         <Alarm name="COMMUNICATION WITH MFCS SWITCHED OFF -BULKY (M590.4)">
            <Property name="mode">9</Property>
            <Property name="bitPosition">4</Property>
            <Property name="displayPath">BULKY</Property>
            <Property name="ackMode">1</Property>
         </Alarm>
         <Alarm name="CONVERT ERROR INTEGER TO S5 TIME -BULKY (M590.5)">
            <Property name="mode">9</Property>
            <Property name="bitPosition">5</Property>
            <Property name="displayPath">BULKY</Property>
            <Property name="ackMode">1</Property>
         </Alarm>
         <Alarm name="FIFO STORAGE FULL -BULKY (M590.3)">
            <Property name="mode">9</Property>
            <Property name="bitPosition">3</Property>
            <Property name="displayPath">BULKY</Property>
            <Property name="ackMode">1</Property>
         </Alarm>
         <Alarm name="POWER OFF (MAIN CABINET) -BULKY (M590.0)">
            <Property name="mode">9</Property>
            <Property name="displayPath">BULKY</Property>
            <Property name="ackMode">1</Property>
         </Alarm>
         <Alarm name="RESERVE -BULKY (M590.2)">
            <Property name="mode">9</Property>
            <Property name="bitPosition">2</Property>
            <Property name="displayPath">BULKY</Property>
            <Property name="ackMode">1</Property>
         </Alarm>
         <Alarm name="ERROR STRAPPING MACHINE 2507 -C2507 (M590.7)">
            <Property name="mode">9</Property>
            <Property name="bitPosition">7</Property>
            <Property name="displayPath">C2507</Property>
            <Property name="ackMode">1</Property>
         </Alarm>
         <Alarm name="TWO SYSTEM PALLETS WITH THE SAME BARCODE - BULKY (M590.1)">
            <Property name="mode">9</Property>
            <Property name="bitPosition">1</Property>
            <Property name="displayPath">BULKY</Property>
            <Property name="ackMode">1</Property>
         </Alarm>
      </Alarms>
   </Tag>

```

The priority property is not shown in the exported xml, if the priority is left on 1-Low, which is default, when you create an alarm.  
I know about [system.tag.editAlarmConfig](https://docs.inductiveautomation.com/display/DOC79/system.tag.editAlarmConfig) but I failed to see, how to do it on multiple tags with multiple alarms…

 ![alarms_byteTag](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/75117d2ea6ef55ba9048dfb68e0fc67da3161281.png)

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [August 23, 2019, 10:41am UTC](https://forum.inductiveautomation.com/t/edit-alarm-property-in-multiple-byte-tags/27700/2 "2019-08-23T10:41:26Z")

</div>

Well, it happened again…  
5 minutes after I posted this post it came to me… 🙄  
This is what I came up with:

```auto
tagConfig = system.tag.browseConfiguration('DKCBulky1/AlarmsTest', False)
x=1
alarmConfig = {}
# Iterate through the configuration data
for tag in tagConfig:
    tagFullPath = tag.getFullPath()
    alarmList = tag.getAlarms()
    for alarm in alarmList:
    	alarmname = alarm.name
    	containError = alarmname.find('ERROR')
    	if containError>-1:
    		tagPaths = [tagFullPath]
    		alarmConfigKeyValuePair = {alarmname:[["priority","Value","Medium"]]}
    		alarmConfig.update(alarmConfigKeyValuePair) #add new KeyValue pair
    		x+=1
    print "alarmConfig= ", alarmConfig
    print "x= ", x
    system.tag.editAlarmConfig(tagPaths, alarmConfig)
    alarmConfig = {}

```

I run this in Script Console and all 1600 alarms are done in 5 seconds… 😱
