I have a 400 PLC, two CP cards, different IP addresses and slot numbers.
I can use the exchange project to change the ip address if one CP is faulty. but I am not able to change the slot number, which is not working for the 400 PLC redundancy.
Then I am thinking about setting up two OPC devices, one for each CP card, then I can dynamically change OPC device in the tag configuration.
Something like:
But I am cannot find a proper way to write the tag script to point to a common string type memory tag "namePLC", that I can write some script to change the string to point to the working PLC device.
When I've had to do similiar for a DNP3 module we were able to write and change the hostname (i.e. the IP address) using scripting, though we you can't change slot numbers, port numbers etc.
Can you not add all of these tags into UDTs, set the device name as a parameter and write a script to change that parameter in case of comms failure?
To be in details, I dont want to use script to change the instance parameters, otherwise it will thousands of line of script to change each instance of the udt.
I want the Udt to point to common 'PLCname' memory tag, the value of this tag will be the OPC device name of the UDT tags, So I just need to write one script to change the momory tag value, then all of the udt created tags will be pointing to the new PLC.
You cannot. Tag properties cannot be bound to anything outside of UDTs, and only to UDT parameters within UDTs. Changes to tag properties or UDT params/props based on other tags must be written, typically by a change event at the source.
Consider using a UDT parameter that you don't override in the instances. Then you can write to the definition's value to change all of the instances.
The following script will change the UDT parameter default value from "PLC1" to "PLC2", hence all instances are changed, as long the instance tag parameter was not overwritten.
I am using the same method as you have described where the UDT parameter name is set by using system.tag.writeBlocking script
I want to changeover from PLC1 to PLC2 when PLC1 is no longer connected.
I have Connected status from PLC1 (S7-400H) as integer and im using it in IF ELSE script to changeover to PLC2 (S7-400H) when PLC1 is no longer connected.
This script doesn't work for me, I have also tested creating Memory integer tag instead of connected status tag and simulated 0 and 1 but that doesn't work too (parameter name doesn't shift over to the other PLC), the ELSE statement works but the IF does not !!