# UDT Definitions Nested

**URL:** <https://forum.inductiveautomation.com/t/udt-definitions-nested/94871>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [August 20, 2024, 8:56am UTC](https://forum.inductiveautomation.com/t/udt-definitions-nested/94871 "2024-08-20T08:56:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miguel\_Cimildoro](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@Miguel\_Cimildoro](https://forum.inductiveautomation.com/u/Miguel_Cimildoro)\
**Post date:** [August 20, 2024, 8:56am UTC](https://forum.inductiveautomation.com/t/udt-definitions-nested/94871/1 "2024-08-20T08:56:53Z")

</div>

Hello everyone, I have a question about UDT Definitions. I am very new to this.

I have created a UDT called BESS which is broken down into subfolders with different parameters. Those parameters form OPC addresses or Alarms. Now, within that BESS UDT, I have a folder called Racks, where the number of racks within the BESS varies. For example, in the BESS 1 there are 3 racks, and in the BESS 2 there is 1. So, I don't know how to create a UDT inside another UDT. I don't know if I make myself clear.

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

I want to nest this GSC\_Rack UDT inside the GSC\_Racks folder of BESS UDT

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

I hope I have explained myself well,

greetings

---

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [August 20, 2024, 9:07am UTC](https://forum.inductiveautomation.com/t/udt-definitions-nested/94871/2 "2024-08-20T09:07:05Z")

</div>

> **[UDT Nesting | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/tags/user-defined-types-udts/udt-nesting)**
>
> It's possible to set up UDT nesting in Ignition where you are putting one UDT inside of another UDT. The UDT is nested as an instance within another UDT. It facilitates quicker development of projects since you're able to piece together multiple UDT...

You can check this.!

---

<div class="post-metadata">

**Author:** ![Miguel\_Cimildoro](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@Miguel\_Cimildoro](https://forum.inductiveautomation.com/u/Miguel_Cimildoro)\
**Post date:** [August 20, 2024, 10:38am UTC](https://forum.inductiveautomation.com/t/udt-definitions-nested/94871/3 "2024-08-20T10:38:53Z")

</div>

Thanks, I found the link you passed me a great help, I hope I got it right!

I have created two racks following the parameters of the parent UDT and interacting only with the rack\_cell, which will increment according to the amount of racks each BESS has.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/9/f9e616217ea4ae1dd91165d177865bea9698860e.png)

---

<div class="post-metadata">

**Author:** ![Miguel\_Cimildoro](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@Miguel\_Cimildoro](https://forum.inductiveautomation.com/u/Miguel_Cimildoro)\
**Post date:** [August 20, 2024, 10:47am UTC](https://forum.inductiveautomation.com/t/udt-definitions-nested/94871/4 "2024-08-20T10:47:15Z")

</div>

Now I would like to know if there is a way to specify how many racks I want to create before configuring the UDT, without having to create three different UDT Definitions: one with 2 racks, one with 3 racks, and one with only 1.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 20, 2024, 1:07pm UTC](https://forum.inductiveautomation.com/t/udt-definitions-nested/94871/5 "2024-08-20T13:07:32Z")

</div>

> [@Miguel\_Cimildoro](#):
>
> without having to create three different UDT Definitions

No. UDTs **cannot** have variable numbers of members. At all. If there are only a small number of variations, using a parent type with variations is reasonable.

Otherwise, place your core (invariant) UDT instance in a non-UDT tag folder with the variant instances as **peers**.

---

<div class="post-metadata">

**Author:** ![Miguel\_Cimildoro](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@Miguel\_Cimildoro](https://forum.inductiveautomation.com/u/Miguel_Cimildoro)\
**Post date:** [August 21, 2024, 9:05am UTC](https://forum.inductiveautomation.com/t/udt-definitions-nested/94871/6 "2024-08-21T09:05:00Z")

</div>

Thanks for the clarification. I now understand better how UDTs work and why they cannot have a variable number of members.

Your suggestion of using a main type with variations or placing the main instances in a non-UDT tag folder along with the variants as pairs seems very helpful to me. It will really help me to organize everything better.

i really appreciate your help!
