# PLC / Network Redundancy in Ignition

**URL:** <https://forum.inductiveautomation.com/t/plc-network-redundancy-in-ignition/83683>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [January 2, 2024, 2:06pm UTC](https://forum.inductiveautomation.com/t/plc-network-redundancy-in-ignition/83683 "2024-01-02T14:06:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khurram\_sarfraz](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@Khurram\_sarfraz](https://forum.inductiveautomation.com/u/Khurram_sarfraz)\
**Post date:** [January 2, 2024, 2:06pm UTC](https://forum.inductiveautomation.com/t/plc-network-redundancy-in-ignition/83683/1 "2024-01-02T14:06:24Z")

</div>

I have two Redundant SIEMENS S7-400H PLC. I am connected to both of them via Ignition Gateway and have imported the respective tags in two folders in ignition designer

The way it can be achieved is by modifying the .OPCItemPath with a global python script. This script can be triggered to run when a device communication times out. It searches all the tags using the failed device name and replaces it with the redundant device name.

Can someone please help me with develop the script syntax for one tag. Will be grateful!

Thanks

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [January 2, 2024, 3:48pm UTC](https://forum.inductiveautomation.com/t/plc-network-redundancy-in-ignition/83683/2 "2024-01-02T15:48:56Z")

</div>

An easier way is to use `system.device.setDeviceHostname`.

Check out this topic, [Indirect OpcItemPath - #12 by pturmel](https://forum.inductiveautomation.com/t/indirect-opcitempath/74957/12)

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [January 2, 2024, 11:01pm UTC](https://forum.inductiveautomation.com/t/plc-network-redundancy-in-ignition/83683/3 "2024-01-02T23:01:13Z")

</div>

per @jlandwerlen , definitely use `system.device.setDeviceHostname`

I frequently use 'dev' devices and swap names when I'm ready for deployment. Since you're scripting anyway just script the device name change.

i.e. If your primary PLC name is `S7400H` and the backup is `S7400H_2`  
have a script to rename `S7400H` to `S7400H_1`, `S7400H_2` to `S7400H`, then `S7400H_1` to `S7400H_2`.

Now you don't have to do _anything_ with your existing tag paths. Use IPs of the devices then if you need to detect which device is being used (store the IPs in tags and compare against those).

---

<div class="post-metadata">

**Author:** ![Khurram\_sarfraz](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@Khurram\_sarfraz](https://forum.inductiveautomation.com/u/Khurram_sarfraz)\
**Post date:** [January 3, 2024, 8:08am UTC](https://forum.inductiveautomation.com/t/plc-network-redundancy-in-ignition/83683/4 "2024-01-03T08:08:49Z")

</div>

I can understand this but I am new with ignition, is there any tutorial or example i can follow to achieve this task. I need help in applying this on ignition

---

<div class="post-metadata">

**Author:** ![taglias](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@taglias](https://forum.inductiveautomation.com/u/taglias)\
**Post date:** [January 3, 2024, 9:15am UTC](https://forum.inductiveautomation.com/t/plc-network-redundancy-in-ignition/83683/5 "2024-01-03T09:15:17Z")

</div>

The `system.device.setDeviceHostname` function just changes the IP of a device, so it won't work with the Siemens 400H, where you have different rack between the master and the slave (one is rack 0, the other is rack 1, and there's no function in Ignition to change that property at runtime).

Check this post for a solution:  
[Redundancy configuration for Siemens 400 PLC](https://forum.inductiveautomation.com/t/redundancy-configuration-for-siemens-400-plc/80119)

Be careful, if I remember correctly there are cases where both devices (rack 0 and rack 1, independently on who is master) will be connected, but only the master will give you the running values. To handle this cases, you should read a always changing tag (i.e. PLC datetime seconds) on both devices: the master is the one with the tag that changes value.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [January 3, 2024, 1:33pm UTC](https://forum.inductiveautomation.com/t/plc-network-redundancy-in-ignition/83683/6 "2024-01-03T13:33:29Z")

</div>

> [@Khurram\_sarfraz](#):
>
> is there any tutorial or example i can follow to achieve this task

Did you see the link? I described how it would/could look.

---

<div class="post-metadata">

**Author:** ![Khurram\_sarfraz](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@Khurram\_sarfraz](https://forum.inductiveautomation.com/u/Khurram_sarfraz)\
**Post date:** [February 10, 2024, 12:41pm UTC](https://forum.inductiveautomation.com/t/plc-network-redundancy-in-ignition/83683/7 "2024-02-10T12:41:12Z")

</div>

> [@Redundancy configuration for Siemens 400 PLC](https://forum.inductiveautomation.com/t/redundancy-configuration-for-siemens-400-plc/80119/11):
>
> 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 …

The application i have in my project is to only read the values from the PLC and not control. And if the PLC we are connected to is lost (shutdown) our tags should shift over to the Redundant one. This post was very helpful and I think im missing a small trick here, Applying the the udt method where parameter name can be shifted to the other PLC when one PLC which we are connected to is lost ... will solve my problem.. If someone can help .. Thanks
