Creating Dynamic UDT

Exactly. Just because you can do something doesn't mean that you should do something.

The ability to make things dynamic is great, but sometimes having things that are dynamic is not worth the required maintenance.

@amarks consider this scenario, perhaps you can suggest a better way
packaging line has

  • line control PLC
  • filler PLC
  • capper PLC
  • labeller plc
  • and so on.
    There are many packaging lines and all the info from these units, I am trying to consolidate as one udt. so each one will talk to a different plc to get its relevant data.

Then I'd make a Tank_Level_udt, Tank_Formula_udt, Tank_Performance_udt, etc... that you include in the Tank_udt

Each one has a device input. Then you can make a parent UDT that determines the device for each.

Also, depending on the tag name structures you could make on general Tank_Attr_udt and use it for level, formula, performance, etc.

Super simple example, since I have no idea what the other UDTs are, but it should give a decent start.

child UDTs:



parent UDT:




Or, going the generic attr route:

child UDT:

parent UDT:

Your PLC device assignments exist in the UDT definition. So, you would only need to update it in the definition if it were to ever change.

@amarks Thank you. That is a great start. Really appreciate your help.