Edouard@914: <?xml version="1.0" encoding="UTF-8" standalone="no"?>
Edouard@914: <Python xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="py_ext_xsd.xsd">
Edouard@1014: <![CDATA[import threading, time
Edouard@914: 
Edouard@914: MyT = None
Edouard@914: Stop = False
Edouard@914: 
Edouard@1014: def StartLog():
Edouard@1014:     global MyT
Edouard@1014:     MyT=threading.Thread(target = DoLog)
Edouard@1014:     MyT.start()
Edouard@1014: 
Edouard@914: def DoLog():
Edouard@1014:     global Stop
Edouard@1014:     while not Stop:
Edouard@1014:         PLCObject.LogMessage("Python side Logging (PLC is %s)"%PLCObject.PLCStatus)
Edouard@1014:         time.sleep(0.3)
Edouard@914: 
Edouard@914: def StopLog():
Edouard@914:     global MyT,Stop
Edouard@914:     Stop=True
Edouard@914: 
Edouard@1014: _runtime_init.append(StartLog)
Edouard@914: _runtime_cleanup.append(StopLog)
Edouard@914: ]]>
Edouard@914: </Python>