Cannot Get Gateway Tag Change Event to Run

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.

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

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

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.

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

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

  • License Key

  • Version

  • edition

  • platform

  • numbers

  • 8

  • standard

  • true

Delete that license key!

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

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.

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.

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

1 Like

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.

1 Like