I’ve put the following code in a gateway timer script and in the action performed event handler of a vision client button. In the vision button it performs exactly how I expect it would, printing to the console. In the gateway script I expected to see a print out in the wrapper.log file, but I didn’t. I instead got
NameError: global name 'testVar' is not defined
I must be misunderstanding some nuance of scoping in gateway event scripts. Could someone point me in the right direction toward understanding this?
Since a gateway event script is associated with a project, can a project level script module be used or does it require a gateway accessible script module?
Project scripts are fine. That’s one of the reasons I prefer (and recommend) gateway tag change events (in the project) over Value/Quality/Timestamp tag events (not in a project).