--- a/tests/python/c_code@c_ext/cfile.xml Mon May 13 14:31:23 2013 +0200
+++ b/tests/python/c_code@c_ext/cfile.xml Mon May 13 14:36:54 2013 +0200
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<CodeFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="codefile.xsd">
-<![CDATA[#include "stdio.h"]]>
<variable name="TestInput" type="SINT" initial="0"/>
<variable name="TestOutput" type="SINT"/>
-<![CDATA[volatile long Lock=0;
volatile char PtoC=1,CtoP=2;
extern long AtomicCompareExchange(long*,long, long);
@@ -45,21 +47,27 @@
-<![CDATA[if(!AtomicCompareExchange((long*)&Lock, 0, 1)){
+if(!AtomicCompareExchange((long*)&Lock, 0, 1)){ TestInput = CtoP + PtoC + TestOutput;
AtomicCompareExchange((long*)&Lock, 1, 0);
--- a/tests/python/python@py_ext/pyfile.xml Mon May 13 14:31:23 2013 +0200
+++ b/tests/python/python@py_ext/pyfile.xml Mon May 13 14:36:54 2013 +0200
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<CodeFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="codefile.xsd">
<variable name="Test_Python_Var" type="INT" initial="0"/>
-<![CDATA[import time,sys,ctypes
Python_to_C_Call = PLCBinary.Python_to_C_Call
Python_to_C_Call.restype = ctypes.c_int
Python_to_C_Call.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)]
@@ -40,16 +38,28 @@
+print "py_runtime init:", x, ",", y +print "py_runtime cleanup" +print "py_runtime start", x * x + y * y