# Script for adding tag alarm

**URL:** <https://forum.inductiveautomation.com/t/script-for-adding-tag-alarm/94639>\
**Category:** Ignition\
**Created:** [August 14, 2024, 11:40am UTC](https://forum.inductiveautomation.com/t/script-for-adding-tag-alarm/94639 "2024-08-14T11:40:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Filarm27](https://avatars.discourse-cdn.com/v4/letter/f/b9bd4f/32.png) [@Filarm27](https://forum.inductiveautomation.com/u/Filarm27)\
**Post date:** [August 14, 2024, 2:37pm UTC](https://forum.inductiveautomation.com/t/script-for-adding-tag-alarm/94639/3 "2024-08-14T14:37:20Z")

</div>

Yes I saw. And through the following script I get to create an OPC boolean tag from scratch.

```python
# The provider and folder the Tag will be placed at. 
baseTagPath = "[default]MyPath"
 
# Properties that will be configured on that Tag.
name = "BitAlarm_00_"
opcItemPath = "nsu=KEPServerEX;s=DR_1.CH_1.Allarmi[x].Allarmi[00].BitAlarm[x].BitAlarm[00]"
opcServer = "KEPServerEX"
valueSource = "opc"
dataType = "Boolean"
 
alarms = [
            {
                "name": "Alarm_0_1.",               
                "priority": "High",               
                "setpointA": 1,
                "label": "Example",
                "displayPath": "12345",
                "shelvingAllowed": False
                
            }
        ]
        
       
# Configure the tag.
tag = [
		{
            "name": name,         
            "opcItemPath" : opcItemPath,
            "opcServer": opcServer,
            "valueSource": valueSource,
            "dataType": dataType,
            "alarms": alarms
        }
    ]
 
 
# Set the collision policy to Abort. Thus, if a Tag already exists at the base path,
# we will not override the Tag. If you are overwriting an existing Tag, then set this to "o".
collisionPolicy = "o"
 
# Create the Tag.
system.tag.configure(baseTagPath, tag, collisionPolicy)

```

My situation however is the following: I import the tags directly by importing them from KepServerEx, then it creates the variable tree with folders and subfolders of the various alarm tags.  
From this situation I would like to alarm the various tags to be able to configure them. The problem is that I cannot add the alarm via script.

---

_[View the full topic](https://forum.inductiveautomation.com/t/script-for-adding-tag-alarm/94639)._
