# UDT Member OPC Item Path Based on Other Tag

**URL:** <https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 24, 2026, 2:46pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642 "2026-03-24T14:46:50Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 24, 2026, 2:46pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/1 "2026-03-24T14:46:50Z")

</div>

I have a UDT that takes a parameter for the `AOI_Name`. The UDT then uses this `AOI_Name` in various OPC paths to get various members and tags related to the instance. For example, if `AOI_Name` is "Pump1" these OPC paths are defined for tags within the UDT:

Amps: [SCP]Pump1.Amps  
Volts: [SCP]Pump1.Volts  
Index: [SCP]Pump1\_Index

Is it possible to add a tag that now uses the "Index" tag in the OPC item path?

Group: [SCP]Group[{Index}]

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [March 24, 2026, 2:58pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/2 "2026-03-24T14:58:23Z")

</div>

What I've done for things like this is to set up a parameter named accordingly to match your tag. In this case it could be Index or MotorIndex or something, then set a tag change script on your Index tag that writes to this parameter. Works really well.

Then you just use that parameter like normal.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 24, 2026, 2:59pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/3 "2026-03-24T14:59:17Z")

</div>

That's what I'm trying to do currently. I may not have the relative path quite right:

```python
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):

	if currentValue.value:
		system.tag.writeBlocking(["[.]Parameters.Index"], [currentValue.value])

```

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [March 24, 2026, 3:00pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/4 "2026-03-24T15:00:26Z")

</div>

Try this:

```python
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):

	if currentValue.value:
		system.tag.writeAsync(["[.]../Parameters.Index"], [currentValue.value])

```

It really depends on how many layers deep your tag is. I usually have mine in folders, so I have to add a few `../` to the front to move up a few folders to get it right. If the tags are in the root of your UDT, no `../` should be needed, buf you have a single folder, the single `../` should be enough.

Edit: Changed to writeAsync also. I believe I had some issues with writeBlocking when I had a lot of tags and they all start up wanting to write at the same time.

---

<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 24, 2026, 3:18pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/5 "2026-03-24T15:18:49Z")

</div>

If you can avoid doing this, you should. Runtime changes to tag properties cause the tag to restart--a heavyweight operation that does not scale.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 24, 2026, 3:23pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/6 "2026-03-24T15:23:30Z")

</div>

~~No matter what I try I can't get it to work. Index is at the root level of the UDT and the Index parameter has been created. It just won't update.~~

I guess since I shouldn't do this if I don't have to I'll find some other workaround

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 24, 2026, 3:31pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/7 "2026-03-24T15:31:50Z")

</div>

It was working, but with one side effect.

When I created the Index parameter I didn't give it an initial value, so it comes in as null.

When the change script runs to update the value it is working for UDT instances where the Index _tag_ is non-zero. For the instances where the Index tag value is 0 the parameter's value doesn't get updated from `null` for some reason.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [March 24, 2026, 3:32pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/8 "2026-03-24T15:32:36Z")

</div>

Ahh, yeah, I forgot about that. I had the same issue and have been since doing it like that, but just forgot I had to do that to make it work.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 24, 2026, 3:34pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/9 "2026-03-24T15:34:03Z")

</div>

So what's the solution? Give the UDT definition a default value of 0?

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [March 24, 2026, 3:35pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/10 "2026-03-24T15:35:22Z")

</div>

You can try this as I know it works with strings, but you may have to use 0 by default. On strings, I set a value, apply, then clear it out so it's a 0-length string instead of null and apply again. Not sure if that will work on an integer though.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 24, 2026, 3:36pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/11 "2026-03-24T15:36:54Z")

</div>

I've had to do that for strings as well. One you put something into the field for an int it won't allow it to be blank - it'll go to 0 automatically. That should be fine though.

---

<div class="post-metadata">

**Author:** ![Greyship](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@Greyship](https://forum.inductiveautomation.com/u/Greyship)\
**Post date:** [March 24, 2026, 6:55pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/12 "2026-03-24T18:55:33Z")

</div>

If “AOI” in your parameter refers to a Rockwell Add-On Instruction, please reconsider directly addressing AOI instances in your tags, this is a severe performance impact.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 24, 2026, 7:00pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/13 "2026-03-24T19:00:30Z")

</div>

What do you mean by "directly addressing AOI instances" ? - I believe this is already what I am doing.

---

<div class="post-metadata">

**Author:** ![Greyship](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@Greyship](https://forum.inductiveautomation.com/u/Greyship)\
**Post date:** [March 24, 2026, 7:48pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/14 "2026-03-24T19:48:14Z")

</div>

[Cannot read some tags inside Rockwell AOI - Ignition Early Access - Inductive Automation Forum](https://forum.inductiveautomation.com/t/cannot-read-some-tags-inside-rockwell-aoi/38393/4)

There are a bunch of posts about directly reading AOI’s and why it provides poor performance.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 24, 2026, 7:54pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/15 "2026-03-24T19:54:28Z")

</div>

Ok, I see what you are saying now. You're saying _don't_ directly address an AOI's members because it's much slower than addressing a UDT member that is also used by the AOI. - Not gonna happen. Far too many AOIs exist to rebuild them all for Ignition. Seems like Rockwell may have done this on purpose.

---

<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 24, 2026, 8:02pm UTC](https://forum.inductiveautomation.com/t/udt-member-opc-item-path-based-on-other-tag/114642/16 "2026-03-24T20:02:26Z")

</div>

If you cannot change the PLC to minimize AOI access, you may want to try my alternate driver. But even that won't help if you cannot make the AOI's underlying data type completely readable. That has to be done with unsealed AOIs, and applies to both AOI parameters and local tags.
