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
914
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     2
<Python xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="py_ext_xsd.xsd">
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     3
<![CDATA[import threading
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     4
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     5
MyT = None
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     6
Stop = False
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     7
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     8
def DoLog():
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     9
    global MyT,Stop
944
52a17be9c4d1 Introduce Beremiz Native POU library. Now LOGGER POU is part of Beremiz' native POU library
Edouard Tisserant
parents: 914
diff changeset
    10
    MyT=threading.Timer(0.3, DoLog)
914
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    11
    if not Stop : MyT.start()
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    12
    Stop = False
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    13
    PLCObject.LogMessage("Python side Logging")
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    14
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    15
def StopLog():
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    16
    global MyT,Stop
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    17
    Stop=True
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    18
    if MyT is not None: MyT.cancel()
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    19
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    20
_runtime_begin.append(DoLog)
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    21
_runtime_cleanup.append(StopLog)
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    22
]]>
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    23
</Python>