andrej@1639: <?xml version='1.0' encoding='utf-8'?> andrej@1639: <PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> andrej@1639: <variables/> andrej@1639: <globals> andrej@1639: <xhtml:p><![CDATA[import threading, time andrej@1639: andrej@1639: MyT = None andrej@1639: Stop = False andrej@1639: andrej@1639: def StartLog(): andrej@1639: global MyT andrej@1639: MyT=threading.Thread(target = DoLog) andrej@1639: MyT.start() andrej@1639: andrej@1639: def DoLog(): andrej@1639: global Stop andrej@1639: while not Stop: andrej@1639: PLCObject.LogMessage("Python side Logging (PLC is %s)"%PLCObject.PLCStatus) andrej@1639: time.sleep(0.3) andrej@1639: andrej@1639: def StopLog(): andrej@1639: global MyT,Stop andrej@1639: Stop=True andrej@1639: andrej@1639: _runtime_init.append(StartLog) andrej@1639: _runtime_cleanup.append(StopLog) andrej@1639: ]]></xhtml:p> andrej@1639: </globals> andrej@1639: <init> andrej@1639: <xhtml:p><![CDATA[]]></xhtml:p> andrej@1639: </init> andrej@1639: <cleanup> andrej@1639: <xhtml:p><![CDATA[]]></xhtml:p> andrej@1639: </cleanup> andrej@1639: <start> andrej@1639: <xhtml:p><![CDATA[]]></xhtml:p> andrej@1639: </start> andrej@1639: <stop> andrej@1639: <xhtml:p><![CDATA[]]></xhtml:p> andrej@1639: </stop> andrej@1639: </PyFile>