Moving objects by plc I have to move an object (cube, camera, ...) according to a value from a industrial plc.
In principle that works fine - but after a short while Blender (2.80) stops working.
I saw, that the Windows Taskmanager shows a continiously increasing number of handles, the nuber of Threads is nearly constant.
Do i have to dispose or kill anything? I can't find any hint :-(
Any comments welcome and many thanks in advance!

    import bpy, time, threading
    def moveObj(val): # reduced to make it easier to understand
        val = val + 0.05
        if val &gt; 20:
            val=0

       bpy.data.objects['MyObject'].location=(val, -val, val*0.5)
       threading.Timer(0.05, moveObj, [val]).start()

    moveObj(2) #call the method with start-value
Your code performs infinite recursions. For every call to moveObj you're creating a thread that in itself calls moveObj again. A solution for your goal is to use a modal operator in combination with a timer to execute a function every x seconds. An example for this can be found in operator_modal_timer.py