# Bind an OPC tag to another OPC tag

**URL:** <https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 24, 2024, 10:44pm UTC](https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414 "2024-04-24T22:44:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marty\_Malone](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@Marty\_Malone](https://forum.inductiveautomation.com/u/Marty_Malone)\
**Post date:** [April 24, 2024, 10:44pm UTC](https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414/1 "2024-04-24T22:44:15Z")

</div>

I have an OPC tag that I want to write to another OPC tag value. How can i achieve this? Do I need to write a script and if so how?

---

<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:** [April 24, 2024, 10:49pm UTC](https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414/2 "2024-04-24T22:49:54Z")

</div>

Yes, you'll need a value change script on the tag that will initiate the write to write its currentValue.value to the other OPC tag.

---

<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:** [April 24, 2024, 11:00pm UTC](https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414/3 "2024-04-24T23:00:58Z")

</div>

Do you want the target continuously updated? Or just copied on some event (or user action)?

---

<div class="post-metadata">

**Author:** ![Marty\_Malone](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@Marty\_Malone](https://forum.inductiveautomation.com/u/Marty_Malone)\
**Post date:** [April 25, 2024, 1:04am UTC](https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414/4 "2024-04-25T01:04:14Z")

</div>

I would like for the target to continuously update. I would like to use getHour24(now()) to update the time on the OPC tag.

---

<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:** [April 25, 2024, 1:09am UTC](https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414/5 "2024-04-25T01:09:42Z")

</div>

> [@Marty\_Malone](#):
>
> getHour24(now())

I'm not sure what you mean here. The target of your write, if an OPC tag, will get its timestamp when its own subscription notes the change you wrote. If your target is a memory tag, its new timestamp will be the time the write occurs. If you want to customize the timestamp written to a memory tag, you will need to construct a qualified value. See this topic:

> [@Can Timestamp of a Tag be written to using a script](https://forum.inductiveautomation.com/t/can-timestamp-of-a-tag-be-written-to-using-a-script/42444):
>
> Hi Folks, Wondering if a Timestamp of a tag can be forced using scripts or any other methods? I want to read a timestamp from OPC, separate to another Boolean value from OPC. These 2 correlate, I want to write the Boolean to a memory tag, and want to force its timestamp to be the timestamp I read over OPC. I know this can be done using a module and would need this developed, just looking for an alternative. When I do a system tag write it creates a Custom Timestamp but I don’t believe this w…

---

<div class="post-metadata">

**Author:** ![Marty\_Malone](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@Marty\_Malone](https://forum.inductiveautomation.com/u/Marty_Malone)\
**Post date:** [April 25, 2024, 1:15am UTC](https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414/6 "2024-04-25T01:15:24Z")

</div>

I have an opc tag that is getting time from one plc and I want to write that value to another opc tag.

I also realized I can use an expression tag using getHour24(now()) so that value will be the current hour from the gateway and I want to use that tag value to write to the opc tag of the plc.

---

<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:** [April 25, 2024, 1:21am UTC](https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414/7 "2024-04-25T01:21:38Z")

</div>

If you're doing that you really don't even need Ignition tags and could just create a gateway timer script to write the value to the PLC(s) directly via OPC with system.opc.writeValue or system.opc.writeValues depending on if you're writing just hours or all the way down to seconds.

> **[system.opc | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-opc)**
>
> OPC Functions

---

<div class="post-metadata">

**Author:** ![Marty\_Malone](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@Marty\_Malone](https://forum.inductiveautomation.com/u/Marty_Malone)\
**Post date:** [April 25, 2024, 1:25am UTC](https://forum.inductiveautomation.com/t/bind-an-opc-tag-to-another-opc-tag/89414/8 "2024-04-25T01:25:01Z")

</div>

Thats perfect. Thank you guys for the help.
