I am having some trouble with scoping in Ignition. I am trying to create a persistent class object that I can access from anywhere that is gateway scoped.
I have a script module with a class definition and a couple of functions defined (shared.Simulation):
z = shared.simulation.x.y
In a Data Type definition, I have a tag value change script that calls the run function:
The startup function needs to get called first.
If I put the call to startup (instantiates the object “x” in a memory tag (mytag) value change script, I get no error
However, if I instead put that same call to the startup in a Gateway Event script,(tag value change event) and assign the same memory tag (mytag), then I get an error that shared.Simulation has no attribute “x”, and globals() does not contain the class instance I created using the startup function call.
I thought that tag change event scripts were gateway scoped and so I don’t understand why the object does not seem to exist in the same memory space.