i’m using system.tag.confgure to enable and disable alarms by scripting, when executing it for the first time the quality of the tag changes to 'uncertain initial value.
def overrideAlarmConfig(tagPath, alarmName, alarmProperty, value):
config = system.tag.getConfiguration(tagPath)[0]
for alarm in config['alarms']:
if alarm['name'] == alarmName:
alarm[alarmProperty] = value
break
basePath = tagPath.rsplit('/',1)[0]
system.tag.configure(basePath, config, 'm')
overrideAlarmConfig("[default]D33/BO01/PIT_1001/PR2/MINS", "High", "enabled", 'true')```
'''
thanks you
Unfortunately, setting some properties at the top level of a tag with system.tag.configure, even to what should be their current value, causes weird side effects. I bumped into this with the tag quality. The simplest solution I’ve found is to pass only the bare minimum config back into system.tag.configure when using “merge” mode.
Try this:
Which version of Ignition are you running? I’ve used almost this exact method to enable/disable alarms without modifying any other properties of the tag or the alarm in 8.0.12 and newer.
Oh! Maybe the “true” value you are passing in should be a native Python True instead of a string. (I didn’t even notice that on my first read through…)
I’m fairly certain it is being caused by the tag being part of a UDT instance and you are attempting to override it and not just change the value of enabled.
I am not familiar enough with version 8 yet to say how to override and not just change a tags enabled property.