# Cannot Get Gateway Tag Change Event to Run

**URL:** <https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [February 7, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824 "2022-02-07T19:29:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Velazquez](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Marc\_Velazquez](https://forum.inductiveautomation.com/u/Marc_Velazquez)\
**Post date:** [February 7, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/1 "2022-02-07T19:29:24Z")

</div>

Feel like I should apologize for the noob question, but after several days my frustration is getting up there. I’m very simply trying to get a Gateway Tag Change event to work. I have two memory tags, btnclk and GwayYes, both set for boolean. I set up a button in my project to change btnclk to true on the Component Scripting event action performed.

I then set up a Gateway Tag Change event using the btnclk tag for the trigger, and used the following for the script:  
import system  
val = u’true’  
system.tag.writeBlocking(["[default]PRECURE/GwayYes"], [val])

I can see the btnclk tag turn to true but the GwayYes tag does not change. I can get these scripts to run successfully in the Client/Component events, but not the Gateway events. Am I missing something? I do need the ability to use Gateway Change events for my project.

---

<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:** [February 7, 2022, 7:40pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/2 "2022-02-07T19:40:18Z")

</div>

Don’t use the string ‘true’. Use the actual Python `True` keyword, no quotes. Like so:

```auto
system.tag.writeBlocking(["[default]PRECURE/GwayYes"], [True])

```

---

<div class="post-metadata">

**Author:** ![Marc\_Velazquez](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Marc\_Velazquez](https://forum.inductiveautomation.com/u/Marc_Velazquez)\
**Post date:** [February 7, 2022, 7:51pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/3 "2022-02-07T19:51:34Z")

</div>

Thank you for looking at this. Unfortunately I’m still not seeing the GwayYes tag change to True. I wrote the line as you have above with and without the import system qualifier. I also double checked the tags and made sure they were public. I also checked that the read/write gateway communications was on as well.

I don’t understand how this could be a rights issue as this should be all internal, but I don’t know what else to attribute this problem to.

---

<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:** [February 7, 2022, 7:55pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/4 "2022-02-07T19:55:33Z")

</div>

Are you trying to do this with Ignition Edge? It doesn’t have gateway scripting unless you buy the compute module for it.

---

<div class="post-metadata">

**Author:** ![Marc\_Velazquez](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Marc\_Velazquez](https://forum.inductiveautomation.com/u/Marc_Velazquez)\
**Post date:** [February 7, 2022, 8:03pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/5 "2022-02-07T20:03:11Z")

</div>

No sir, I believe I have the standard edition and not Edge.

- License Key

- Version

- edition

- platform

- numbers

- 8

- standard

- true

---

<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:** [February 7, 2022, 8:03pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/6 "2022-02-07T20:03:38Z")

</div>

Delete that license key!

---

<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:** [February 7, 2022, 8:07pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/7 "2022-02-07T20:07:40Z")

</div>

Try this. Create a gateway timer event, with a five-second period, and use this script:

```auto
logger = system.util.getLogger("myTestLogger")
logger.info("Timer Script")

```

After you save your project, “Timer Script” should start showing up in your gateway log.

Next, add those two lines to the top of your tag change event, changing “Timer” to “Tag”. It should show up once when you save your project, then again on each change.

---

<div class="post-metadata">

**Author:** ![Marc\_Velazquez](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Marc\_Velazquez](https://forum.inductiveautomation.com/u/Marc_Velazquez)\
**Post date:** [February 7, 2022, 8:28pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/8 "2022-02-07T20:28:45Z")

</div>

I get an error for notifying listener about project update:  
IgnitionProjectManager 07Feb2022 15:23:42 Error notifying listener about project update.  
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0  
at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source)  
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source)  
at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source)  
at java.base/java.util.Objects.checkIndex(Unknown Source)  
at java.base/java.util.ArrayList.get(Unknown Source)  
at com.inductiveautomation.ignition.gateway.tags.model.ProjectDefaultTagManagerFacade.unsubscribeAsync(ProjectDefaultTagManagerFacade.java:203)

Obviously there is more but I’m not sure what to look for.

---

<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:** [February 7, 2022, 8:32pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/9 "2022-02-07T20:32:32Z")

</div>

Hmm. Never seen that one. You might want to get support involved.

---

<div class="post-metadata">

**Author:** ![Marc\_Velazquez](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Marc\_Velazquez](https://forum.inductiveautomation.com/u/Marc_Velazquez)\
**Post date:** [February 8, 2022, 4:05pm UTC](https://forum.inductiveautomation.com/t/cannot-get-gateway-tag-change-event-to-run/55824/10 "2022-02-08T16:05:38Z")

</div>

I did contact support and Aaron was kind enough to work through the issue. The logger was not seeing the changes. After trying another test we decided to reboot the Ignition services on the server. Once that was accomplished then the project and Gateway Tag Change event behaved as it should. Apparently something that was not getting through previously was causing the system to hang up in some areas.

So once again follow the IT Crowd advice: have you tried turning it on and off again? Thanks @pturmel for the help.
