I’ve done some searching and I have found some things regarding this but as far as I could tell, no one really solved it.
I’m trying to evaluate bound alarm properties, in particular ones like enabled and priority that we often have bound to another tag (in the UDT structure that the alarm itself is in). I’m able to dig down to the BoundAlarmProperty (browseConfiguration -> getAlarms -> getBoundProperty) and can see the binding in text. But I need to evaluate that expression relative to the path of the tag (an example of the binding: “[.]…/Config/Alarm Priority”). It looks like I can use compile() on the BoundAlarmProperty, but I need an ExpressionParseContext… that I have no idea how to get.
Any ideas on getting this ExpressionParseContext?
Heres my test code, where path is defined earlier:
bc = system.tag.browseConfiguration(path, False)
alarms = bc[0].getAlarms()
print alarms
for a in alarms:
print a.getName()
for p in a.getProperties():
print str(p), a.get(p), str(type(p))
if a.isPropertyBound(p):
print " bound prop text : %s" % a.getBoundProperty(p)
I’ve seen this in particular where the solution is a custom module… not something I can accomplish at the moment.