# Using custom tag parameters

**URL:** <https://forum.inductiveautomation.com/t/using-custom-tag-parameters/87643>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 20, 2024, 5:21pm UTC](https://forum.inductiveautomation.com/t/using-custom-tag-parameters/87643 "2024-03-20T17:21:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [March 20, 2024, 5:21pm UTC](https://forum.inductiveautomation.com/t/using-custom-tag-parameters/87643/1 "2024-03-20T17:21:04Z")

</div>

This doesn't work, but is there a way to do this?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/e/dee01a8f301d333fe6df69ee24d1cc7c7e09505c.png)

Bind a tag parameter to the value of a custom tag parameter?

---

<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 20, 2024, 5:36pm UTC](https://forum.inductiveautomation.com/t/using-custom-tag-parameters/87643/2 "2024-03-20T17:36:43Z")

</div>

No. Regular tags only support bindings on alarm props, and those execute only on the alarm activation.

UDTs might be able to do this, but the bindings won't **subscribe** --the bindings only evaluate on tag start/restart. Only changes to UDT parameters will restart the instance.

Related discussion:

> [@Tag folder ability to have parameters](https://forum.inductiveautomation.com/t/tag-folder-ability-to-have-parameters/83147):
>
> I think it would be very beneficial if there was a way to for Tag folders to have parameters that tags and UDT definitions could reference. I was about to make a request in the features and ideas section, but seems there was one made several years ago: [add bindable parameters to tag folders](https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/add-bindable-parameters-to-tag-folders) The main line of thinking after following discussions all over the forum about best ways to structure tags, especially with large amounts, is to use a folder hierarchy at the top levels instead of UDTs. T…

---

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [March 20, 2024, 6:18pm UTC](https://forum.inductiveautomation.com/t/using-custom-tag-parameters/87643/3 "2024-03-20T18:18:38Z")

</div>

What I am trying to do is be able to write a script that will write in last part of the OPC item path based on data I am pulling for excel sheet. Part I am struggling with is modify the OPC item path.  
Seeing the custom parameter there I was hoping I could just write the value there in the UDT definition and the tags built on that UDT would update. but that doesn't appear to work (doesn't fill in the value of the custom parameter)

Alternatively I was thinking I could just write to the OPCItemPath parameter directly but that breaks the binding.

UDT Definition set manually showing correct in tag

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/0/c000c8a569564b33fd4a70455334a2c5058e575d.png)

running this script to try to figure out how to change via script

```auto
tagPaths = ['[PLC3]PLC3/Inputs/CUB 1/1/CB1_1_TGMS_EAS001/Config/AI/Alarm Hi SP.OpcItemPath']
value = system.tag.readBlocking(tagPaths)
print 'Tag OPC Item path before change'
print value[0].value
tag = system.tag.getConfiguration("[PLC3]_types_/TGMS/TGMS_INPUT/Config/AI/Alarm Hi SP")
print 'UDT OPC Item Path before change'
print tag[0]['opcItemPath']
tag[0]['opcItemPath']= '{bindType=parameter, binding={OPCPath}Cfg_AlarmHiSetpointNEW}'
# Failed -- tag[0]['opcItemPath']= '{OPCPath}Cfg_AlarmHiSetpointNEW'
collisionPolicy = "o"
system.tag.configure("[PLC3]_types_/TGMS/TGMS_INPUT/Config/AI", tag, collisionPolicy)
value = system.tag.readBlocking(tagPaths)
print 'Tag OPC Item path after change'
print value[0].value
tag = system.tag.getConfiguration("[PLC3]_types_/TGMS/TGMS_INPUT/Config/AI/Alarm Hi SP")
print 'UDT OPC Item Path after change'
print tag[0]['opcItemPath']

```

results (tag OPC item path is read again before tag is reinitialized with change to UDT)

```auto
Tag OPC Item path before change
{bindType=parameter, binding={OPCPath}Cfg_AlarmHiSetpoint}
UDT OPC Item Path before change
{OPCPath}Cfg_AlarmHiSetpoint
[Good]
Tag OPC Item path after change
{bindType=parameter, binding={OPCPath}Cfg_AlarmHiSetpoint}
UDT OPC Item Path after change
{bindType=parameter, binding={OPCPath}Cfg_AlarmHiSetpointNEW}

```

after tag is initialized

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/3/b3df29a597f0ddbe3abfdb2e8726b094ae134cb7.png)

Tried writing just the string as it appears in the editor and that doesn't work either.

---

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [March 21, 2024, 8:06pm UTC](https://forum.inductiveautomation.com/t/using-custom-tag-parameters/87643/4 "2024-03-21T20:06:13Z")

</div>

`tag[0]['opcItemPath']= '{bindType=parameter, binding={OPCPath}Cfg_AlarmHiSetpointNEW}'`

should be done as  
`tag[0]['opcItemPath'] = {'bindType':'parameter', 'binding':'{{OPCPath}Cfg_AlarmHiSetpointNEW'}`

The designer displays as a string and you right in as a string inside the designer but if using script need to write to it as a dictionary.
