--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/first_steps/beremiz.xml Thu Oct 27 15:31:43 2016 +0300
@@ -0,0 +1,6 @@
+<?xml version='1.0' encoding='utf-8'?> +<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="LOCAL://"> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/first_steps/plc.xml Thu Oct 27 15:31:43 2016 +0300
@@ -0,0 +1,1019 @@
+<?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"> + <pou name="plc_prg" pouType="program"> + <variable name="Reset"> + <variable name="CounterST0"> + <derived name="CounterST"/> + <variable name="CounterFBD0"> + <derived name="CounterFBD"/> + <variable name="CounterSFC0"> + <derived name="CounterSFC"/> + <variable name="CounterIL0"> + <derived name="CounterIL"/> + <variable name="CounterLD0"> + <derived name="CounterLD"/> + <block localId="1" typeName="CounterST" instanceName="CounterST0" executionOrderId="0" height="60" width="125"> + <position x="207" y="53"/> + <variable formalParameter="Reset"> + <relPosition x="0" y="40"/> + <connection refLocalId="2"> + <position x="207" y="93"/> + <position x="114" y="93"/> + <variable formalParameter="OUT"> + <relPosition x="125" y="40"/> + <inVariable localId="2" executionOrderId="0" height="24" width="79" negated="false"> + <position x="35" y="81"/> + <relPosition x="79" y="12"/> + <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"/> + <variable formalParameter="Reset"> + <relPosition x="0" y="37"/> + <connection refLocalId="13"> + <position x="211" y="182"/> + <position x="115" y="182"/> + <variable formalParameter="OUT"> + <relPosition x="121" y="37"/> + <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"/> + <xhtml:p><![CDATA[In this example function block with the same functionality +is created using all five IEC 61131-3 programing languages: +Function block is a counter with reset control input. +If reset is True counter value is reset to the value defined by +global configuration constant ResetCounterValue. +If reset is False, counter is incremented every cycle. + <block localId="7" typeName="CounterSFC" instanceName="CounterSFC0" executionOrderId="0" height="52" width="121"> + <position x="211" y="237"/> + <variable formalParameter="Reset"> + <relPosition x="0" y="36"/> + <connection refLocalId="12"> + <position x="211" y="273"/> + <position x="103" y="273"/> + <variable formalParameter="OUT"> + <relPosition x="121" y="36"/> + <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"/> + <variable formalParameter="Reset"> + <relPosition x="0" y="41"/> + <connection refLocalId="10"> + <position x="211" y="363"/> + <position x="101" y="363"/> + <variable formalParameter="OUT"> + <relPosition x="121" y="41"/> + <inVariable localId="10" executionOrderId="0" height="24" width="67" negated="false"> + <position x="34" y="351"/> + <relPosition x="67" y="12"/> + <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"> + <position x="36" y="261"/> + <relPosition x="67" y="12"/> + <expression>Reset</expression> + <inVariable localId="13" executionOrderId="0" height="24" width="79" negated="false"> + <position x="36" y="170"/> + <relPosition x="79" y="12"/> + <expression>Reset</expression> + <block localId="14" typeName="CounterLD" instanceName="CounterLD0" executionOrderId="0" height="62" width="124"> + <position x="210" y="411"/> + <variable formalParameter="Reset"> + <relPosition x="0" y="41"/> + <connection refLocalId="16"> + <position x="210" y="452"/> + <position x="100" y="452"/> + <variable formalParameter="Out"> + <relPosition x="124" y="41"/> + <outVariable localId="15" executionOrderId="0" height="24" width="88" negated="false"> + <position x="437" y="440"/> + <relPosition x="0" y="12"/> + <connection refLocalId="14" formalParameter="Out"> + <position x="437" y="452"/> + <position x="334" y="452"/> + <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> + <pou name="CounterST" pouType="functionBlock"> + <variable name="Reset"> + <externalVars constant="true"> + <variable name="ResetCounterValue"> + <xhtml:p><![CDATA[IF Reset THEN + Cnt := ResetCounterValue; +Out := Cnt;]]></xhtml:p> + <pou name="CounterFBD" pouType="functionBlock"> + <variable name="Reset"> + <externalVars constant="true"> + <variable name="ResetCounterValue"> + <inVariable localId="1" executionOrderId="0" height="24" width="61" negated="false"> + <position x="321" y="58"/> + <relPosition x="61" y="12"/> + <expression>Reset</expression> + <outVariable localId="2" executionOrderId="0" height="24" width="34" negated="false"> + <position x="675" y="137"/> + <relPosition x="0" y="12"/> + <connection refLocalId="3"> + <position x="675" y="149"/> + <position x="586" y="149"/> + <expression>OUT</expression> + <inOutVariable localId="3" executionOrderId="0" height="24" width="29" negatedOut="false" negatedIn="false"> + <position x="557" y="137"/> + <relPosition x="0" y="12"/> + <connection refLocalId="7" formalParameter="OUT"> + <position x="557" y="149"/> + <position x="524" y="149"/> + <position x="524" y="130"/> + <position x="505" y="130"/> + <relPosition x="29" y="12"/> + <expression>Cnt</expression> + <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="57"> + <position x="328" y="115"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="35"/> + <connection refLocalId="6"> + <position x="328" y="150"/> + <position x="275" y="150"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="65"/> + <connection refLocalId="3"> + <position x="328" y="180"/> + <position x="317" y="180"/> + <position x="317" y="213"/> + <position x="596" y="213"/> + <position x="596" y="149"/> + <position x="586" y="149"/> + <variable formalParameter="OUT"> + <relPosition x="57" y="35"/> + <inVariable localId="5" executionOrderId="0" height="24" width="158" negated="false"> + <position x="222" y="256"/> + <relPosition x="158" y="12"/> + <expression>ResetCounterValue</expression> + <inVariable localId="6" executionOrderId="0" height="24" width="21" negated="false"> + <position x="254" y="138"/> + <relPosition x="21" y="12"/> + <expression>1</expression> + <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="57"> + <position x="448" y="100"/> + <variable formalParameter="G"> + <relPosition x="0" y="30"/> + <connection refLocalId="1"> + <position x="448" y="130"/> + <position x="415" y="130"/> + <position x="415" y="70"/> + <position x="382" y="70"/> + <variable formalParameter="IN0"> + <relPosition x="0" y="50"/> + <connection refLocalId="4" formalParameter="OUT"> + <position x="448" y="150"/> + <position x="385" y="150"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="70"/> + <connection refLocalId="5"> + <position x="448" y="170"/> + <position x="414" y="170"/> + <position x="414" y="268"/> + <position x="380" y="268"/> + <variable formalParameter="OUT"> + <relPosition x="57" y="30"/> + <pou name="CounterSFC" pouType="functionBlock"> + <variable name="Reset"> + <externalVars constant="true"> + <variable name="ResetCounterValue"> + <step localId="1" name="Start" initialStep="true" height="28" width="90"> + <position x="241" y="14"/> + <connectionPointOut formalParameter=""> + <relPosition x="45" y="28"/> + <selectionDivergence localId="2" height="1" width="431"> + <position x="70" y="86"/> + <relPosition x="216" y="0"/> + <connection refLocalId="1"> + <position x="286" y="86"/> + <position x="286" y="42"/> + <connectionPointOut formalParameter=""> + <relPosition x="0" y="1"/> + <connectionPointOut formalParameter=""> + <relPosition x="431" y="1"/> + <transition localId="3" height="2" width="20"> + <position x="491" y="132"/> + <relPosition x="10" y="0"/> + <connection refLocalId="2"> + <position x="501" y="132"/> + <position x="501" y="87"/> + <relPosition x="10" y="2"/> + <xhtml:p><![CDATA[Reset]]></xhtml:p> + <transition localId="4" height="2" width="20" executionOrderId="0"> + <position x="60" y="135"/> + <relPosition x="10" y="0"/> + <connection refLocalId="2"> + <position x="70" y="135"/> + <position x="70" y="87"/> + <relPosition x="10" y="2"/> + <xhtml:p><![CDATA[NOT Reset]]></xhtml:p> + <step localId="5" name="ResetCounter" initialStep="false" height="24" width="104"> + <position x="449" y="190"/> + <relPosition x="52" y="0"/> + <connection refLocalId="3"> + <position x="501" y="190"/> + <position x="501" y="134"/> + <connectionPointOut formalParameter=""> + <relPosition x="52" y="24"/> + <connectionPointOutAction formalParameter=""> + <relPosition x="104" y="12"/> + </connectionPointOutAction> + <actionBlock localId="6" height="63" width="222"> + <position x="600" y="187"/> + <relPosition x="0" y="15"/> + <connection refLocalId="5"> + <position x="600" y="202"/> + <position x="553" y="202"/> + <relPosition x="0" y="0"/> + <xhtml:p><![CDATA[Cnt := ResetCounterValue;]]></xhtml:p> + <relPosition x="0" y="0"/> + <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p> + <step localId="7" name="Count" initialStep="false" height="24" width="85" executionOrderId="0"> + <position x="28" y="191"/> + <relPosition x="42" y="0"/> + <connection refLocalId="4"> + <position x="70" y="191"/> + <position x="70" y="137"/> + <connectionPointOut formalParameter=""> + <relPosition x="42" y="24"/> + <connectionPointOutAction formalParameter=""> + <relPosition x="85" y="12"/> + </connectionPointOutAction> + <actionBlock localId="8" height="52" width="148" executionOrderId="0"> + <position x="135" y="188"/> + <relPosition x="0" y="15"/> + <connection refLocalId="7"> + <position x="135" y="203"/> + <position x="113" y="203"/> + <relPosition x="0" y="0"/> + <xhtml:p><![CDATA[Cnt := Cnt + 1;]]></xhtml:p> + <relPosition x="0" y="0"/> + <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p> + <selectionConvergence localId="10" height="1" width="431"> + <position x="70" y="273"/> + <relPosition x="0" y="0"/> + <connection refLocalId="13"> + <position x="70" y="273"/> + <position x="70" y="244"/> + <relPosition x="431" y="0"/> + <connection refLocalId="14"> + <position x="501" y="273"/> + <position x="501" y="250"/> + <relPosition x="216" y="1"/> + </selectionConvergence> + <jumpStep localId="12" targetName="Start" height="13" width="12"> + <position x="280" y="317"/> + <relPosition x="6" y="0"/> + <connection refLocalId="10"> + <position x="286" y="317"/> + <position x="286" y="274"/> + <transition localId="13" height="2" width="20" executionOrderId="0"> + <position x="60" y="242"/> + <relPosition x="10" y="0"/> + <connection refLocalId="7"> + <position x="70" y="242"/> + <position x="70" y="215"/> + <relPosition x="10" y="2"/> + <xhtml:p><![CDATA[Reset]]></xhtml:p> + <transition localId="14" height="2" width="20" executionOrderId="0"> + <position x="491" y="248"/> + <relPosition x="10" y="0"/> + <connection refLocalId="5"> + <position x="501" y="248"/> + <position x="501" y="214"/> + <relPosition x="10" y="2"/> + <xhtml:p><![CDATA[NOT Reset]]></xhtml:p> + <pou name="CounterIL" pouType="functionBlock"> + <variable name="Reset"> + <externalVars constant="true"> + <variable name="ResetCounterValue"> + <xhtml:p><![CDATA[LD Reset + <pou name="CounterLD" pouType="functionBlock"> + <variable name="Reset"> + <externalVars constant="true"> + <variable name="ResetCounterValue"> + <outVariable localId="2" executionOrderId="0" height="24" width="34" negated="false"> + <position x="527" y="90"/> + <relPosition x="0" y="12"/> + <connection refLocalId="3"> + <position x="527" y="102"/> + <position x="438" y="102"/> + <expression>Out</expression> + <inOutVariable localId="3" executionOrderId="0" height="24" width="29" negatedOut="false" negatedIn="false"> + <position x="409" y="90"/> + <relPosition x="0" y="12"/> + <connection refLocalId="7" formalParameter="OUT"> + <position x="409" y="102"/> + <position x="357" y="102"/> + <relPosition x="29" y="12"/> + <expression>Cnt</expression> + <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="57"> + <position x="180" y="87"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="35"/> + <connection refLocalId="6"> + <position x="180" y="122"/> + <position x="127" y="122"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="65"/> + <connection refLocalId="3"> + <position x="180" y="152"/> + <position x="169" y="152"/> + <position x="169" y="185"/> + <position x="448" y="185"/> + <position x="448" y="102"/> + <position x="438" y="102"/> + <variable formalParameter="OUT"> + <relPosition x="57" y="35"/> + <inVariable localId="5" executionOrderId="0" height="24" width="158" negated="false"> + <position x="74" y="228"/> + <relPosition x="158" y="12"/> + <expression>ResetCounterValue</expression> + <inVariable localId="6" executionOrderId="0" height="24" width="21" negated="false"> + <position x="106" y="110"/> + <relPosition x="21" y="12"/> + <expression>1</expression> + <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="57"> + <position x="300" y="72"/> + <variable formalParameter="G"> + <relPosition x="0" y="30"/> + <connection refLocalId="9"> + <position x="300" y="102"/> + <position x="266" y="102"/> + <position x="266" y="62"/> + <position x="134" y="62"/> + <variable formalParameter="IN0"> + <relPosition x="0" y="50"/> + <connection refLocalId="4" formalParameter="OUT"> + <position x="300" y="122"/> + <position x="237" y="122"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="70"/> + <connection refLocalId="5"> + <position x="300" y="142"/> + <position x="266" y="142"/> + <position x="266" y="240"/> + <position x="232" y="240"/> + <variable formalParameter="OUT"> + <relPosition x="57" y="30"/> + <leftPowerRail localId="8" height="40" width="3"> + <position x="46" y="42"/> + <connectionPointOut formalParameter=""> + <relPosition x="3" y="20"/> + <contact localId="9" height="15" width="21" negated="false"> + <position x="113" y="54"/> + <relPosition x="0" y="8"/> + <connection refLocalId="8"> + <position x="113" y="62"/> + <position x="49" y="62"/> + <relPosition x="21" y="8"/> + <variable>Reset</variable> + <configuration name="config"> + <resource name="resource1"> + <task name="plc_task" priority="1" interval="T#100ms"> + <pouInstance name="plc_task_instance" typeName="plc_prg"/> + <globalVars constant="true"> + <variable name="ResetCounterValue"> + <simpleValue value="17"/>