# Newbie Delving Into Tags and UDT

**URL:** <https://forum.inductiveautomation.com/t/newbie-delving-into-tags-and-udt/9557>\
**Category:** Ignition\
**Created:** [January 16, 2015, 9:53pm UTC](https://forum.inductiveautomation.com/t/newbie-delving-into-tags-and-udt/9557 "2015-01-16T21:53:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ginjaninja](https://avatars.discourse-cdn.com/v4/letter/g/ed8c4c/32.png) [@ginjaninja](https://forum.inductiveautomation.com/u/ginjaninja)\
**Post date:** [January 16, 2015, 9:53pm UTC](https://forum.inductiveautomation.com/t/newbie-delving-into-tags-and-udt/9557/1 "2015-01-16T21:53:24Z")

</div>

Hi All,

I’m building a project and I am curious on to how to go about the following:  
I have a tag database that has a tree structure as follows:

Tags/Pumps/Pump01/CMDON  
Tags/Pumps/Pump01/CMDOFF  
Tags/Pumps/Pump01/Lockout  
Tags/Pumps/Pump01/Pressure  
Tags/Pumps/Pump02/CMDON  
Tags/Pumps/Pump02/CMDOFF  
Tags/Pumps/Pump02/Lockout  
Tags/Pumps/Pump02/Pressure  
Tags/Pumps/Pump03/CMDON  
Tags/Pumps/Pump03/CMDOFF  
Tags/Pumps/Pump03/Lockout  
Tags/Pumps/Pump03/Pressure  
…  
…  
.

Now I want to create a UDT such that I can pass in a index/integer and the UDT would go to the tag database and populate itself based on the index I pass into it.

Thanks for your help and much appreciated.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [January 16, 2015, 10:11pm UTC](https://forum.inductiveautomation.com/t/newbie-delving-into-tags-and-udt/9557/2 "2015-01-16T22:11:34Z")

</div>

I’d suggest checking out the Inductive University videos on UDTs ([inductiveuniversity.com/course/tags](https://inductiveuniversity.com/course/tags), then scroll down to the topic on “Creating User Defined Types”). They cover exactly how to do this, step by step.

---

<div class="post-metadata">

**Author:** ![ginjaninja](https://avatars.discourse-cdn.com/v4/letter/g/ed8c4c/32.png) [@ginjaninja](https://forum.inductiveautomation.com/u/ginjaninja)\
**Post date:** [January 16, 2015, 11:40pm UTC](https://forum.inductiveautomation.com/t/newbie-delving-into-tags-and-udt/9557/3 "2015-01-16T23:40:19Z")

</div>

Hi,

It seems that video is a good tutorial on how to reference to a device directly via OPC, via the OPC tag path, however, what I am hoping to do is reference a tag in the tag database, which is then configured to a point in the OPC server.

For example the video informs me to reference a PLC address such using a parameter in the tag path as follows:  
[DEVICE]{parameter}.status

But in my instance, I’m hoping to do something similar but instead of entering the path to the device I want to have my parameter change the tag path.  
For example:

tag\Motor{parameter}.status

Lol, I’m not sure if I’m explaining what I mean here… but I hope you follow 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [January 17, 2015, 12:47am UTC](https://forum.inductiveautomation.com/t/newbie-delving-into-tags-and-udt/9557/4 "2015-01-17T00:47:23Z")

</div>

I think you are talking about using indirects…

[inductiveuniversity.com/video/i … ag-binding](https://inductiveuniversity.com/video/indirect-tag-binding)

---

<div class="post-metadata">

**Author:** ![acooper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/acooper/32/4221_2.png) [@acooper](https://forum.inductiveautomation.com/u/acooper)\
**Post date:** [October 8, 2015, 11:00pm UTC](https://forum.inductiveautomation.com/t/newbie-delving-into-tags-and-udt/9557/5 "2015-10-08T23:00:36Z")

</div>

Hi ginjaninja,

Are you still looking for some assistance with this issue? If so let me know. You should still be able to create query tags inside of a UDT, so the idea is similar provided you know how to query your tag db.
