Redundancy configuration for Siemens 400 PLC

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 !!

Can someone Please help!