# \[SOLVED\] Heartbeat in gateway events not running

**URL:** <https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [October 25, 2023, 7:06pm UTC](https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986 "2023-10-25T19:06:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruben\_Lima](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Ruben\_Lima](https://forum.inductiveautomation.com/u/Ruben_Lima)\
**Post date:** [October 25, 2023, 7:06pm UTC](https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986/1 "2023-10-25T19:06:50Z")

</div>

Hi, im doig a heartbeat between a contrologix and my geteway. I did it using this code  
server = "Ignition OPC UA Server"  
HeartBeatAddress = "ns=1;s=[Contrologix]HeartBeat"  
system.opc.writeValue(server, HeartBeatAddress, 1)

i placed it in my edge getaway too because i wanted to do a fallback client and keep the program runnning.  
In my plc i just receive the value, and if its equal then i change the value to 0, and if it hasnt change in some seconds, flags a variable.

It was working perfectly until i decided to do another one, vinculated with the gateway writing to another variable and in another clients getaway.

In the first parts, i changed variables to see if it was something about the name, but one instance always kept running, in like the 10th change or try, the code just did nothing. I went back to the version in wich it was running and nothing happens.

I already, restarted the 3 gateaways and the PLC. There are no loggs cause it seems to be executing the script, but in my PLC i receive nothing.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/8/b8e3664a2e0c8b0c952e9bc5e010ee5016029ddb.png)

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 25, 2023, 7:39pm UTC](https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986/2 "2023-10-25T19:39:13Z")

</div>

Double check your server name. At some point, the default was changed from `Ignition OPC UA Server` to `Ignition OPC-UA Server`. (Notice the dash)

---

<div class="post-metadata">

**Author:** ![Ruben\_Lima](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Ruben\_Lima](https://forum.inductiveautomation.com/u/Ruben_Lima)\
**Post date:** [October 25, 2023, 7:55pm UTC](https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986/3 "2023-10-25T19:55:24Z")

</div>

just reviewed the servers in the main server and the 2 edges, they all are the same

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/c/dcf5d2adca07420c7a14261919de505ebce6d8a4.png)  
this is the diagnostics enable for the main server  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/b/9bb1e48b1cd95f404aa4dc9a8e4bee5131039046.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 25, 2023, 9:09pm UTC](https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986/4 "2023-10-25T21:09:49Z")

</div>

> [@dkhayes117](#):
>
> Double check your server name. At some point, the default was changed from `Ignition OPC UA Server` to `Ignition OPC-UA Server`. (Notice the dash)

The opposite, actually - it used to have the dash, and no longer does:  
[https://docs.inductiveautomation.com/display/DOC81/7.9+to+8.1+Upgrade+Guide#id-7.9to8.1UpgradeGuide-OPCUADefaultConfigurationChanges](https://docs.inductiveautomation.com/display/DOC81/7.9+to+8.1+Upgrade+Guide#id-7.9to8.1UpgradeGuide-OPCUADefaultConfigurationChanges)

But worth calling out all the same 🙂

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 25, 2023, 9:17pm UTC](https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986/5 "2023-10-25T21:17:31Z")

</div>

On the VMs I use for random questions from all corners, subject to imports of all kinds, I duplicate the loopback connection with both names, so it **just works** ™.

---

<div class="post-metadata">

**Author:** ![Ruben\_Lima](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Ruben\_Lima](https://forum.inductiveautomation.com/u/Ruben_Lima)\
**Post date:** [October 26, 2023, 3:56pm UTC](https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986/6 "2023-10-26T15:56:22Z")

</div>

Thanks all, actually it was something about the timers, my PLC was writing at the same frequency than ignition so it never changed the value. I just added a timer to the writing in my PLC and worked perfectly.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 26, 2023, 4:06pm UTC](https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986/7 "2023-10-26T16:06:20Z")

</div>

Glad you got it working.

Off topic: My vocabulary is fairly ample, but I did have to look up vinculate. I guess I'm not the very model of a modern major general.

For those not familiar with the Pirates of Penzance.

[![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/8/08a90a568f75dc7b9217f28f334cc0db031994f7.jpeg "Pirates of Penzance - Modern Major General") ](https://www.youtube.com/watch?v=X--ngR15_JM)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 26, 2023, 4:30pm UTC](https://forum.inductiveautomation.com/t/solved-heartbeat-in-gateway-events-not-running/80986/8 "2023-10-26T16:30:50Z")

</div>

> [@Ruben\_Lima](#):
>
> my PLC was writing at the same frequency than ignition so it never changed the value

Ah, a common problem when a tag is written from two directions. Use two tags. Toggle or increment one regularly from Ignition for the PLC to monitor, and toggle/increment the other from the PLC for Ignition to monitor.
