# Best Way to Copy Parameter Values to OPC?

**URL:** <https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057>\
**Category:** Ignition\
**Created:** [March 22, 2025, 8:50pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057 "2025-03-22T20:50:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://forum.inductiveautomation.com/u/ChZeman)\
**Post date:** [March 22, 2025, 8:50pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/1 "2025-03-22T20:50:07Z")

</div>

I've been building a UDT that contains a number of parameters. Is there a way to copy or bind the parameter values to OPC tags? I've been reading the docs and forum most of the day but am coming up empty-handed.

Thank you,  
Chris

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [March 22, 2025, 9:02pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/2 "2025-03-22T21:02:01Z")

</div>

What exactly do you mean "bind the parameters to OPC Tags"?  
Can you show an example of what you are attempting?

---

<div class="post-metadata">

**Author:** ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://forum.inductiveautomation.com/u/ChZeman)\
**Post date:** [March 22, 2025, 9:25pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/3 "2025-03-22T21:25:25Z")

</div>

I've tried a number of things that didn't work and removed them so I'll just explain what I'm attempting.

I have a number of PLCs in the field running identical programs. They're used for monitoring buildings and controlling lighting. I created a UDT that contains all my alarm tags and other tags I want to monitor. It also contains a number of parameters that define how each building is set up.

For example, I have a parameter called "Area Lighting Enabled." I want to write the parameter's value to the OPC tag for the PLC.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [March 22, 2025, 9:33pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/4 "2025-03-22T21:33:35Z")

</div>

Normally you wouldn't use a parameter for changing data like that. You would set up a UDT for one of these PLCs and use parameters to redirect the OPC paths of the tags to a particular PLC with indirect references.  
You then directly access the tags that now all point at the correct PLC.  
Is there a reason you are trying to use parameters for this?

---

<div class="post-metadata">

**Author:** ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://forum.inductiveautomation.com/u/ChZeman)\
**Post date:** [March 22, 2025, 9:52pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/5 "2025-03-22T21:52:59Z")

</div>

I'm not sure I understand what you're describing in the first paragraph.

I started using the UDT so I can define items such as building number, building name, etc., and use the parameters in alarm messages. Every PLC is running the same program and I deploy a new data instance based on that UDT for each building.

It occurred to me I could expand on that and use parameters for far more and simplify what I currently do. Although all the PLCs are running the same program, each building is different. One such difference would be the use of risers vs FM200 systems.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [March 22, 2025, 11:47pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/6 "2025-03-22T23:47:42Z")

</div>

Try posting a screenshot of your UDT and explain what you want to achieve, it's hard to understand without an example.

---

<div class="post-metadata">

**Author:** ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://forum.inductiveautomation.com/u/ChZeman)\
**Post date:** [March 23, 2025, 12:07am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/7 "2025-03-23T00:07:21Z")

</div>

Sure thing!

Example: I want the value in AREA LIGHTING\_Enable to be written to the value in the OPC tag on the right.

 ![MWSnap 2025-03-22, 19_01_58](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/3/4338982b9e0a518d3a70c412135469e0c7883d91.png)

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [March 23, 2025, 12:34am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/8 "2025-03-23T00:34:17Z")

</div>

What are you using to change the parameter value to enable/disable it?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [March 23, 2025, 12:37am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/9 "2025-03-23T00:37:02Z")

</div>

You would bind the tag (the one on the right) to the parameter, not the other way around, although you can bind some things to parameters... pre-defined parameters and custom parameters. You have to manually type them in.

> **[UDT Parameters | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/tags/user-defined-types-udts/udt-parameters#pre-defined-parameters)**
>
> Parameters effectively act as variables that can be referenced by properties on members. A common use case for a parameters in UDTs is to make the OPC Item Path on OPC Tag members dynamic, allowing you to replace parts of the OPC Item Path with the...

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [March 23, 2025, 12:39am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/10 "2025-03-23T00:39:38Z")

</div>

I do think the parameters are being used here in an odd way that probably isn't optimal, but there will be a full solution to the initial use case if we can get the right picture in front of us.

---

<div class="post-metadata">

**Author:** ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://forum.inductiveautomation.com/u/ChZeman)\
**Post date:** [March 23, 2025, 12:49am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/11 "2025-03-23T00:49:10Z")

</div>

I haven't created any screens to change those values (yet). I've been modifying the values in the tag browser.

---

<div class="post-metadata">

**Author:** ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://forum.inductiveautomation.com/u/ChZeman)\
**Post date:** [March 23, 2025, 12:54am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/12 "2025-03-23T00:54:25Z")

</div>

That's what I'm struggling to understand... how to bind the tag to the parameter. I've been through the page you linked to, which I appreciate, at least a dozen times today but can't seem to grasp it for some reason. lol

I'm using parameters to generate alarm messages just fine. I just can't figure out how to write the parameter value to the OPC tag.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [March 23, 2025, 1:01am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/13 "2025-03-23T01:01:21Z")

</div>

Normally a parameter is like a config setting for a UDT, you make a parameter that sets up the UDT in some way, one common example is using a parameter called "PLC" and this would contain the device name you want to reference with the UDT. Then you would write your OPC Tag paths in the UDT using {PLC} in the square brackets so that all your tags update when you manually set the PLC name in the UDT.  
Anything you are binding to from your screens in Ignition would be one of the tags, not a parameter.

In your example, you would bind the Ignition component to the Area Lighting Enabled tag and that binding would directly change the tag value over OPC when written to.

Parameters are not normally set by Ignition, tags are routinely written to by Ignition.

---

<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 23, 2025, 1:01am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/14 "2025-03-23T01:01:48Z")

</div>

It might help if you think about the distinction between tag _ **configuration** _ and tag _ **live** _ data flow. UDTs are tools for _configuring_ lots of tags conveniently, **once**. After that, the data flows through tag _ **values** _.

Tag properties control **how** data flows through tags (and into history, and scaling, and engineering units...), but properties are intended to be **constants** at runtime. UDT parameters are also intended to be **constants** at runtime, in part because tag configuration/reconfiguration is **expensive**.

Scripting _ **can** _ write to UDT parameters at runtime, and write to pretty much any tag properties as desired, but those cause tag reconfiguration. That latter means it is not a good idea. Avoid it.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [March 23, 2025, 1:02am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/15 "2025-03-23T01:02:53Z")

</div>

You'll have to use a script or maybe a combination of derived and memory tags.

---

<div class="post-metadata">

**Author:** ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://forum.inductiveautomation.com/u/ChZeman)\
**Post date:** [March 23, 2025, 1:21am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/16 "2025-03-23T01:21:00Z")

</div>

The UDTs are my constants that I want to send to the PLCs. I'm not looking to go from PLC to UDT parameters. I'm trying to go the other way with the data.

I suppose I can continue with my other plan...

1. Update query to periodically write my parameters the database.
2. Have the PLCs call a PHP script on the web server that reads the tables and converts the data to JSON.
3. Have the PLCs parse the JSON data for the parameters.

It's dirty, but it works and it sounds like Ignition isn't capable of doing what I want in this case.

---

<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 23, 2025, 1:32am UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/17 "2025-03-23T01:32:44Z")

</div>

> [@ChZeman](#):
>
> The UDTs are my constants that I want to send to the PLCs.

UDTs don't get sent to PLCs. Only tag _ **values** _ can be sent to PLCs. UDT parameters and tag configuration properties are entirely **internal** to Ignition.

Sounds like you think a UDT can be treated as a recipe for your PLC. They cannot. UDTs are recipes for _ **Ignition** _.

---

<div class="post-metadata">

**Author:** ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://forum.inductiveautomation.com/u/ChZeman)\
**Post date:** [March 23, 2025, 1:53pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/18 "2025-03-23T13:53:18Z")

</div>

Thank you, Phil, and you are correct. I was absolutely hoping I could use the UDT parameters as recipes. I'll just continue with my original method.

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [March 23, 2025, 2:05pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/19 "2025-03-23T14:05:26Z")

</div>

A parameter change cannot easily (in any straightforward fashion) write its value to an OPC tag, but an OPC tag can be monitored to write its value back to a parameter (via tag change script). Much of your current structure can work within Ignition if you are ok with the OPC tag value being your source of truth, and the parameter value updated automagically thereafter...

> [@ChZeman](#):
>
> I suppose I can continue with my other plan...

If remote configuration (from an HMI) is permitted for your applications, I'm certain that Ignition capable of developing an elegant & straightforward interface.

---

<div class="post-metadata">

**Author:** ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://forum.inductiveautomation.com/u/ChZeman)\
**Post date:** [March 23, 2025, 8:11pm UTC](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057/20 "2025-03-23T20:11:23Z")

</div>

I came up with a solution that works, although not ideal since I have to create twice the tags. I still need to add more parameter categories but this basically does what I needed to do.

I created a folder in my UDT for Local Parameters (containing reference tags that reference the parameters) and another folder for the PLC tags. I then created the following script that runs periodically:

```python
pathBuildings = "[GR_Buildings]Buildings"
Buildings = system.tag.browse(pathBuildings)

for Building in Buildings:
	Categories = ["Area Lighting"]
	
	for Category in Categories:
		tags = system.tag.browse(str(Building['fullPath']) + "/Pars/Local/" + Category)
		
		for tag in tags:
			valPar = tag['value'].value
			
			tagPLC = str(tag['fullPath']).replace("/Local/", "/PLC/")
			valPLC = system.tag.readBlocking(tagPLC)
			
			if str(valPLC[0].quality) == "Good":
				if valPar != valPLC[0].value:
					system.tag.writeBlocking(tagPLC, valPar)

```

[Next page](https://forum.inductiveautomation.com/t/best-way-to-copy-parameter-values-to-opc/104057.md?page=2)
