10.15. timer

Currently, itom does not support the threading module from python. Therefore, no timed calls of python functions are possible using this module. However, the itom provides the timer class to allow such calls:

10.15.1. timer-Class

class itom.timer(interval, callbackFunc[, argTuple, singleShot]) → new callback timer

Creates a timer object that continuously calls a python callback function or method with a certain interval. The timer is active after construction and stops when this instance is destroyed or stop() is called.


interval : {int}

time out interval in ms

callbackFunc: {function, method} :

Python function that should be called when timer event raises

argTuple: {tuple}, optional :

tuple of parameters passed as arguments to the callback function

singleShot: {bool}, optional :

defines if this timer only fires one time after its start (True) or continuously (False, default)

isActive() → returns timer status

status : {bool}

True if the timer is running, otherwise False.

setInterval(interval) → sets timer interval in [ms]

This method sets the timeout interval in milliseconds. The timer calls the callback function continuously after this interval (if started)


interval : {int}

timeout interval in milliseconds. The callback function is continuously called after this timeout once the timer is started.

start() → starts timer

Starts or restarts the timer with its timeout interval. If the timer is already running, it will be stopped and restarted.

stop() → stops timer