class EventCallback

An instance of this class is passed to any event function, which is registered with .reg_event(…, as_thread=True) or .reg_timerevent(…, as_thread=True) for IOs.


If event functions are created for event monitoring, they must accept a transfer parameter! In this example, it is called eventcallback, but it can also have ecb or other short names.

def my_function(eventcallback):
    # Name of the IO, which triggered this event
    # Value of the IO, at the Trigger point
    # Simple 3 second wait time, without program blocking

  • .ioname
    Returns the Name of the IO, that triggered the event.

  • .iovalue
    Returns the value of the IO at the trigger time.



Waits the specified time in seconds before the function continues.
NOTE: Unlike time.sleep(seconds), using .exit.wait(seconds) can abort wait by calling .stop(). You get a return value False (full time waited) or True (aborted), to control next steps in your code!


Returns True if the .stop() function has been called for EventCallback. This is for the global termination of the execution.


Sets the return value of .exit.is_set() to True, and aborts all .exit.wait(seconds) operations that will return True as the return value. With this method you can exit a loop, for example.

Example: Bennis Run – Threads in the mainloop()