OPC UA tag mirroring

Hey, i have my ignition server set up as an OPC UA client connected to multiple OPC UA servers. I want to mirror the value of some tags from one opc server to another. As an example: tag A in OPC UA server A has a value i want to write into Tag B in OPC UA server B. I'm able to do this using the writeblocking when the value on tag A changes. However if the PLC that runs server B resets its value the script wont write the value from A again because that value hasn’t changed. I want to mirror them all the time or somehow check if the value are the sameand if not then write from A to B. Is it possible?

See my Integration Toolkit's Republish Tag Action.

Be aware that if you are calling system.tag.writeBlocking(), or system.opc.writeValues(), from a tag's valueChange event, any stall on the write will start an event processing pileup in the tag system. Potentially leading to a complete stall.

Some reading for you:

https://forum.inductiveautomation.com/search?q=tag%20event%20stall%20%40pturmel%20order%3Alatest

There's no fix for recipient overwrites except to occasionally run a cleanup script.

Thanks, it works great but when does it republish the value? With a fixed rate or is it only when the value is changed on the source tag?

It publishes whenever a new value passes through the tag's actor pipeline. For OPC tags, that would be whenever the OPC server delivers a change, or the first value of a new/restored subscription. The tag actor is upstream of the tag subsystem's own change detection, IIUC.

Would the SQL bridge module work for this? I've never had to actually use it, but can't you set them up to periodically write OPC values?

It can do DB to OPC, but not OPC to OPC.

So besides your republish tag action, about the only way to guarantee the value always matches is to have a timed gateway task and do async writes. You could do async reads, compare, then write changes I guess if you wanted to reduce writes. Guess it really depends how frequent these tags change on the destination side.

1 Like