--- a/tests/python/c_code@c_ext/cfile.xml Mon Oct 22 17:39:13 2012 +0200
+++ b/tests/python/c_code@c_ext/cfile.xml Tue Oct 23 11:34:37 2012 +0200
@@ -15,7 +15,7 @@
-int Python_to_C_Call(int toC, int *fromC){
+int Python_to_C_Call(char toC, char *fromC){ /* Code called by python should never touch to
variables modified by PLC thread directly
@@ -33,7 +33,7 @@
-int PLC_C_Call(int fromPLC, int *toPLC){
+int PLC_C_Call(char fromPLC, char *toPLC){ /* PLC also have to be realy carefull not to
conflict with asynchronous python access */
--- a/tests/python/plc.xml Mon Oct 22 17:39:13 2012 +0200
+++ b/tests/python/plc.xml Tue Oct 23 11:34:37 2012 +0200
@@ -8,7 +8,7 @@
creationDateTime="2008-12-14T16:21:19"/>
<contentHeader name="Beremiz Python Support Tests"
- modificationDateTime="2012-10-19T11:54:13">
+ modificationDateTime="2012-10-23T00:54:38"> <pageSize x="1024" y="1024"/>
@@ -114,21 +114,21 @@
<inVariable localId="4" height="30" width="160">
- <position x="295" y="235"/>
+ <position x="295" y="230"/> <relPosition x="160" y="15"/>
<expression>'time.sleep(1)'</expression>
<block localId="5" width="125" height="80" typeName="python_eval" instanceName="py1">
- <position x="650" y="185"/>
+ <position x="650" y="180"/> <variable formalParameter="TRIG">
<relPosition x="0" y="35"/>
<connection refLocalId="7" formalParameter="OUT">
- <position x="650" y="220"/>
- <position x="285" y="220"/>
+ <position x="650" y="215"/> + <position x="285" y="215"/> <position x="285" y="260"/>
<position x="250" y="260"/>
@@ -138,8 +138,8 @@
<relPosition x="0" y="65"/>
<connection refLocalId="4">
- <position x="650" y="250"/>
- <position x="455" y="250"/>
+ <position x="650" y="245"/> + <position x="455" y="245"/> @@ -241,10 +241,10 @@
<relPosition x="290" y="15"/>
- <expression>'sys.stdout.write("1234\n")'</expression>
+ <expression>'sys.stdout.write("FBID :"+str(FBID)+"\n")'</expression> <inVariable localId="11" height="30" width="290">
- <position x="290" y="465"/>
+ <position x="295" y="465"/> <relPosition x="290" y="15"/>
@@ -269,7 +269,7 @@
<relPosition x="0" y="63"/>
<connection refLocalId="11">
<position x="650" y="480"/>
- <position x="580" y="480"/>
+ <position x="585" y="480"/> @@ -357,8 +357,8 @@
<connection refLocalId="5" formalParameter="RESULT">
<position x="1065" y="545"/>
<position x="905" y="545"/>
- <position x="905" y="250"/>
- <position x="775" y="250"/>
+ <position x="905" y="245"/> + <position x="775" y="245"/> @@ -422,14 +422,14 @@
<expression>pytest_var1</expression>
<block localId="21" width="80" height="120" typeName="MUX">
- <position x="985" y="170"/>
+ <position x="985" y="165"/> <variable formalParameter="K">
<relPosition x="0" y="30"/>
<connection refLocalId="22">
- <position x="985" y="200"/>
- <position x="950" y="200"/>
+ <position x="985" y="195"/> + <position x="950" y="195"/> @@ -437,8 +437,8 @@
<relPosition x="0" y="50"/>
<connection refLocalId="5" formalParameter="ACK">
- <position x="985" y="220"/>
- <position x="775" y="220"/>
+ <position x="985" y="215"/> + <position x="775" y="215"/> @@ -446,8 +446,8 @@
<relPosition x="0" y="70"/>
<connection refLocalId="8" formalParameter="ACK">
- <position x="985" y="240"/>
- <position x="805" y="240"/>
+ <position x="985" y="235"/> + <position x="805" y="235"/> <position x="805" y="330"/>
<position x="775" y="330"/>
@@ -457,8 +457,8 @@
<relPosition x="0" y="90"/>
<connection refLocalId="12" formalParameter="ACK">
- <position x="985" y="260"/>
- <position x="820" y="260"/>
+ <position x="985" y="255"/> + <position x="820" y="255"/> <position x="820" y="450"/>
<position x="775" y="450"/>
@@ -468,8 +468,8 @@
<relPosition x="0" y="110"/>
<connection refLocalId="15" formalParameter="ACK">
- <position x="985" y="280"/>
- <position x="835" y="280"/>
+ <position x="985" y="275"/> + <position x="835" y="275"/> <position x="835" y="575"/>
<position x="775" y="575"/>
@@ -486,19 +486,19 @@
<inVariable localId="22" height="30" width="20">
- <position x="930" y="185"/>
+ <position x="930" y="180"/> <relPosition x="20" y="15"/>
<expression>3</expression>
<outVariable localId="23" height="35" width="125">
- <position x="1150" y="185"/>
+ <position x="1150" y="180"/> <relPosition x="0" y="15"/>
<connection refLocalId="21" formalParameter="OUT">
- <position x="1150" y="200"/>
- <position x="1065" y="200"/>
+ <position x="1150" y="195"/> + <position x="1065" y="195"/> <expression>pytest_var3</expression>
@@ -586,6 +586,30 @@
+ <comment localId="31" height="60" width="345"> + <position x="295" y="265"/> +<![CDATA[Sleep here is bad. It blocks other py_eval instances. Whith a wxGlade GUI, GUI freeze for a second.]]> + <comment localId="6" height="60" width="345"> + <position x="295" y="380"/> +<![CDATA[Prints FBID to stdout of PLC runtime. FBID is a unique reference to py_eval instance.]]> + <comment localId="10" height="60" width="345"> + <position x="295" y="500"/> +<![CDATA[Simple_C_Call is declared in C_File "1.x:c_code". See python ctypes manual for details on typing.]]> + <comment localId="32" height="105" width="235"> + <position x="25" y="285"/> +<![CDATA[Fast clock, at least faster that sleep(1). See what happens when python takes time to answer : PLC continues.]]>