# Finding what UDT Data-Type an instance of that type is

**URL:** <https://forum.inductiveautomation.com/t/finding-what-udt-data-type-an-instance-of-that-type-is/34581>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [May 8, 2020, 4:01pm UTC](https://forum.inductiveautomation.com/t/finding-what-udt-data-type-an-instance-of-that-type-is/34581 "2020-05-08T16:01:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmahaffey](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tmahaffey/32/30949_2.png) [@tmahaffey](https://forum.inductiveautomation.com/u/tmahaffey)\
**Post date:** [May 8, 2020, 4:01pm UTC](https://forum.inductiveautomation.com/t/finding-what-udt-data-type-an-instance-of-that-type-is/34581/1 "2020-05-08T16:01:45Z")

</div>

What sciript can we use to figure out what parent data type?

The system.tag.getConfiguration() doesn’t seem to give me that information for this specific instance of a UDT:

```auto

# This example will get the configuration of a single tag
 
# Update the path here with the tag path you're trying to reach
path = '[UGC_Upstream]Emerson Series 107 Program 2/FCB 7403/2ND AFTERFLOW'
 
# Get the configurations
tags = system.tag.getConfiguration(path)
 
for tagDict in tags:
     
    # Iterate over the dictionary with the iteritems function
    for key, value in tagDict.iteritems():
         
        # Do something with the keys and values
        print key, ' : ', value

```

historyEnabled : True  
dataType : Float4  
historyProvider : Ignition\_Utah\_Oil\_and\_Gas\_Corp\_DB  
path : [UGC\_Upstream]Emerson Series 107 Program 2/FCB 7403/2ND AFTERFLOW  
opcItemPath : {bindType=parameter, binding={Meter\_Name}.SOFT\_POINT.DATA\_17:4}  
tagType : AtomicTag  
name : 2ND AFTERFLOW  
opcServer : UGC\_RRG\_AUTOSOL\_DB  
engUnit : psi  
valueSource : opc

---

<div class="post-metadata">

**Author:** ![BryanB](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BryanB](https://forum.inductiveautomation.com/u/BryanB)\
**Post date:** [May 8, 2020, 4:06pm UTC](https://forum.inductiveautomation.com/t/finding-what-udt-data-type-an-instance-of-that-type-is/34581/2 "2020-05-08T16:06:49Z")

</div>

Can you add a property to the UDT and put the name into that? Then read that out?

---

<div class="post-metadata">

**Author:** ![tmahaffey](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tmahaffey/32/30949_2.png) [@tmahaffey](https://forum.inductiveautomation.com/u/tmahaffey)\
**Post date:** [May 8, 2020, 4:09pm UTC](https://forum.inductiveautomation.com/t/finding-what-udt-data-type-an-instance-of-that-type-is/34581/3 "2020-05-08T16:09:18Z")

</div>

Sure. But I’m just wondering if there is a specific function that I’m missing that actually returns that

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 8, 2020, 4:24pm UTC](https://forum.inductiveautomation.com/t/finding-what-udt-data-type-an-instance-of-that-type-is/34581/4 "2020-05-08T16:24:40Z")

</div>

`system.tag.readBlocking(["[default]path/to/tag.typeId"])`

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [May 8, 2020, 4:25pm UTC](https://forum.inductiveautomation.com/t/finding-what-udt-data-type-an-instance-of-that-type-is/34581/5 "2020-05-08T16:25:43Z")

</div>

If you read the Tag + ‘.UDTParentType’ it will return the UDT Type.

```auto
#Tagpath must be the main UDT TagPath
system.tag.readBlocking([tagPath+ '.UDTParentType'])

```

---

<div class="post-metadata">

**Author:** ![jacque\_trahan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jacque_trahan/32/58886_2.png) [@jacque\_trahan](https://forum.inductiveautomation.com/u/jacque_trahan)\
**Post date:** [August 4, 2023, 6:45pm UTC](https://forum.inductiveautomation.com/t/finding-what-udt-data-type-an-instance-of-that-type-is/34581/6 "2023-08-04T18:45:05Z")

</div>

Here is how I did it if anyone need a quick full code. When I tried calling the **system.tag.readBlocking** function, using the UDT path does not work and I get a null. The full tag path is needed for this type of code:

```auto
def runAction(self, event):
	system.perspective.print("Process Started")
	
	path = "You tag/ UDT path"
	browse = system.tag.browse(path, filter={"recursive":True})
	
	for tagBrowse in browse:
		fullPath = tagBrowse['fullPath']
		configs = system.tag.getConfiguration(fullPath, False)
		for config in configs:
			try:
				system.perspective.print(tagBrowse)
				system.perspective.print("------------------------------------------------------------------------------------------------")
				system.perspective.print(system.tag.readBlocking(str(fullPath) + ".typeId")[0].value)
			except:
				pass
			break
		break
# system.perspective.print(system.tag.readBlocking("[Maverick]STX/CGF/CARLA_CGFB/COMPRESSORS/COMPRESSOR_02/CAE_5020_COMP/DIGITAL_VALUE.LongID"))

	system.perspective.print("Process Finished")
			

```

I put the broad try/except there due to how something are set up in the system we have but you may not need that. Also the breaks are there so I did not have to see multiple UDTs/tags. It is not needed.

Also, you may not need even need the configs function now that I am looking at this again. This is a basic set up for me to get into the configs based on what I need i can put more logic...I hope its helpful as well.

**Edit and Update:**  
I had to change up the code a bit in the program I made. Its a CSV file tag or UDT parameter file creator. In short It is similar to the Tag report tool, but as of now the Ignition report tool outputs a CSV file of tag that has missing tags path and info.

That said, on this properties function for tags I had to use the UDT's path and not the tag path. Here is how I got it to work in the function:

```auto
		elif parameter == "typeId":
			TypeIDPath = str(browse['fullPath']).rsplit("/",1)[0] + "." + parameter
			typeID = system.tag.readBlocking(TypeIDPath)[0].value
			RowDataToAdd.append(str(typeID))

```
