I am trying to execute a script on a tag on the valueChanged event. I know that you cannot use invokeLater() as this is a client scoped function. Instead, I am trying to use a Python Timer thread.
When I put this code in the script console, it executes as expected. However, when I put this code in a tag script, it does not fire at all but throws no errors either.
if currentValue.value == 1: from threading import Timer def Clear(): system.tag.write("some/tag",0) Timer(4.0, Clear).start()
The odd thing is that when I put Clear() instead of just Clear, the function fires immediately without waiting for the time specified in Timer.
Any ideas as to this behavior?