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:

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.

Parameters:

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
Returns:

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)

Parameters:

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