I’m trying to script the bulk editing of alarm names within a UDT definition, e.g. the highlighted property. Basically I want to bulk rename the alarm name to the alarm tag name. I really wish that this was accessible as a property to show in the alarm headers…
I’m struggling… does anyone have a script already to do this or something similar?
I have this:
Very simple UDT definition for testing with:
udtTagFolder = '_types_/_Testing'
udtName = 'Simple'
tagsc = system.tag.browseConfiguration(udtTagFolder,1)
for tagc in tagsc:
if tagc.getName() == udtName:
tags = tagc.getSubTags()
# gets the first "tag" i.e. the folder "Alarms",
# then gets the tags within the folder (array of 1 tag),
# the the 1st tag within the folder ('Faulted'), and its alarm configuration
alarms = tags[0].getSubTags()[0].getAlarms()
print alarms, type(alarms)
for alarm in alarms:
print alarm, type(alarm)
Did you get anywhere with this?
I'm currently looking at trying to build a Vision popup which can display (and eventually hopefully re-configure using scripting) the alarm configuration for any UDT tag instance.
Struggling with the fact that the new system.tag.getConfiguration only returns changed properties, not ALL which is very frustrating.
I think i've managed to avoid this now with my latest iteration of configure scripts. You need to just ensure you only send back the json values required for the change, and not the whole configuration object.