Hi swolnisty.
Below are simple scripts that you can use to modify the tag properties using both the system.tag.getConfiguration. Inconjunction with system.tag.configure. The tag I am using is called average_AH. The first thing you will do is read the properties from the tag you are using.
https://docs.inductiveautomation.com/display/DOC80/system.tag.getConfiguration
path = ‘[default]average_AH’
tags = system.tag.getConfiguration(path)
for tagDict in tags:
# Iterate over the dictionary with the iteritems function
for key, value in tagDict.iteritems():
# Do something with the keys and values
print key, ' : ', value
The results will be simillar to the ones below:
tagGroup : Default
dataType : Boolean
alarms : [{u’setpointA’: 1.0, u’priority’: Medium, u’enabled’: False, u’name’: u’Alarm’}]
enabled : True
path : [default]average_AH
tagType : AtomicTag
name : average_AH
accessRights : Read_Write
valueSource : memory
value : True
Then modify the properties to the specific tag you want.
https://docs.inductiveautomation.com/display/DOC80/system.tag.configure.
baseTagPath = “[default]”
average_AH = {
“name”: “average_AH”,
“tagGroup” : “Default Historical”
“valueSource”: “memory”,
“value” : “False”,
“enabled” : “True”
“alarms” : “[{u’setpointA’: 1.0, u’priority’: Medium, u’enabled’: True, u’name’: u’Alarm’}”
}
tagList = [average_AH]
Set the collision policy. If editing existing tags, then we’ll use “o” to overwrite…
#collisionPolicy = “o”
#…however, in this example, we’ll just abort
collisionPolicy = “o”
system.tag.configure(baseTagPath, tagList, collisionPolicy).
You will modify the “alarms : u’enabled’: True” to true or false based on what you are trying to do you can do this in the script console.
Thanks,
Anthony