Hi,
I’m trying to run a Gateway Scheduled Script that calls a function inside a Script that is define in the Project Library. It works from a button actionperformed script but is not working in the Gateway Scheduled Script. Also I did the INDENT
This is the Script;
def onScheduledEvent():
“”"
A scheduled script that will execute periodically on the gateway.
"""
KPIs.myKPIs()
This is the Error when looking on the Gateway Status;
org.python.core.PySyntaxError: SyntaxError: (“mismatched input ‘KPIs_Script’ expecting INDENT”, (’’, 2, 0, ‘KPIs_Script.myKPIs()\n’))
at org.python.core.ParserFacade.fixParseError(ParserFacade.java:95)
at org.python.core.ParserFacade.parse(ParserFacade.java:205)
at org.python.core.Py.compile_flags(Py.java:2205)
at com.inductiveautomation.ignition.common.script.ScriptManager.compileFunction(ScriptManager.java:899)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.compileFunctionSuper(ProjectScriptLifecycle.java:638)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.getOrCreateDelegate(ProjectScriptLifecycle.java:737)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.(ProjectScriptLifecycle.java:728)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.compileFunction(ProjectScriptLifecycle.java:623)
at com.inductiveautomation.ignition.common.script.ScheduledScriptManager$ScheduledScriptTask.run(ScheduledScriptManager.java:133)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)