I don’t know how to thank you. You save me. What a clever idea.
The system.tag.writeAsync() does work only if the key is exist in tag struct. Because Ignition doesn’t include any properties that use default value from it’s UDT, so the property doesn’t exist and system.tag.writeAsync() doesn’t work. The override cause that key, value include in tag struct and after that system.tag.writeAsync().
Do you believe this is a bug? In v7.9 the system.tag.write() did work.
The inability to write to (rather than configure) default properties does sound like a bug–or at least a loss of capability–caused by the changes to the tag system.
Hi witman
Could you please modify your function so I can toggle alarms enable of a tag.
For example I have udt : PT2323/PV
The PV/Alarms/Hi.enable
The /Alarms/Hi.enable is not path so the your function will not work.
I used to toggle alarm enable with system.tag.wrtie(“PT2323/PV/Alarms/Hi.enable”, True) in v7.9 but as before it doesn’t work in v8.
I’ve been combing through these threads searching for a way to disable an override for only a single property of a udt tag instnace. I have some tags that have their opcItemPath overridden, and I want to disable the override for that propety only, while keeping some others overridden.
tag = {
'name':tagname,
'overrides': {'opcItemPath':None}
}
system.tag.configure(cfg_tag_path, [tag], 'o')
The code above disables all override of my instance tag, and also creates a custom object within my instance tag: overrides = {’‘opcItemPath’:None}
This will remove an override, but unfortunately turns all the non-overridden values included in system.tag.getConfiguration into overrides. Supply a tag path in place of tagPath.
# Get tag config.
cfg = system.tag.getConfiguration(tagPath)[0]
# Remove opcItemPath key.
cfg.pop('opcItemPath', None)
# Get base path.
basePath = tagPath.rsplit("/",1)[0]
# Overwrite tag with cfg that we removed key from.
system.tag.configure(basePath, cfg, 'o')
If system.tag.getConfiguration didn’t return non-overridden values, the above would work without adding overrides.
If you want to remove all overrides from a tag, this works (supply a tag path in place of tagPath):
I haven’t tried and there might be an easier way I’m not aware of, but… I expect this could be done by comparing the UDT instance with the UDT template and removing the override node as well as nodes that weren’t overridden from template but will turn into overrides if you write them back with system.tag.configure. Unless I’m missing something, system.tag.getConfiguration really should not return non-overridden values from UDTs. That would make this easy and the code in my previous post would accomplish what you’re looking for.