Can anyone tell me if I am missing a fundamental rule about using Gateway Timer Scripts that would prevent me from calling a system function from within another function?
For example:
In a Gateway Timer Script, I can execute the following without issue:
now = system.date.now()
However, if I put that code inside a function and then call it like this:
def GetNow():
return system.date.now()
GetNow()
I get the following error message in the logs:
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 4, in File "", line 2, in GetNow NameError: global name 'system' is not defined
Obviously this code is for example and serves no real purpose, but this is the case for any system function I try to call from within my function. Thanks in advance for any insight.