tests/python/python@py_ext/pyfile.xml
changeset 1401 611fded24ce4
parent 1145 203f4eff3313
child 2680 6bfed6757495
equal deleted inserted replaced
1400:65a751cbb9b9 1401:611fded24ce4
     1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
     1 <?xml version='1.0' encoding='utf-8'?>
     2 <PyFile>
     2 <PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml">
     3   <variables>
     3   <variables>
     4     <variable name="Test_Python_Var" type="INT" initial="4"/>
     4     <variable name="Test_Python_Var" type="INT" initial="4"/>
     5     <variable name="Second_Python_Var" type="INT" initial="5"/>
     5     <variable name="Second_Python_Var" type="INT" initial="5"/>
     6   </variables>
     6   </variables>
     7   <globals>
     7   <globals>
     8 <![CDATA[
     8     <xhtml:p><![CDATA[
     9 import time,sys,ctypes
     9 import time,sys,ctypes
    10 Python_to_C_Call = PLCBinary.Python_to_C_Call
    10 Python_to_C_Call = PLCBinary.Python_to_C_Call
    11 Python_to_C_Call.restype = ctypes.c_int
    11 Python_to_C_Call.restype = ctypes.c_int
    12 Python_to_C_Call.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)]
    12 Python_to_C_Call.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)]
    13 
    13 
    37 a.start()
    37 a.start()
    38 
    38 
    39 b = Timer(6, badaboomwx)
    39 b = Timer(6, badaboomwx)
    40 b.start()
    40 b.start()
    41 """
    41 """
    42 ]]>
    42 ]]></xhtml:p>
    43   </globals>
    43   </globals>
    44   <init>
    44   <init>
    45 <![CDATA[
    45     <xhtml:p><![CDATA[
    46 global x, y
    46 global x, y
    47 x = 2
    47 x = 2
    48 y = 5
    48 y = 5
    49 print "py_runtime init:", x, ",", y
    49 print "py_runtime init:", x, ",", y
    50 ]]>
    50 ]]></xhtml:p>
    51   </init>
    51   </init>
    52   <cleanup>
    52   <cleanup>
    53 <![CDATA[
    53     <xhtml:p><![CDATA[
    54 print "py_runtime cleanup"
    54 print "py_runtime cleanup"
    55 ]]>
    55 ]]></xhtml:p>
    56   </cleanup>
    56   </cleanup>
    57   <start>
    57   <start>
    58 <![CDATA[
    58     <xhtml:p><![CDATA[
    59 global x, y
    59 global x, y
    60 print "py_runtime start", x * x + y * y
    60 print "py_runtime start", x * x + y * y
    61 ]]>
    61 ]]></xhtml:p>
    62   </start>
    62   </start>
    63   <stop>
    63   <stop>
    64 <![CDATA[
    64     <xhtml:p><![CDATA[
    65 print "py_runtime stop"
    65 print "py_runtime stop"
    66 ]]>
    66 ]]></xhtml:p>
    67   </stop>
    67   </stop>
    68 </PyFile>
    68 </PyFile>