--- a/tests/python/c_code@c_ext/cfile.xml Thu Oct 18 20:24:11 2012 +0200
+++ b/tests/python/c_code@c_ext/cfile.xml Thu Oct 18 20:40:12 2012 +0200
@@ -5,7 +5,7 @@
<variable name="TestInput" type="SINT" class="input"/>
- <variable name="TestOutput" type="SINT" class="input"/>
+ <variable name="TestOutput" type="SINT" class="output"/> <![CDATA[volatile long Lock=0;
@@ -56,6 +56,9 @@
+<![CDATA[if(!AtomicCompareExchange(&Lock, 0, 1)){ + TestInput = CtoP + PtoC + TestOutput; + AtomicCompareExchange(&Lock, 1, 0); --- a/tests/python/plc.xml Thu Oct 18 20:24:11 2012 +0200
+++ b/tests/python/plc.xml Thu Oct 18 20:40:12 2012 +0200
@@ -8,7 +8,7 @@
creationDateTime="2008-12-14T16:21:19"/>
<contentHeader name="Beremiz Python Support Tests"
- modificationDateTime="2012-10-18T20:21:28">
+ modificationDateTime="2012-10-18T20:37:52"> <pageSize x="1024" y="1024"/>
@@ -74,6 +74,25 @@
+ <variable name="TestInput" address="%IB1.0"> + <variable name="TestOutput" address="%QB1.0"> + <variable name="FromInput"> @@ -468,32 +487,32 @@
<expression>pytest_var3</expression>
<outVariable localId="25" height="30" width="60">
- <position x="820" y="750"/>
+ <position x="520" y="655"/> <relPosition x="0" y="15"/>
<connection refLocalId="26" formalParameter="OUT">
- <position x="820" y="765"/>
- <position x="765" y="765"/>
+ <position x="520" y="670"/> + <position x="465" y="670"/> <expression>FromC</expression>
<inVariable localId="1" height="30" width="30">
- <position x="605" y="750"/>
+ <position x="305" y="655"/> <relPosition x="30" y="15"/>
<expression>23</expression>
<block localId="26" width="80" height="45" typeName="C_Pragma" instanceName="C_Pragma0">
- <position x="685" y="735"/>
+ <position x="385" y="640"/> <variable formalParameter="IN">
<relPosition x="0" y="30"/>
<connection refLocalId="1">
- <position x="685" y="765"/>
- <position x="635" y="765"/>
+ <position x="385" y="670"/> + <position x="335" y="670"/> @@ -507,6 +526,49 @@
+ <inVariable localId="27" height="30" width="75"> + <position x="305" y="770"/> + <relPosition x="75" y="15"/> + <expression>TestInput</expression> + <outVariable localId="28" height="30" width="90"> + <position x="395" y="705"/> + <relPosition x="0" y="15"/> + <connection refLocalId="2"> + <position x="395" y="720"/> + <position x="340" y="720"/> + <expression>TestOutput</expression> + <outVariable localId="29" height="30" width="85"> + <position x="415" y="770"/> + <relPosition x="0" y="15"/> + <connection refLocalId="27"> + <position x="415" y="785"/> + <position x="380" y="785"/> + <expression>FromInput</expression> + <inVariable localId="2" height="30" width="30"> + <position x="310" y="705"/> + <relPosition x="30" y="15"/> + <expression>10</expression> + <comment localId="30" height="90" width="405"> + <position x="245" y="825"/> +<![CDATA[You will be ready to use beremiz with C and Python when you will understand why "FromInput" is equal to 75.