Write to client memory tag fails in tag event, yet succeeds in client timer event

Sounds like you need to write a driver.

Mainly because you need locking. But jython-based locking in Ignition is extremely difficult to implement correctly, because the jython life cycle for Ignition is based on projects--project saves due to designer edits throw away your code and any locks and sockets you might have created. But if you have threads running with those existing code modules and objects, they'll continue living in parallel until the thread exits.

See this recent topic and all its linked discussions:

TL/DR: Don't use sockets in anything but gateway (not Perspective) scope, and just open/write/read/close in a single operation unless you follow all the "rules" for long-lived threads and objects.

1 Like