tests/logging/py_ext_0@py_ext/py_ext.xml
changeset 914 94436558f0ce
child 944 52a17be9c4d1
equal deleted inserted replaced
913:5d6a04abab3c 914:94436558f0ce
       
     1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
       
     2 <Python xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="py_ext_xsd.xsd">
       
     3 <![CDATA[import threading
       
     4 
       
     5 MyT = None
       
     6 Stop = False
       
     7 
       
     8 def DoLog():
       
     9     global MyT,Stop
       
    10     MyT=threading.Timer(0.03, DoLog)
       
    11     if not Stop : MyT.start()
       
    12     Stop = False
       
    13     PLCObject.LogMessage("Python side Logging")
       
    14 
       
    15 def StopLog():
       
    16     global MyT,Stop
       
    17     Stop=True
       
    18     if MyT is not None: MyT.cancel()
       
    19 
       
    20 _runtime_begin.append(DoLog)
       
    21 _runtime_cleanup.append(StopLog)
       
    22 ]]>
       
    23 </Python>