--- a/tests/first_steps/plc.xml Fri May 25 18:37:59 2018 +0300
+++ b/tests/first_steps/plc.xml Thu May 31 13:07:10 2018 +0300
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
<fileHeader companyName="Beremiz" productName="Beremiz" productVersion="1" creationDateTime="2016-10-24T18:09:22"/>
- <contentHeader name="First Steps" modificationDateTime="2016-10-26T20:18:02">
+ <contentHeader name="First Steps" modificationDateTime="2018-05-31T12:59:20"> @@ -17,6 +17,58 @@
+ <pou name="AverageVal" pouType="function"> + <variable name="InputsNumber"> + <simpleValue value="5.0"/> + <xhtml:p><![CDATA[Количество входных значений]]></xhtml:p> + <xhtml:p><![CDATA[AverageVal := INT_TO_REAL(Cnt1+Cnt2+Cnt3+Cnt4+Cnt5)/InputsNumber;]]></xhtml:p> <pou name="plc_prg" pouType="program">
@@ -79,6 +131,11 @@
<derived name="CounterLD"/>
+ <variable name="AVCnt"> @@ -105,24 +162,13 @@
- <inVariable localId="2" executionOrderId="0" height="24" width="79" negated="false">
+ <inVariable localId="2" executionOrderId="0" height="30" width="79" negated="false"> <position x="35" y="81"/>
- <relPosition x="79" y="12"/>
+ <relPosition x="79" y="15"/> <expression>Reset</expression>
- <outVariable localId="3" executionOrderId="0" height="24" width="106" negated="false">
- <position x="424" y="81"/>
- <relPosition x="0" y="12"/>
- <connection refLocalId="1" formalParameter="OUT">
- <position x="424" y="93"/>
- <position x="332" y="93"/>
- <expression>Cnt1</expression>
<block localId="4" typeName="CounterFBD" instanceName="CounterFBD0" executionOrderId="0" height="54" width="121">
<position x="211" y="145"/>
@@ -145,19 +191,8 @@
- <outVariable localId="5" executionOrderId="0" height="24" width="103" negated="false">
- <position x="426" y="170"/>
- <relPosition x="0" y="12"/>
- <connection refLocalId="4" formalParameter="OUT">
- <position x="426" y="182"/>
- <position x="332" y="182"/>
- <expression>Cnt2</expression>
- <comment localId="6" height="264" width="417">
- <position x="569" y="55"/>
+ <comment localId="6" height="306" width="434"> + <position x="620" y="130"/> <xhtml:p><![CDATA[In this example function block with the same functionality
is created using all five IEC 61131-3 programing languages:
@@ -199,17 +234,6 @@
- <outVariable localId="8" executionOrderId="0" height="24" width="97" negated="false">
- <position x="431" y="261"/>
- <relPosition x="0" y="12"/>
- <connection refLocalId="7" formalParameter="OUT">
- <position x="431" y="273"/>
- <position x="332" y="273"/>
- <expression>Cnt3</expression>
<block localId="9" typeName="CounterIL" instanceName="CounterIL0" executionOrderId="0" height="62" width="121">
<position x="211" y="322"/>
@@ -232,35 +256,24 @@
- <inVariable localId="10" executionOrderId="0" height="24" width="67" negated="false">
+ <inVariable localId="10" executionOrderId="0" height="30" width="67" negated="false"> <position x="34" y="351"/>
- <relPosition x="67" y="12"/>
+ <relPosition x="67" y="15"/> <expression>Reset</expression>
- <outVariable localId="11" executionOrderId="0" height="24" width="91" negated="false">
- <position x="434" y="351"/>
- <relPosition x="0" y="12"/>
- <connection refLocalId="9" formalParameter="OUT">
- <position x="434" y="363"/>
- <position x="332" y="363"/>
- <expression>Cnt4</expression>
- <inVariable localId="12" executionOrderId="0" height="24" width="67" negated="false">
+ <inVariable localId="12" executionOrderId="0" height="30" width="67" negated="false"> <position x="36" y="261"/>
- <relPosition x="67" y="12"/>
+ <relPosition x="67" y="15"/> <expression>Reset</expression>
- <inVariable localId="13" executionOrderId="0" height="24" width="79" negated="false">
+ <inVariable localId="13" executionOrderId="0" height="30" width="79" negated="false"> <position x="36" y="170"/>
- <relPosition x="79" y="12"/>
+ <relPosition x="79" y="15"/> <expression>Reset</expression>
@@ -286,24 +299,156 @@
- <outVariable localId="15" executionOrderId="0" height="24" width="88" negated="false">
- <position x="437" y="440"/>
+ <inVariable localId="16" executionOrderId="0" height="30" width="64" negated="false"> + <position x="36" y="440"/> + <relPosition x="64" y="15"/> + <expression>Reset</expression> + <block localId="17" typeName="AverageVal" executionOrderId="0" height="470" width="90"> + <position x="514" y="28"/> + <variable formalParameter="Cnt1"> + <relPosition x="0" y="65"/> + <connection refLocalId="3"> + <position x="514" y="93"/> + <position x="474" y="93"/> + <variable formalParameter="Cnt2"> + <relPosition x="0" y="155"/> + <connection refLocalId="5"> + <position x="514" y="183"/> + <position x="497" y="183"/> + <position x="497" y="182"/> + <position x="473" y="182"/> + <variable formalParameter="Cnt3"> + <relPosition x="0" y="245"/> + <connection refLocalId="8"> + <position x="514" y="273"/> + <position x="472" y="273"/> + <variable formalParameter="Cnt4"> + <relPosition x="0" y="335"/> + <connection refLocalId="11"> + <position x="514" y="363"/> + <position x="469" y="363"/> + <variable formalParameter="Cnt5"> + <relPosition x="0" y="425"/> + <connection refLocalId="15"> + <position x="514" y="453"/> + <position x="495" y="453"/> + <position x="495" y="452"/> + <position x="469" y="452"/> + <variable formalParameter="OUT"> + <relPosition x="90" y="65"/> + <outVariable localId="18" executionOrderId="0" height="30" width="50" negated="false"> + <position x="649" y="78"/> - <relPosition x="0" y="12"/>
+ <relPosition x="0" y="15"/> + <connection refLocalId="17" formalParameter="OUT"> + <position x="649" y="93"/> + <position x="604" y="93"/> + <expression>AVCnt</expression> + <inOutVariable localId="3" executionOrderId="0" height="30" width="106" negatedOut="false" negatedIn="false"> + <position x="368" y="78"/> + <relPosition x="0" y="15"/> + <connection refLocalId="1" formalParameter="OUT"> + <position x="368" y="93"/> + <position x="332" y="93"/> + <relPosition x="106" y="15"/> + <expression>Cnt1</expression> + <inOutVariable localId="5" executionOrderId="0" height="30" width="103" negatedOut="false" negatedIn="false"> + <position x="370" y="167"/> + <relPosition x="0" y="15"/> + <connection refLocalId="4" formalParameter="OUT"> + <position x="370" y="182"/> + <position x="332" y="182"/> + <relPosition x="103" y="15"/> + <expression>Cnt2</expression> + <inOutVariable localId="8" executionOrderId="0" height="30" width="97" negatedOut="false" negatedIn="false"> + <position x="375" y="258"/> + <relPosition x="0" y="15"/> + <connection refLocalId="7" formalParameter="OUT"> + <position x="375" y="273"/> + <position x="332" y="273"/> + <relPosition x="97" y="15"/> + <expression>Cnt3</expression> + <inOutVariable localId="11" executionOrderId="0" height="30" width="91" negatedOut="false" negatedIn="false"> + <position x="378" y="348"/> + <relPosition x="0" y="15"/> + <connection refLocalId="9" formalParameter="OUT"> + <position x="378" y="363"/> + <position x="332" y="363"/> + <relPosition x="91" y="15"/> + <expression>Cnt4</expression> + <inOutVariable localId="15" executionOrderId="0" height="30" width="88" negatedOut="false" negatedIn="false"> + <position x="381" y="437"/> + <relPosition x="0" y="15"/> <connection refLocalId="14" formalParameter="Out">
- <position x="437" y="452"/>
+ <position x="381" y="452"/> <position x="334" y="452"/>
+ <relPosition x="88" y="15"/> <expression>Cnt5</expression>
- <inVariable localId="16" executionOrderId="0" height="24" width="64" negated="false">
- <position x="36" y="440"/>
- <relPosition x="64" y="12"/>
- <expression>Reset</expression>