I need a little help with understanding edittag function…specifically the alarmList and alarmConfig parameters.
My workflow overall is this:
-Get Alarm properties (done)
I am able to use the getAlarmProperties() to recieve the property names and property values.
-Modify those properties (done)
I am able to modify the properties in a table on screen
-Save new alarm properties to tag. (not done)
I need to save the contents of the table to the tag alarms.
It looks like the editTag function is expecting a string for the alarm list, but a dictionary for the alarm configuration. I am not sure how to make the syntax to get the function to work.
How do I get this alarm property table into the editTag() function?
You might have a better time using the editAlarmConfig function. It’s got a fairly unusual syntax of arguments; basically, you pass a list of tagpaths, then a dictionary with a key for each alarm to be modified, and a list of alarm properties to change, which itself is another list - a three item set of the property name, the identifier that you’re changing its “Value”, and the new value that you’re going to set it to.
[code]#Build a list of tag paths. Only a single tag will be altered, so create a list of one item and store the list in a variable
tagPaths = [“sensors/B3:0”]
#Build the dictionary of alarm names, and properties to change.
alarmConfig = {“High Temp”:[[“name”,“Value”,“Low Temp”],[“setpointA”,“Value”,“100”]]}
#Edit the alarm configuration.
system.tag.editAlarmConfig(tagPaths, alarmConfig)[/code]