system.tag.editTag(tagPath, attributes, parameters, accessRights, overrides, alarmList, alarmConfig)
String tagPath - The full path to the Tag you want to edit. For members of UDT instances, the tagPath will be the path to the UDT instance, with the overrides parameter listing out the member Tags to edit. Note: you can specify the Tag provider name in square brackets at the beginning of the parentPath string. Example: "[myTagProvider]MyTagsFolder". If the Tag provider name is left off then the project default provider will be used.
PyDictionary attributes - The Tag's configuration attributes.
PyDictionary parameters - The parameters for a UDT instance Tag.
String accessRights - The access rights for the Tags. Possible values are Read_Only, Read_Write, and Custom.
PyDictionary overrides - All of the overrides for a UDT instance Tag. The dictionary should be in the form of the names of member Tags as keys, with the values being a dictionary of properties/overrides ie. {'memberTagName':{dictionary of overrides}}.
String alarmList - List of legacy alarms for the Tag. The legacy alarm system was retired in 7.6.0. Newer systems should utilize the system.tag.editAlarmConfig function instead.
PyDictionary alarmConfig - The alarm configuration for the Tag. Note that this parameter cannot edit alarms on UDTs. Instead, the system.tag.editAlarmConfig function (which can also edit alarms on non-UDT Tags) should be used instead. See editAlarmConfig for details on how to use this parameter.
Nothing
All
Associated attributes:
11 Comments
Anonymous
It would be nice if there could be a list of possible values for the attributes and parameters parts.
Anonymous
Or, not possible values of the parameters, because those are user defined in the UDT, but a list of possible alarmConfig values.
Robert McKenzie
The attributes list already exists, I've added a link.
Anonymous
Can you edit the UDT data types directly (not the instances) ?
nger
Paul Scott
Currently, this is not a way to do this. However, that would make a great feature request.
If the idea isn't already listed, you can post it here: http://ideas.inductiveautomation.com
Anonymous
Is there a method for reading a parameter value from a UDT tag instance? E.g. I want to dynamically modify a parameter to append to it, how can I do this?
Paul Scott
Currently, there is not a function that retrieves UDT parameters, but that would make a great suggestion for our ideas page: http://ideas.inductiveautomation.com
Until then, UDT parameters are accessible by members of the UDT, so you could add an expression tag to the UDT that simply exposed the value of the parameter using an expression similar to the following: "{ParamName}". From here you could read the expression tag to determine it's value.
Anonymous
What attribute or attributes would be used if you wanted to generate a Tag Event Script to log when the tag value changes?
Paul Scott
By "generate a Tag Event Script" do you mean edit the tag on the fly to include a Tag Event Script based on some other script running? If so, it is theoretically possible, but not supported since you would have to code up a class in Java that you could pass to the tag in Python.
On a side note, modifying a script from another script seems ripe for timing issues. It may be better to create a more generalized Tag Change script to log the change that you can pass parameters to, or leave a static Tag Event Script on each tag with a hefty amount of 'if' statements filtering out inconsequential events.
Anonymous
It appears that the alarm list has been deleted.
Paul Scott
Good catch. It looks like the link just needed to be updated. It should redirect to the correct page now.