Passing master UDT parameters to child nested UDTs

Hi,

I have a number of UDTs for tank devices at a winery (agitator, brine valve, temperature probe, etc.) and then a set of tank UDTs (‘master’ UDTs) that includes different configurations of these tank device UDTs.
E.g.
Tank_01_ABT

  • Agitator
  • BrineValve
  • Temperature

All UDTs take the same parameters to make it easy to create the tank UDTs. How do I pass the parameters from the master to its child nested device UDTs? When I type ‘{’ into the parameter section for these nested UDTs, none of the parent UDT’s parameters show in the list and an error is produced if I manually type them in…

E.g. parameters:

  • TankPrefix (‘YT’, ‘RF’, etc.)
  • TankNumber (‘8203’, '8304’m etc.)
  • TankArea (‘Red Processing’, etc.)
    etc…

Thanks in advance.

Nick

Edit: a note RE the solution. This works perfectly, but you cannot use the UDT instance wizard to create tags, as default values are replaced with empty strings.

1 Like

So this works for me in 7.9 All my UDTs have string parameters DeviceName and StartingAddress. I have a Pump UDT and a Tank UDT. From there I have a (master) PumpStation UDT that also have the string parameters DeviceName and StartingAddress. I’ll add two Pump UDTs and a Tank UDT to the PumpStation UDT. In the Pumps and Tank UDTs instances I set their DeviceName parameter values to {DeviceName} and their StartingAddress parameters to values like {StartingAddress+10}, {StartingAddress+25}, and {StartingAddress+40}. This causes the Pumps and Tank UDTs to reference the parameter values of the PumpStation UDT. Of note, when I set the values of the Pumps and Tank UDT parameters the DeviceName and StartingAddress are not in the list, they have to be manually typed.

So my PumpStation UDT looks like -

PumpStation - DeviceName = "MyPLC", StartingAddress = 134 Pump1 - DeviceName = {DeviceName}, StartingAddress = {StartingAddress+10} Pump2 - DeviceName = {DeviceName}, StartingAddress = {StartingAddress+25} Tank - DeviceName = {DeviceName}, StartingAddress = {StartingAddress+40}

Hi Pat,

Thanks for your reply.
I’ve tried this again and yes, this works*, I’m not sure what happened when I tried this the first time.

*this only works when creating instances manually, i.e. not using the multi-instance wizard. If you use the wizard, you need to manually (and painfully) enter in all of these parameter values into each and every child’s UDT parameters, which basically defeats the purpose… If you don’t enter these into the child parameters as well in the wizard, the defaults that you set in the master UDT for the child parameters, are overwritten with blanks.

What I think is needed is a property override added to the parameter section. This way, you could set this at the master UDT level and make them unchangeable at the instance level, much like all of the other tag properties.