Reading UDT Parameter Value?

Hi All,

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?

Thank you!

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
3 Likes

In the JGJohnson example,
Change “%s.ExtendedProperties” by “%s.Parameters”
and it work

1 Like