# Creating relative OPC tag UDT / templates

**URL:** <https://forum.inductiveautomation.com/t/creating-relative-opc-tag-udt-templates/45783>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 19, 2021, 10:57pm UTC](https://forum.inductiveautomation.com/t/creating-relative-opc-tag-udt-templates/45783 "2021-04-19T22:57:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frank.carney](https://avatars.discourse-cdn.com/v4/letter/f/d6d6ee/32.png) [@frank.carney](https://forum.inductiveautomation.com/u/frank.carney)\
**Post date:** [April 19, 2021, 10:57pm UTC](https://forum.inductiveautomation.com/t/creating-relative-opc-tag-udt-templates/45783/1 "2021-04-19T22:57:13Z")

</div>

I am working to understand how to create relative OPC tags. I have a server layout that defines an object like this:

- module name  
– parameters  
— parameter value  
---- parameter attributes

There can be any number of modules, any number of parameters under the parameter heading, and a fixed number of parameter attributes. I think I will have to template somehow for module names and for parameters. However, I am starting with parameter attributes.

So a parameter will look like this:  
parameter

- default
- min
- max

I can define a UDT that takes the top most tag as an opc tag. However, I would like default, min and max to be an OPC tag that is a path relative to the parameter opc path.

For example:  
objects/module/parameters/voltage  
(yes my paths are strings in opc server)  
Now I want default to be:  
objects/module/parameters/voltage/default

Can I make OPC paths relative to another tags OPC path?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 20, 2021, 1:59am UTC](https://forum.inductiveautomation.com/t/creating-relative-opc-tag-udt-templates/45783/2 "2021-04-20T01:59:46Z")

</div>

> [@frank.carney](#):
>
> Can I make OPC paths relative to another tags OPC path?

Sort of. You can reference UDT parameters inside of the OPCItemPath of a tag, e.g.

```auto
OPCItemPath: ns=1;s=[{PLCName}]{DeviceName}.Sts

```

Where `PLCName` and `DeviceName` are UDT parameters.  
However, you can't reference other tag values or their properties.

Do you have a more complete example of what it would look like in the end? (can you construct using standard tags (non-UDT) and paste the json?)

---

<div class="post-metadata">

**Author:** ![frank.carney](https://avatars.discourse-cdn.com/v4/letter/f/d6d6ee/32.png) [@frank.carney](https://forum.inductiveautomation.com/u/frank.carney)\
**Post date:** [April 20, 2021, 10:03pm UTC](https://forum.inductiveautomation.com/t/creating-relative-opc-tag-udt-templates/45783/3 "2021-04-20T22:03:12Z")

</div>

My aim was to reduce setup. I just found I can drag entire sets of tags into the project. So maybe my thought of how intensive this would be is wrong.

I did play with using parameters to set OPC tag paths. It does seem to work. So I can make that dynamic if I choose.

Thanks
