# Use tag value as UDT parameter in nested UDT

**URL:** <https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492>\
**Category:** Ignition\
**Created:** [June 16, 2018, 12:55pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492 "2018-06-16T12:55:57Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://forum.inductiveautomation.com/u/Vince)\
**Post date:** [June 16, 2018, 12:55pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/1 "2018-06-16T12:55:57Z")

</div>

Hi,

I would like to use a tag as value for a data type parameter.  
I need to drive the “input” of the “AndonStopTimer” to be driven by the tag AndonStop:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/bbe3c6623d2b1872d5072855d0f03c4cf3222cfc.png)

Is it possible?

---

<div class="post-metadata">

**Author:** ![marcelo.amorim](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@marcelo.amorim](https://forum.inductiveautomation.com/u/marcelo.amorim)\
**Post date:** [October 14, 2019, 4:40pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/2 "2019-10-14T16:40:09Z")

</div>

I have the same question. I need to reference a tag in a UDT definition and use its value on another tag’s numeric property and all in the same UDT.  
Here is the tag that I want to reference:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7202b5241688df4987f7243c882c120aac2bfc1c.png)

and here is where I need to use the reference value

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/aea76dfdd6c30f487cffef759090ef64fb705143.png)

I am not able to use a syntax like {[.]Cfg\_EU} is there a way to use UDT parameters dynamically?

---

<div class="post-metadata">

**Author:** ![lnpranger](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@lnpranger](https://forum.inductiveautomation.com/u/lnpranger)\
**Post date:** [November 15, 2019, 11:41pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/3 "2019-11-15T23:41:06Z")

</div>

I also have a need for this (using 8.0.4). When I saw it in the search results I was really hoping there would be a solution posted also, but unfortunately not…even given the thread’s age.

---

<div class="post-metadata">

**Author:** ![petr.sasin](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@petr.sasin](https://forum.inductiveautomation.com/u/petr.sasin)\
**Post date:** [December 2, 2020, 10:00pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/4 "2020-12-02T22:00:46Z")

</div>

I have same need. Using 8.1

---

<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:** [December 3, 2020, 4:32am UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/5 "2020-12-03T04:32:49Z")

</div>

No can do. If it was an option, it would need to be used with care, as I imagine this could add a lot of load onto the CPU.

In any case, if you guys are after it, you should add an idea to the ideas site  
[https://ideas.inductiveautomation.com/ignition-features-and-ideas](https://ideas.inductiveautomation.com/ignition-features-and-ideas)

---

<div class="post-metadata">

**Author:** ![michael.ruel](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@michael.ruel](https://forum.inductiveautomation.com/u/michael.ruel)\
**Post date:** [April 6, 2021, 10:11pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/6 "2021-04-06T22:11:53Z")

</div>

I was looking for a similar functionality and came up with something that works, but I’m not sure if this is very efficient. I needed a parameter in a UDT to refer to a tag value which inturn controlled tag paths in the UDT. I came up with using an expression tag in the UDT that refers to the tag value outside of the UDT and then in the UDT parameter used the {[.]tagname} which is referring to the expression tag. In the expression tag I referred to a tag within the same parent path and used {[.]…/tagname}. This did work, but I’m sure it is eating up processing power to do so and I have not tested response time on change. We did this to minimize the amount of editing of parameters we needed to do for UDTs. We just have one tag to edit vs the number of UDTs in a grouping.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/d/9d10d10a12c85f9c8105576ac55ce305b0dde430.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/9/4910775d0b596bd4b43ad7eb66f9acdb66f6999e.png)

---

<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 7, 2021, 12:28am UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/7 "2021-04-07T00:28:54Z")

</div>

Just returning to this, this _is_ actually possible now in v8 in a way. If you bind a UDT tag’s property to a UDT parameter, you can then write to the UDT’s parameter from, say, a tag change value script to set its value dynamically.

E.g. if the UDT parameter for the unit is called ‘EngUnit’, the tag path would be:

```auto
path/to/tag/parameters.EngUnit

```

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [August 18, 2021, 12:10am UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/8 "2021-08-18T00:10:02Z")

</div>

@nminchin Can you please elaborate a bit on this?

perhaps an example of my use case may help inform your clarification?

I maintain my tag database such that the final OPC item paths for all UDT members can always be derived from the Ignition tag database/UDT folder structure itself (`Line`\* is PLC, `Tank`\* is UDT):

`[tagProvider]Line3/Tank2/Level/Value` - Ignition tag path  
`nsu=_URL;s=0:Line3!Tank2.Level.Value` - actual OPC item path

So ideally I’d be able to create a new instance of `Tank` UDT named _Tank\_whatever_, under _Line\_infinity_ parent folder, and assuming that  
`nsu=URL;s=0:Line_infinity!Tank_whatever.Level.Value`  
is a valid OPC path, I’d be **done** (no need to manually configure UDT parameter values).

Unfortunately this doesn’t appear to be possible , as it seems OPC path indirection can only use _static_ UDT paramters ☹:  
`{OPC Server}:{PLC}!{InstanceName}.Level.Value`

I think I effectively need _dynamic_ UDT Parameters (and thus dynamic OPC item paths).

can your described method accomplish this?

Perhaps I’m missing something obvious.

Would the OPC item path be constantly overwritten, albeit with the same data (performance bottleneck)?

---

<div class="post-metadata">

**Author:** ![michael2](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@michael2](https://forum.inductiveautomation.com/u/michael2)\
**Post date:** [August 18, 2021, 1:14am UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/9 "2021-08-18T01:14:59Z")

</div>

You can write to UDT parameters and tag parameters using scripting, but how you achieve that is up to you. I imagine you’d need to use system.tag.getConfiguration to pull back the folder names and then apply those to the UDT parameters. It won’t be an automagic process.

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [August 18, 2021, 2:40pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/10 "2021-08-18T14:40:03Z")

</div>

per @nminchin 's comment above, it seems he is suggesting that UDT _parameters_ can in fact be written to, albeit via through a bound tag _property_.

I’ve tried setting the bindings up (“Value” parameter \<\> Tag.Value property) and then modifying the tag’s bound “value” property (in the tag browser, not via script), but I get an error

`Error writing to value.value: Bad_ReadOnly("The specified value is dynamic and cannot be written.")`

Am I misinterpreting his comment?

---

<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:** [August 18, 2021, 5:06pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/11 "2021-08-18T17:06:47Z")

</div>

You’re writing to a tag property, not to a UDT instance parameter. Some tag properties are indeed read-only. UDT instance parameters however are read/write.  
E. G.  
Path/to/UDTInstance/Parameters.Param1

---

<div class="post-metadata">

**Author:** ![sean.abraham](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sean.abraham](https://forum.inductiveautomation.com/u/sean.abraham)\
**Post date:** [January 19, 2022, 12:23am UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/12 "2022-01-19T00:23:22Z")

</div>

I believe I have figured this out, let me know if it solves everyone’s problem.

1. Create a child UDT with parameters used in the OPC tag path.  

2. Create a parent UDT with a child object. Create a parameter that you would would like to pass from the parent to the child.  

3. In the definition of the parent UDT drill down to the child object’s parameters. Change the value of the child’s parameter to the name of the parent’s parameter surrounded by {}  

4. When you define the tag you can change the value of the parent’s parameter and it should pass to the child’s parameter.

---

<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:** [January 20, 2022, 8:18pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/13 "2022-01-20T20:18:17Z")

</div>

@sean.abraham This topic is about using a tag’s value as a UDT parameter value, not a parent UDT parameter value in a child UDT parameter. That could always be done, and you don’t even need to have different parameter names between parent and child 🙂

---

<div class="post-metadata">

**Author:** ![jparish](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@jparish](https://forum.inductiveautomation.com/u/jparish)\
**Post date:** [June 20, 2023, 7:44pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/14 "2023-06-20T19:44:37Z")

</div>

I just want make sure this is still the case with 8.1, that you cannot connect the parameter of one UDT to the parameter of another UDT, or the parameter from one UDT as a tag reference inside of another UDT?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/58f1ed6665cd98837c62173bae523ca5ff21419a.png)

I would like to get rid of the redundant parameters for the OPC connection.

---

<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:** [June 21, 2023, 5:03am UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/15 "2023-06-21T05:03:08Z")

</div>

Firstly, I would do an audit on all of the UDT parameter names in the system, as these look very inconsistent and will only make development frustrating and difficult.

To answer your question (and as I stated in your other topic), no, you can't bind UDT parameter values to tag values (and this wouldn't be a good idea if you could, for scalability reasons). You can, however, create a parent base UDT with a set of default parameters and their default values.

---

<div class="post-metadata">

**Author:** ![zbinder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zbinder/32/28918_2.png) [@zbinder](https://forum.inductiveautomation.com/u/zbinder)\
**Post date:** [June 29, 2023, 1:56pm UTC](https://forum.inductiveautomation.com/t/use-tag-value-as-udt-parameter-in-nested-udt/18492/16 "2023-06-29T13:56:01Z")

</div>

I don't know of a way to do it exactly like you're describing, but if you have predictable tag names you may be able to set up a script that can do your work for you.

When I have complicated changes to make repeatedly to UDT instances, I create a tag that will trigger a one-time script that does what I need. I've recently published a resource that does this (though the application is different from what you're trying to do).

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2506/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.
