tests/logging/py_ext_0@py_ext/py_ext.xml
branch1.1 Korean release
changeset 968 eee7625de1f7
parent 944 52a17be9c4d1
child 1014 e2f7d6c95db0
equal deleted inserted replaced
808:6e205c1f05a0 968:eee7625de1f7
       
     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.3, 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>