--- a/tests/python/plc.xml Tue Aug 21 13:05:23 2018 +0300
+++ b/tests/python/plc.xml Fri Aug 24 13:25:05 2018 +0300
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<project xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201">
<fileHeader companyName="" productName="Beremiz" productVersion="0.0" creationDateTime="2008-12-14T16:21:19" contentDescription="This example shows many features in Beremiz: 1. How to implement python extensions. 2. How to implement basic C extension. 3. How to use C code in IEC POUs. 4. How to call C functions from python code. 5. How to avoid race conditions between IEC, C and python code. 6. How to convert betweet different IEC types. "/>
- <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2016-10-12T14:15:35">
+ <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2018-08-24T13:17:44">
<coordinateInfo>
<pageSize x="1024" y="1024"/>
<fbd>
@@ -323,14 +323,14 @@
<expression>pytest_var2</expression>
</inOutVariable>
<block localId="8" width="125" height="80" typeName="python_eval" instanceName="Block1" executionOrderId="0">
- <position x="650" y="515"/>
+ <position x="650" y="545"/>
<inputVariables>
<variable formalParameter="TRIG">
<connectionPointIn>
<relPosition x="0" y="35"/>
<connection refLocalId="7" formalParameter="OUT">
- <position x="650" y="550"/>
- <position x="285" y="550"/>
+ <position x="650" y="580"/>
+ <position x="285" y="580"/>
<position x="285" y="480"/>
<position x="250" y="480"/>
</connection>
@@ -340,8 +340,8 @@
<connectionPointIn>
<relPosition x="0" y="65"/>
<connection refLocalId="9">
- <position x="650" y="580"/>
- <position x="585" y="580"/>
+ <position x="650" y="610"/>
+ <position x="585" y="610"/>
</connection>
</connectionPointIn>
</variable>
@@ -361,28 +361,28 @@
</outputVariables>
</block>
<inVariable localId="9" height="30" width="290" executionOrderId="0" negated="false">
- <position x="295" y="565"/>
+ <position x="295" y="595"/>
<connectionPointOut>
<relPosition x="290" y="15"/>
</connectionPointOut>
<expression>'sys.stdout.write("FBID :"+str(FBID)+"\n")'</expression>
</inVariable>
<inVariable localId="11" height="30" width="290" executionOrderId="0" negated="false">
- <position x="295" y="685"/>
+ <position x="295" y="735"/>
<connectionPointOut>
<relPosition x="290" y="15"/>
</connectionPointOut>
<expression>'PLCBinary.Simple_C_Call(5678)'</expression>
</inVariable>
<block localId="12" width="125" height="80" typeName="python_eval" instanceName="Block2" executionOrderId="0">
- <position x="650" y="637"/>
+ <position x="650" y="687"/>
<inputVariables>
<variable formalParameter="TRIG">
<connectionPointIn>
<relPosition x="0" y="33"/>
<connection refLocalId="7" formalParameter="OUT">
- <position x="650" y="670"/>
- <position x="285" y="670"/>
+ <position x="650" y="720"/>
+ <position x="285" y="720"/>
<position x="285" y="480"/>
<position x="250" y="480"/>
</connection>
@@ -392,8 +392,8 @@
<connectionPointIn>
<relPosition x="0" y="63"/>
<connection refLocalId="11">
- <position x="650" y="700"/>
- <position x="585" y="700"/>
+ <position x="650" y="750"/>
+ <position x="585" y="750"/>
</connection>
</connectionPointIn>
</variable>
@@ -413,21 +413,21 @@
</outputVariables>
</block>
<inVariable localId="14" height="30" width="290" executionOrderId="0" negated="false">
- <position x="290" y="810"/>
+ <position x="290" y="885"/>
<connectionPointOut>
<relPosition x="290" y="15"/>
</connectionPointOut>
<expression>'MyPythonFunc(42)'</expression>
</inVariable>
<block localId="15" width="125" height="80" typeName="python_eval" instanceName="Block3" executionOrderId="0">
- <position x="650" y="762"/>
+ <position x="650" y="837"/>
<inputVariables>
<variable formalParameter="TRIG">
<connectionPointIn>
<relPosition x="0" y="33"/>
<connection refLocalId="7" formalParameter="OUT">
- <position x="650" y="795"/>
- <position x="285" y="795"/>
+ <position x="650" y="870"/>
+ <position x="285" y="870"/>
<position x="285" y="480"/>
<position x="250" y="480"/>
</connection>
@@ -437,8 +437,8 @@
<connectionPointIn>
<relPosition x="0" y="63"/>
<connection refLocalId="14">
- <position x="650" y="825"/>
- <position x="580" y="825"/>
+ <position x="650" y="900"/>
+ <position x="580" y="900"/>
</connection>
</connectionPointIn>
</variable>
@@ -464,16 +464,16 @@
</content>
</comment>
<block localId="17" width="80" height="120" typeName="MUX" executionOrderId="0">
- <position x="1065" y="715"/>
+ <position x="1065" y="790"/>
<inputVariables>
<variable formalParameter="K">
<connectionPointIn>
<relPosition x="0" y="30"/>
<connection refLocalId="18">
- <position x="1065" y="745"/>
- <position x="1040" y="745"/>
- <position x="1040" y="735"/>
- <position x="1015" y="735"/>
+ <position x="1065" y="820"/>
+ <position x="1040" y="820"/>
+ <position x="1040" y="810"/>
+ <position x="1022" y="810"/>
</connection>
</connectionPointIn>
</variable>
@@ -481,8 +481,8 @@
<connectionPointIn>
<relPosition x="0" y="50"/>
<connection refLocalId="5" formalParameter="RESULT">
- <position x="1065" y="765"/>
- <position x="905" y="765"/>
+ <position x="1065" y="840"/>
+ <position x="905" y="840"/>
<position x="905" y="465"/>
<position x="775" y="465"/>
</connection>
@@ -492,10 +492,10 @@
<connectionPointIn>
<relPosition x="0" y="70"/>
<connection refLocalId="8" formalParameter="RESULT">
- <position x="1065" y="785"/>
- <position x="890" y="785"/>
- <position x="890" y="580"/>
- <position x="775" y="580"/>
+ <position x="1065" y="860"/>
+ <position x="890" y="860"/>
+ <position x="890" y="610"/>
+ <position x="775" y="610"/>
</connection>
</connectionPointIn>
</variable>
@@ -503,10 +503,10 @@
<connectionPointIn>
<relPosition x="0" y="90"/>
<connection refLocalId="12" formalParameter="RESULT">
- <position x="1065" y="805"/>
- <position x="875" y="805"/>
- <position x="875" y="700"/>
- <position x="775" y="700"/>
+ <position x="1065" y="880"/>
+ <position x="875" y="880"/>
+ <position x="875" y="750"/>
+ <position x="775" y="750"/>
</connection>
</connectionPointIn>
</variable>
@@ -514,8 +514,8 @@
<connectionPointIn>
<relPosition x="0" y="110"/>
<connection refLocalId="15" formalParameter="RESULT">
- <position x="1065" y="825"/>
- <position x="775" y="825"/>
+ <position x="1065" y="900"/>
+ <position x="775" y="900"/>
</connection>
</connectionPointIn>
</variable>
@@ -530,12 +530,12 @@
</outputVariables>
</block>
<outVariable localId="19" height="35" width="125" executionOrderId="0" negated="false">
- <position x="1235" y="730"/>
+ <position x="1235" y="805"/>
<connectionPointIn>
<relPosition x="0" y="15"/>
<connection refLocalId="17" formalParameter="OUT">
- <position x="1235" y="745"/>
- <position x="1145" y="745"/>
+ <position x="1235" y="820"/>
+ <position x="1145" y="820"/>
</connection>
</connectionPointIn>
<expression>pytest_var1</expression>
@@ -550,7 +550,7 @@
<position x="1070" y="415"/>
<position x="1040" y="415"/>
<position x="1040" y="405"/>
- <position x="1010" y="405"/>
+ <position x="1017" y="405"/>
</connection>
</connectionPointIn>
</variable>
@@ -569,8 +569,8 @@
<connection refLocalId="8" formalParameter="ACK">
<position x="1070" y="455"/>
<position x="805" y="455"/>
- <position x="805" y="550"/>
- <position x="775" y="550"/>
+ <position x="805" y="580"/>
+ <position x="775" y="580"/>
</connection>
</connectionPointIn>
</variable>
@@ -580,8 +580,8 @@
<connection refLocalId="12" formalParameter="ACK">
<position x="1070" y="475"/>
<position x="820" y="475"/>
- <position x="820" y="670"/>
- <position x="775" y="670"/>
+ <position x="820" y="720"/>
+ <position x="775" y="720"/>
</connection>
</connectionPointIn>
</variable>
@@ -591,8 +591,8 @@
<connection refLocalId="15" formalParameter="ACK">
<position x="1070" y="495"/>
<position x="835" y="495"/>
- <position x="835" y="795"/>
- <position x="775" y="795"/>
+ <position x="835" y="870"/>
+ <position x="775" y="870"/>
</connection>
</connectionPointIn>
</variable>
@@ -606,10 +606,10 @@
</variable>
</outputVariables>
</block>
- <inVariable localId="22" height="30" width="65" executionOrderId="0" negated="false">
+ <inVariable localId="22" height="30" width="72" executionOrderId="0" negated="false">
<position x="945" y="390"/>
<connectionPointOut>
- <relPosition x="65" y="15"/>
+ <relPosition x="72" y="15"/>
</connectionPointOut>
<expression>mux1_sel</expression>
</inVariable>
@@ -700,44 +700,44 @@
</connectionPointOut>
<expression>10</expression>
</inVariable>
- <comment localId="30" height="75" width="465">
- <position x="50" y="945"/>
+ <comment localId="30" height="105" width="465">
+ <position x="50" y="925"/>
<content>
<xhtml:p><![CDATA[You will be ready to use beremiz with C and Python when you will understand why "FromInput" is equal to 75.
Happy hacking! ]]></xhtml:p>
</content>
</comment>
- <comment localId="31" height="60" width="345">
+ <comment localId="31" height="90" width="345">
<position x="295" y="485"/>
<content>
<xhtml:p><![CDATA[Sleep here is bad. It blocks other py_eval instances. Whith a wxGlade GUI, GUI freeze for a second.]]></xhtml:p>
</content>
</comment>
- <comment localId="6" height="60" width="345">
- <position x="295" y="600"/>
+ <comment localId="6" height="80" width="345">
+ <position x="295" y="630"/>
<content>
<xhtml:p><![CDATA[Prints FBID to stdout of PLC runtime. FBID is a unique reference to py_eval instance.]]></xhtml:p>
</content>
</comment>
- <comment localId="10" height="60" width="345">
- <position x="295" y="720"/>
+ <comment localId="10" height="85" width="345">
+ <position x="295" y="770"/>
<content>
<xhtml:p><![CDATA[Simple_C_Call is declared in C_File "1.x:c_code". See python ctypes manual for details on typing.]]></xhtml:p>
</content>
</comment>
- <comment localId="32" height="105" width="235">
+ <comment localId="32" height="145" width="235">
<position x="25" y="505"/>
<content>
<xhtml:p><![CDATA[Fast clock, at least faster that sleep(1). See what happens when python takes time to answer : PLC continues.]]></xhtml:p>
</content>
</comment>
- <outVariable localId="33" height="30" width="130" executionOrderId="0" negated="false">
+ <outVariable localId="33" height="30" width="133" executionOrderId="0" negated="false">
<position x="580" y="1564"/>
<connectionPointIn>
<relPosition x="0" y="16"/>
<connection refLocalId="35" formalParameter="OUT">
<position x="580" y="1580"/>
- <position x="370" y="1580"/>
+ <position x="371" y="1580"/>
</connection>
</connectionPointIn>
<expression>Test_BCD_RESULT</expression>
@@ -749,7 +749,7 @@
</connectionPointOut>
<expression>Test_BCD</expression>
</inVariable>
- <block localId="35" width="105" height="60" typeName="BCD_TO_UINT" executionOrderId="0">
+ <block localId="35" width="106" height="60" typeName="BCD_TO_UINT" executionOrderId="0">
<position x="265" y="1539"/>
<inputVariables>
<variable formalParameter="IN">
@@ -766,7 +766,7 @@
<outputVariables>
<variable formalParameter="OUT">
<connectionPointOut>
- <relPosition x="105" y="41"/>
+ <relPosition x="106" y="41"/>
</connectionPointOut>
</variable>
</outputVariables>
@@ -1163,16 +1163,16 @@
</connectionPointIn>
<expression>fefvsd</expression>
</outVariable>
- <comment localId="53" height="65" width="420">
+ <comment localId="53" height="80" width="420">
<position x="75" y="2160"/>
<content>
<xhtml:p><![CDATA[Shows global variables access from resource configuration (res_pytest) and from project's configuration.]]></xhtml:p>
</content>
</comment>
- <inVariable localId="18" height="30" width="65" executionOrderId="0" negated="false">
- <position x="950" y="720"/>
- <connectionPointOut>
- <relPosition x="65" y="15"/>
+ <inVariable localId="18" height="30" width="72" executionOrderId="0" negated="false">
+ <position x="950" y="795"/>
+ <connectionPointOut>
+ <relPosition x="72" y="15"/>
</connectionPointOut>
<expression>mux2_sel</expression>
</inVariable>
@@ -1194,14 +1194,14 @@
<xhtml:p><![CDATA[Shows access variable defined in python extension. ]]></xhtml:p>
</content>
</comment>
- <inVariable localId="66" height="30" width="130" executionOrderId="0" negated="false">
+ <inVariable localId="66" height="30" width="137" executionOrderId="0" negated="false">
<position x="60" y="1685"/>
<connectionPointOut>
- <relPosition x="130" y="15"/>
+ <relPosition x="137" y="15"/>
</connectionPointOut>
<expression>Test_BCD_WRONG</expression>
</inVariable>
- <block localId="67" width="105" height="100" typeName="BCD_TO_UINT" executionOrderId="0">
+ <block localId="67" width="106" height="100" typeName="BCD_TO_UINT" executionOrderId="0">
<position x="265" y="1620"/>
<inputVariables>
<variable formalParameter="EN">
@@ -1218,7 +1218,7 @@
<position x="255" y="1700"/>
<position x="345" y="1700"/>
<position x="345" y="1700"/>
- <position x="190" y="1700"/>
+ <position x="197" y="1700"/>
</connection>
</connectionPointIn>
</variable>
@@ -1227,28 +1227,28 @@
<outputVariables>
<variable formalParameter="ENO">
<connectionPointOut>
- <relPosition x="105" y="40"/>
+ <relPosition x="106" y="40"/>
</connectionPointOut>
</variable>
<variable formalParameter="OUT">
<connectionPointOut>
- <relPosition x="105" y="80"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <outVariable localId="68" height="30" width="185" executionOrderId="0" negated="false">
+ <relPosition x="106" y="80"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <outVariable localId="68" height="30" width="196" executionOrderId="0" negated="false">
<position x="580" y="1685"/>
<connectionPointIn>
<relPosition x="0" y="15"/>
<connection refLocalId="67" formalParameter="OUT">
<position x="580" y="1700"/>
- <position x="370" y="1700"/>
+ <position x="371" y="1700"/>
</connection>
</connectionPointIn>
<expression>Test_BCD_WRONG_RESULT</expression>
</outVariable>
- <comment localId="69" height="135" width="375">
+ <comment localId="69" height="165" width="375">
<position x="795" y="1590"/>
<content>
<xhtml:p><![CDATA[Incorrect BCD number is not converted to UINT.
@@ -1273,7 +1273,7 @@
</connectionPointIn>
<expression>Test_BCD_CONVERTED</expression>
</outVariable>
- <comment localId="71" height="170" width="680">
+ <comment localId="71" height="215" width="680">
<position x="35" y="30"/>
<content>
<xhtml:p><![CDATA[This example shows many features in Beremiz: