Bind an OPC tag to another OPC tag

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?

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.

1 Like

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

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

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:

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.

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.

Thats perfect. Thank you guys for the help.