# Issue using system.tag.configure to add UDT instances to parent UDT instance

**URL:** <https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-to-add-udt-instances-to-parent-udt-instance/87059>\
**Category:** Ignition\
**Created:** [March 8, 2024, 7:19pm UTC](https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-to-add-udt-instances-to-parent-udt-instance/87059 "2024-03-08T19:19:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Wilson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nick_wilson/32/80663_2.png) [@Nick\_Wilson](https://forum.inductiveautomation.com/u/Nick_Wilson)\
**Post date:** [March 8, 2024, 7:19pm UTC](https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-to-add-udt-instances-to-parent-udt-instance/87059/1 "2024-03-08T19:19:42Z")

</div>

Hello,

I'm trying to dynamically add UDT instances inside of other UDT instances, but I'm getting the following error:

_Error processing edit for tag path 'Engine/Line/Line 1/Station 1': Bad\_Unsupported("The target path 'Engine/Line/Line 1' does not have item 'Station 1' for overrides, and cannot accept children tags.")_

I'd appreciate some help with this. I was thinking that maybe the Station UDT needs to have the Line UDT as a parent type, but I'm really at a loss here.

```auto
import time
LOGGER = system.util.getLogger("TagCreationLogger")
def create_mcp_tags(device_name):
	tag_json = {
        "name": "MCP",         
        "typeId" : "Main/MCP",
        "tagType" : "UdtInstance",
        "parameters" : {
          "plc" : device_name
		}
	}
	system.tag.configure(device_name, tag_json, "o")
	
def create_agv_tags(device_name):
	agv_count = system.tag.readBlocking(["[default]Engine/MCP/AGV_CNT"])[0].value
	for i in range(agv_count):
		tag_json = {
            "name": "AGV {}".format(i+1),         
            "typeId" : "Main/AGV",
            "tagType" : "UdtInstance",
            "parameters" : {
              "agvNumber" : i,
              "plc" : device_name
			}
		}
		system.tag.configure("{}/AGV".format(device_name), tag_json, "o")
		
def create_line_tags(device_name):
	line_count = system.tag.readBlocking(["[default]Engine/MCP/Line_CNT"])[0].value
	for i in range(line_count):
		line_name = "Line {}".format(i + 1)
		tag_json = {
			"name": line_name,
			"typeId": "Main/Line",
			"tagType": "UdtInstance",
			"parameters": {
				"lineNumber": i,
				"plc": device_name
			}
		}
		line_path = "{}/Line/{}".format(device_name, line_name)
		system.tag.configure(device_name + "/Line", [tag_json], "o")

		station_count = system.tag.readBlocking(["[default]Engine/Line/{}/TotalStations".format(line_name)])[0].value
		create_station_tags(line_path, i + 1, device_name, station_count)
		
def create_station_tags(line_path, line_number, device_name, station_count=10):
	for i in range(station_count):
		tag_json = {
			"name": "Station {}".format(i + 1),
			"typeId": "Main/Station",
			"tagType": "UdtInstance",
			"parameters": {
				"stationNumber": i,
				"plc" : device_name,
				"lineNumber" : line_number
			}
		}
		system.tag.configure(line_path, [tag_json], "m") 
		print("Station {} Configured at path {}".format(i+1, line_path))
		LOGGER.info("Creating station tags at path: {}".format(line_path))
        
def create_all_tags(device_name):
	create_mcp_tags(device_name)

	create_agv_tags(device_name)

	create_line_tags(device_name)

```

Thanks in advance.

---

<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:** [March 8, 2024, 7:44pm UTC](https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-to-add-udt-instances-to-parent-udt-instance/87059/2 "2024-03-08T19:44:33Z")

</div>

> [@Nick\_Wilson](#):
>
> add UDT instances inside of other UDT instances

Ignition doesn't support this at all.

You must change the **definition** to include more members, and all instances will get the new members.

UDT instances are **not** folders.

---

<div class="post-metadata">

**Author:** ![Nick\_Wilson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nick_wilson/32/80663_2.png) [@Nick\_Wilson](https://forum.inductiveautomation.com/u/Nick_Wilson)\
**Post date:** [March 8, 2024, 7:47pm UTC](https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-to-add-udt-instances-to-parent-udt-instance/87059/3 "2024-03-08T19:47:57Z")

</div>

Thanks, as always!

My solution will be to create folders for each line, under which the "Line" UDT instance and the "Stations" belonging to that line will exist. I would change the definition of the Line UDT if the number of stations in a "line" were static.
