Reference post: inductiveautomation.com/forum/v … 50&t=16600
While I was able to create a “global” class as suggested in the previous post, I am now having some difficulty with class instances being overwritten.
In the example below, does the instance x get overwritten with it’s initialized values (y=0) every time a call to run() is made from outside the module. For example, if I call this function from a tag value change event? and if so, how would I achieve a persistent class instance?
[code]class myclass:
def init(self)
self.y=0
x=myclass()
def run():
z = x.y[/code]