Is there any ways to read a UDT Parameter value (for example I have a parameter called alarmDescription on UDT tank_anomaly). I need to be able to read this value into a script.
Doing a UDT Binding on a window does not show the parameter values. Or is there a way to read parameter values from the binding?
You will need to read and parse the UDT instance’s extended properties.
# The name of the parameter to be read
paramName = "MyUDTParam"
path = "%s.ExtendedProperties" % myUDTInstanceFullPath
props = system.tag.read(path)
if props.value is not None:
for prop in props.value:
if prop.getProperty().name.lower() == paramName.lower():
print prop.value
break