HSL 2.0 framework
Description of the framework
|
All methods of the Timer object. More..
Public Member Functions | |
def | __init__ (self, framework) |
Constructor. More... | |
def | set_timer (self, timeout, callback, arguments=()) |
Sets the time and the callback method to be called after the timer starts. More... | |
def | stop (self) |
Stops the timer. More... | |
def | start (self) |
Starts the timer. More... | |
All methods of the timer object
An example for the implementation of a timer is enclosed: 10708_MyTimer.py
The example code creates a timer at the first input telegram at input 1 or 2 and starts it. The timer is restarted with each subsequent telegram
Thus the timer is only triggered if no further telegram arrives at the input within the time defined at input 3. If a 1 is sent at input 4, a running timer is stopped
def hsl20_4_timer.hsl20_4_timer.Timer.__init__ | ( | self, | |
framework | |||
) |
Constructor
def hsl20_4_timer.hsl20_4_timer.timer.set_timer | ( | self, | |
timeout, | |||
callback, | |||
arguments = () |
|||
) |
Sets the time and the callback method to be called after the timer is started
timeout | int Time in ms |
callback | function Callback |
arguments | tuple Optional. The elements of the tuple are passed as parameters to the callback method when called |
RuntimeError | If this method is called while the timer is already running, a RuntimeError exception is thrown |
def hsl20_4_timer.hsl20_4_timer.timer.start | ( | self | ) |
def hsl20_4_timer.hsl20_4_timer.timer.stop | ( | self | ) |
Stops the timer