# Creating Dynamic UDT

**URL:** <https://forum.inductiveautomation.com/t/creating-dynamic-udt/93081>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [July 11, 2024, 2:14pm UTC](https://forum.inductiveautomation.com/t/creating-dynamic-udt/93081 "2024-07-11T14:14:23Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 11, 2024, 7:13pm UTC](https://forum.inductiveautomation.com/t/creating-dynamic-udt/93081/21 "2024-07-11T19:13:08Z")

</div>

> [@amarks](#):
>
> Why do you have tags from different PLCs in the same 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.

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [July 11, 2024, 7:16pm UTC](https://forum.inductiveautomation.com/t/creating-dynamic-udt/93081/22 "2024-07-11T19:16:17Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 11, 2024, 7:16pm UTC](https://forum.inductiveautomation.com/t/creating-dynamic-udt/93081/23 "2024-07-11T19:16:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 11, 2024, 7:37pm UTC](https://forum.inductiveautomation.com/t/creating-dynamic-udt/93081/24 "2024-07-11T19:37:37Z")

</div>

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

child UDTs:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/c/7c70db653b4d84b7bd1dad8c2e2220377283d08a.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0c83bf0e36f8c5665965a6ba20870eddf5ec8a62.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/ec2e06d5e5d082a23dda30dc552027a2ae73021d.png)

parent UDT:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/8/3860f29a505118cc81eca4c011e1ee58031a0450.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/e/6e55cdd6810f29d0b3e9fab6316c80276b6234fa.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/4/1415fa0e7504d58b196238d0759a22944127bdda.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/3/e3a27c08e7ce2774909e55aca73bb87ba27aa701.png)

Or, going the generic attr route:

child UDT:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/5/6515bcaeb3598cb07fe44f9a10015ab8b11f9bc2.png)

parent UDT:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/27d57694fc1dfbeac7387a7ede492df2ad5285b7.png)

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.

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [July 11, 2024, 7:40pm UTC](https://forum.inductiveautomation.com/t/creating-dynamic-udt/93081/25 "2024-07-11T19:40:53Z")

</div>

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

[Previous page](https://forum.inductiveautomation.com/t/creating-dynamic-udt/93081.md?page=1)
