# Title: Intermittent Gateway Tag Event delays / PLC heartbeat timeout on script-heavy InTouch 2012 migration

**URL:** <https://forum.inductiveautomation.com/t/title-intermittent-gateway-tag-event-delays-plc-heartbeat-timeout-on-script-heavy-intouch-2012-migration/117327>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [October 5, 2026, 1:10pm UTC](https://forum.inductiveautomation.com/t/title-intermittent-gateway-tag-event-delays-plc-heartbeat-timeout-on-script-heavy-intouch-2012-migration/117327 "2026-10-05T13:10:50Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [October 5, 2026, 3:06pm UTC](https://forum.inductiveautomation.com/t/title-intermittent-gateway-tag-event-delays-plc-heartbeat-timeout-on-script-heavy-intouch-2012-migration/117327/4 "2026-10-05T15:06:27Z")

</div>

Can you clarify if you mean Gateway Tag Change Events which are defined in the project, or Tag Value Change Events which are defined on the tag. There reason is you seem to mix you language between these two things.

e.g.

> [@Desmond\_Tobin](#):
>
> The application communicates with several Rockwell PLCs and makes extensive use of UDTs and **Gateway Tag Change scripts**.
> 
> We probably have a few hundred **Tag Value Changed scripts** across the application, many inherited through UDTs.

Emphasis added.

These are two very different things with very different constraints.

Later in the post you provide a script which includes a `def` statement, but Gateway Event Scripts do not include this.

> [@Desmond\_Tobin](#):
>
> ```python
> def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
> 
> if not initialChange:
> system.tag.writeBlocking(
> [destination],
> [currentValue.value]
> )
> 
> ```

If you are in fact using Tag Value Change Events, and you are reaching out to databases and/or performing blocking writes, I wouldn't be suprised if you are having issues.

Here are some posts with pertinent information:

> [@Tag Value Change Scripts: Are They Run Asynchronously?](https://forum.inductiveautomation.com/t/tag-value-change-scripts-are-they-run-asynchronously/53749/7):
>
> Note that they are also running in a thread pool. If you have lots of events with slow execution, other tag events can be delayed.

> [@Update another tag using a tag value changed script syntax question](https://forum.inductiveautomation.com/t/update-another-tag-using-a-tag-value-changed-script-syntax-question/102439/9):
>
> I just started typing that.... My more modern advice, based on more knowledge, is that tag event scripts (on the tag) should run in single digits milliseconds, no exceptions. That means you cannot use any system.\* functions that would wait on a database or wait on any network exchange. And never sleep or busy-wait. You cannot use system.tag.writeBlocking() on anything but memory tags. You cannot interact with the DB except via system.db.runSFPrepUpdate(). You cannot use system.opc.\* at al…

---

_[View the full topic](https://forum.inductiveautomation.com/t/title-intermittent-gateway-tag-event-delays-plc-heartbeat-timeout-on-script-heavy-intouch-2012-migration/117327)._
