tests/logging/py_ext_0@py_ext/py_ext.xml
author Surkov Sergey <surkovsv93@gmail.com>
Tue, 10 Jan 2017 14:08:49 +0300
changeset 1621 4485e6478b91
parent 1014 e2f7d6c95db0
permissions -rw-r--r--
fix doubling search results in Search Result Panel

After fix local search in SFC POU in 163d3a8, search results tree assemble with "children" branches: results of search in actions anf transitions. Deleted code doubling this search results into one more separate branch, so it's useless.
<?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, time

MyT = None
Stop = False

def StartLog():
    global MyT
    MyT=threading.Thread(target = DoLog)
    MyT.start()

def DoLog():
    global Stop
    while not Stop:
        PLCObject.LogMessage("Python side Logging (PLC is %s)"%PLCObject.PLCStatus)
        time.sleep(0.3)

def StopLog():
    global MyT,Stop
    Stop=True

_runtime_init.append(StartLog)
_runtime_cleanup.append(StopLog)
]]>
</Python>