Dynamic Tag Path Generation for Read Redundancy

Hello! Here is a problem I have been struggling with in the project I am implementing.

Basically I have two PLC’s at two separate IP addresses that have identical data in them. Ideally the project will read from one of them, then if it goes down it will switch to the other one and read from it.

My basic plan to implement this was to create a tag that specified the current PLC address. Then have a script change it to the secondary PLC address if the first one lost connection. Then I was going to make all my tags have a dynamic path like this: ns=1;s=[CurrentSite]10.MHR351 where CurrentSite was the tag that held the current PLC to read from.

However I cannot find a way to make a tag’s OPC item path indirect without using a UDT, and I don’t think it seems like a good idea to wrap my entire project’s tags up in a UDT.

Is there another way to implement this that i am missing. Thanks! -Josh

No, an OPC item path cannot have anything but UDT parameters as indirect. However, you could have your script search for item paths with one driver and rewrite them to the other.

Thanks for the reply PTurmel,
We are talking about a 1000 tags that would need to be switched. Would it be very innefficient or lead to any kinds of problems on the system switching over 1000 tags paths with a script when the system changes… It should only happne once a month or so. What would I use to rewrite a tags path? system.tag.editTags?

There’s something like “Ethernet Failover Switch” used by many SI’s for PLC redundancy since a decade. I don’t remember the exact technical term but this will automatically switch over and provide one static ip for your server without affecting PLC ip’s… Do some google research and talk to some router/NW hardware local suppliers, you will definitely find one.

Just check this one to get an idea:

Yes, I would use a combination of browseTags() and editTags().