tests/logging/py_ext_0@py_ext/py_ext.xml
author Edouard Tisserant
Tue, 26 Feb 2013 16:37:17 +0900
changeset 944 52a17be9c4d1
parent 914 94436558f0ce
child 1014 e2f7d6c95db0
permissions -rw-r--r--
Introduce Beremiz Native POU library. Now LOGGER POU is part of Beremiz' native POU library
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Python xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="py_ext_xsd.xsd">
<![CDATA[import threading

MyT = None
Stop = False

def DoLog():
    global MyT,Stop
    MyT=threading.Timer(0.3, DoLog)
    if not Stop : MyT.start()
    Stop = False
    PLCObject.LogMessage("Python side Logging")

def StopLog():
    global MyT,Stop
    Stop=True
    if MyT is not None: MyT.cancel()

_runtime_begin.append(DoLog)
_runtime_cleanup.append(StopLog)
]]>
</Python>