I am getting a bizarre error from a script running on a tag ValueChange event.
The script calls a shared function, but I am getting an error that the global name ‘shared’ is not defined. I can open the script console and call this function without any problems. I also set up a test tag that called the same function and it worked fine.
The gateway is running 7.9.10. Anybody know what is causing this.
def getWeather() :
if currentValue.value == 1 :
system.tag.write("[.]Lift Start Time", system.date.now())
shared.weather.getWeather()
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 5, in valueChanged NameError: global name 'shared' is not defined
at org.python.core.Py.NameError(Py.java:260)
at org.python.core.PyFrame.getglobal(PyFrame.java:265)
at org.python.pycode._pyx3.valueChanged$1(:32)
at org.python.pycode._pyx3.call_function()
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyBaseCode.call(PyBaseCode.java:301)
at org.python.core.PyFunction.function___call__(PyFunction.java:376)
at org.python.core.PyFunction.__call__(PyFunction.java:371)
at org.python.core.PyFunction.__call__(PyFunction.java:361)
at org.python.core.PyFunction.__call__(PyFunction.java:356)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:649)
at com.inductiveautomation.ignition.common.sqltags.scripts.TagScriptManager$FunctionInvokerImpl.run(TagScriptManager.java:493)
at com.inductiveautomation.ignition.common.sqltags.scripts.AbstractTagScript.invoke(AbstractTagScript.java:33)
at com.inductiveautomation.ignition.common.sqltags.scripts.TagScriptManager$Task.invoke(TagScriptManager.java:442)
at com.inductiveautomation.ignition.common.sqltags.scripts.TagScriptManager$TagScriptDispatcher.run(TagScriptManager.java:405)
at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:518)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.python.core.PyException: Traceback (most recent call last): File "", line 5, in valueChanged NameError: global name 'shared' is not defined
... 23 common frames omitted