author | Edouard Tisserant |
Tue, 26 Mar 2013 12:44:44 +0900 | |
changeset 1002 | 15c05ba95df4 |
parent 944 | 52a17be9c4d1 |
child 1014 | e2f7d6c95db0 |
permissions | -rw-r--r-- |
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> |