Gateway event script 2

We are facing a issue is running the gateway event script. The script is able to run in script console successfully but when the we input the same script in gateway script in schedule option, it is not showing its status or output. The screenshot of the script written is attach below. We need a assistance regarding this issue if possible.


Can you also show us the schedule settings tab too? And you said it doesn’t show it’s status or output but can you confirm if it executes? And, just to be sure, what is the datatype of the tag you’re writing to?

You should add a logger (as a general practice to all gateway scripts imo) to make sure its running and doing what you expect.

logger = system.util.getLogger("Logger Name")
logger.info("Running gateway script")
results = system.tag.writeBlocking(tagName, value)
logger.info("Results of write: " + str(results))

For instance.

Also, I believe system.tag.writeBlocking requires lists even for singular values so it should be system.tag.writeBlock(['myTag'], ['true'])

Also, are you sure you want to be writing a String of true instead of the boolean value true? I don’t mean to nitpick but if this writing to a boolean tag, I think writing a string of true is not going to work.

Is the project containing that scheduled script enabled? What Ignition version are you running?

Actually, depending on the version, single elements passed as strings will work.

1 Like