Referencing parent UDT parameters within nested UDT parameter values

I have a UDT definition that has a few UDT instances nested within it, for example Pump below.

image

The Main UDT definition has these parameters:

The Pump UDT instance has these parameters:

I am trying to reference the values of the parameters in the Main UDT (E.g. Description) within the Pump UDT (E.g. in Alarm_ParentDevice), however it’s returning the value of the Pump UDT’s Description instead of the Main UDT’s Description.
E.g.
Pump UDT’s Alarm_ParentDevice = “Pump” instead of “Mobile Pump Station 1 Pump”

Where the value is blank in the pump UDT, it does reference the Main UDT’s value (e.g. Alarm_Area and Alarm_ParentDevice), however if the value is not blank, then it seems to use its own value making it impossible to to cascade parameters :frowning:

Is there any way to force the nested UDT to use the referenced values of the parent?

1 Like

In this situation I usually use a second parameter in the nested instance (for example: Parent_Description) and use {Description} as the value. That’ll reference the parent’s parameter value.

1 Like

I have a similar situation :wink:
-However both “Pump”-udt and “Sensor”-udt are inheriting from “Base”-udt
-Base-udt provides typical parameters to both, like “Name” and “Description” and “DeviceName”

UDT hierarchy:
Base<-Pump
Base<-Sensor
Pump/Sensor of type Sensor

Sometimes I use Sensor standalone and parameter DeviceName is used in OPC item path fex
The problem occurs when I try to add Sensor as a udt-type into my pump UDT (to save some engineering)

-Now both pump and sensor have parameter DeviceName. And the parameter name may not be modified since they both initially get it from Base :-/

Have I painted myself into a corner, or does anyone have a best-practice or idea how to get out of this corner :wink:
-Would it be nice to be able to explicitly address parameters of the “parent udt”?

If you’re embedding sensor into pump, then can’t you just override the sensor params in that pump udt? Or have I missed something :thinking: