andrej@1552: <?xml version='1.0' encoding='utf-8'?> andrej@1552: <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"> andrej@1552: <fileHeader companyName="Beremiz" productName="Beremiz" productVersion="1" creationDateTime="2016-10-24T18:09:22"/> andrej@2534: <contentHeader name="First Steps" modificationDateTime="2018-09-26T12:52:51"> andrej@1552: <coordinateInfo> andrej@1552: <fbd> andrej@1552: <scaling x="0" y="0"/> andrej@1552: </fbd> andrej@1552: <ld> andrej@1552: <scaling x="0" y="0"/> andrej@1552: </ld> andrej@1552: <sfc> andrej@1552: <scaling x="0" y="0"/> andrej@1552: </sfc> andrej@1552: </coordinateInfo> andrej@1552: </contentHeader> andrej@1552: <types> andrej@1552: <dataTypes/> andrej@1552: <pous> surkovsv93@2170: <pou name="AverageVal" pouType="function"> surkovsv93@2170: <interface> surkovsv93@2170: <returnType> surkovsv93@2170: <REAL/> surkovsv93@2170: </returnType> surkovsv93@2170: <inputVars> surkovsv93@2170: <variable name="Cnt1"> surkovsv93@2170: <type> surkovsv93@2170: <INT/> surkovsv93@2170: </type> surkovsv93@2170: </variable> surkovsv93@2170: <variable name="Cnt2"> surkovsv93@2170: <type> surkovsv93@2170: <INT/> surkovsv93@2170: </type> surkovsv93@2170: </variable> surkovsv93@2170: <variable name="Cnt3"> surkovsv93@2170: <type> surkovsv93@2170: <INT/> surkovsv93@2170: </type> surkovsv93@2170: </variable> surkovsv93@2170: <variable name="Cnt4"> surkovsv93@2170: <type> surkovsv93@2170: <INT/> surkovsv93@2170: </type> surkovsv93@2170: </variable> surkovsv93@2170: <variable name="Cnt5"> surkovsv93@2170: <type> surkovsv93@2170: <INT/> surkovsv93@2170: </type> surkovsv93@2170: </variable> surkovsv93@2170: </inputVars> surkovsv93@2170: <localVars> surkovsv93@2170: <variable name="InputsNumber"> surkovsv93@2170: <type> surkovsv93@2170: <REAL/> surkovsv93@2170: </type> surkovsv93@2170: <initialValue> surkovsv93@2170: <simpleValue value="5.0"/> surkovsv93@2170: </initialValue> surkovsv93@2170: <documentation> surkovsv93@2170: <xhtml:p><![CDATA[КоличеÑтво входных значений]]></xhtml:p> surkovsv93@2170: </documentation> surkovsv93@2170: </variable> surkovsv93@2170: </localVars> surkovsv93@2170: </interface> surkovsv93@2170: <body> surkovsv93@2170: <ST> surkovsv93@2170: <xhtml:p><![CDATA[AverageVal := INT_TO_REAL(Cnt1+Cnt2+Cnt3+Cnt4+Cnt5)/InputsNumber;]]></xhtml:p> surkovsv93@2170: </ST> surkovsv93@2170: </body> surkovsv93@2170: </pou> andrej@1552: <pou name="plc_prg" pouType="program"> andrej@1552: <interface> andrej@1552: <inputVars> andrej@1552: <variable name="Reset"> andrej@1552: <type> andrej@1552: <BOOL/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </inputVars> andrej@1552: <outputVars> andrej@1552: <variable name="Cnt1"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: <variable name="Cnt2"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: <variable name="Cnt3"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: <variable name="Cnt4"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: <variable name="Cnt5"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </outputVars> andrej@1552: <localVars> andrej@1552: <variable name="CounterST0"> andrej@1552: <type> andrej@1552: <derived name="CounterST"/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: <variable name="CounterFBD0"> andrej@1552: <type> andrej@1552: <derived name="CounterFBD"/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: <variable name="CounterSFC0"> andrej@1552: <type> andrej@1552: <derived name="CounterSFC"/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: <variable name="CounterIL0"> andrej@1552: <type> andrej@1552: <derived name="CounterIL"/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: <variable name="CounterLD0"> andrej@1552: <type> andrej@1552: <derived name="CounterLD"/> andrej@1552: </type> andrej@1552: </variable> surkovsv93@2170: <variable name="AVCnt"> surkovsv93@2170: <type> surkovsv93@2170: <REAL/> surkovsv93@2170: </type> surkovsv93@2170: </variable> andrej@1552: </localVars> andrej@1552: </interface> andrej@1552: <body> andrej@1552: <FBD> andrej@1552: <block localId="1" typeName="CounterST" instanceName="CounterST0" executionOrderId="0" height="60" width="125"> andrej@1552: <position x="207" y="53"/> andrej@1552: <inputVariables> andrej@1552: <variable formalParameter="Reset"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="40"/> andrej@1552: <connection refLocalId="2"> andrej@1552: <position x="207" y="93"/> andrej@1552: <position x="114" y="93"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: </inputVariables> andrej@1552: <inOutVariables/> andrej@1552: <outputVariables> andrej@1552: <variable formalParameter="OUT"> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="125" y="40"/> andrej@1552: </connectionPointOut> andrej@1552: </variable> andrej@1552: </outputVariables> andrej@1552: </block> surkovsv93@2170: <inVariable localId="2" executionOrderId="0" height="30" width="79" negated="false"> andrej@2346: <position x="35" y="78"/> andrej@1552: <connectionPointOut> surkovsv93@2170: <relPosition x="79" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>Reset</expression> andrej@1552: </inVariable> andrej@1552: <block localId="4" typeName="CounterFBD" instanceName="CounterFBD0" executionOrderId="0" height="54" width="121"> andrej@2346: <position x="211" y="146"/> andrej@1552: <inputVariables> andrej@1552: <variable formalParameter="Reset"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="37"/> andrej@1552: <connection refLocalId="13"> andrej@2346: <position x="211" y="183"/> andrej@2346: <position x="115" y="183"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: </inputVariables> andrej@1552: <inOutVariables/> andrej@1552: <outputVariables> andrej@1552: <variable formalParameter="OUT"> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="121" y="37"/> andrej@1552: </connectionPointOut> andrej@1552: </variable> andrej@1552: </outputVariables> andrej@1552: </block> andrej@2346: <comment localId="6" height="365" width="569"> surkovsv93@2170: <position x="620" y="130"/> andrej@1552: <content> andrej@1552: <xhtml:p><![CDATA[In this example function block with the same functionality andrej@1552: is created using all five IEC 61131-3 programing languages: andrej@1552: - IL; andrej@1552: - FBD; andrej@1552: - LD; andrej@1552: - ST; andrej@1552: - SFC. andrej@1552: andrej@1552: andrej@1552: andrej@1552: andrej@1552: Function block is a counter with reset control input. andrej@1552: If reset is True counter value is reset to the value defined by andrej@1552: global configuration constant ResetCounterValue. andrej@1552: If reset is False, counter is incremented every cycle. andrej@1552: ]]></xhtml:p> andrej@1552: </content> andrej@1552: </comment> andrej@1552: <block localId="7" typeName="CounterSFC" instanceName="CounterSFC0" executionOrderId="0" height="52" width="121"> andrej@1552: <position x="211" y="237"/> andrej@1552: <inputVariables> andrej@1552: <variable formalParameter="Reset"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="36"/> andrej@1552: <connection refLocalId="12"> andrej@1552: <position x="211" y="273"/> andrej@1552: <position x="103" y="273"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: </inputVariables> andrej@1552: <inOutVariables/> andrej@1552: <outputVariables> andrej@1552: <variable formalParameter="OUT"> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="121" y="36"/> andrej@1552: </connectionPointOut> andrej@1552: </variable> andrej@1552: </outputVariables> andrej@1552: </block> andrej@1552: <block localId="9" typeName="CounterIL" instanceName="CounterIL0" executionOrderId="0" height="62" width="121"> andrej@1552: <position x="211" y="322"/> andrej@1552: <inputVariables> andrej@1552: <variable formalParameter="Reset"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="41"/> andrej@1552: <connection refLocalId="10"> andrej@1552: <position x="211" y="363"/> andrej@1552: <position x="101" y="363"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: </inputVariables> andrej@1552: <inOutVariables/> andrej@1552: <outputVariables> andrej@1552: <variable formalParameter="OUT"> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="121" y="41"/> andrej@1552: </connectionPointOut> andrej@1552: </variable> andrej@1552: </outputVariables> andrej@1552: </block> surkovsv93@2170: <inVariable localId="10" executionOrderId="0" height="30" width="67" negated="false"> andrej@2346: <position x="34" y="348"/> andrej@1552: <connectionPointOut> surkovsv93@2170: <relPosition x="67" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>Reset</expression> andrej@1552: </inVariable> surkovsv93@2170: <inVariable localId="12" executionOrderId="0" height="30" width="67" negated="false"> andrej@2346: <position x="36" y="258"/> andrej@1552: <connectionPointOut> surkovsv93@2170: <relPosition x="67" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>Reset</expression> andrej@1552: </inVariable> surkovsv93@2170: <inVariable localId="13" executionOrderId="0" height="30" width="79" negated="false"> andrej@2346: <position x="36" y="168"/> andrej@1552: <connectionPointOut> surkovsv93@2170: <relPosition x="79" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>Reset</expression> andrej@1552: </inVariable> andrej@1552: <block localId="14" typeName="CounterLD" instanceName="CounterLD0" executionOrderId="0" height="62" width="124"> andrej@2346: <position x="210" y="412"/> andrej@1552: <inputVariables> andrej@1552: <variable formalParameter="Reset"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="41"/> andrej@1552: <connection refLocalId="16"> andrej@2346: <position x="210" y="453"/> andrej@2346: <position x="100" y="453"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: </inputVariables> andrej@1552: <inOutVariables/> andrej@1552: <outputVariables> andrej@1552: <variable formalParameter="Out"> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="124" y="41"/> andrej@1552: </connectionPointOut> andrej@1552: </variable> andrej@1552: </outputVariables> andrej@1552: </block> surkovsv93@2170: <inVariable localId="16" executionOrderId="0" height="30" width="64" negated="false"> andrej@2346: <position x="36" y="438"/> andrej@1552: <connectionPointOut> surkovsv93@2170: <relPosition x="64" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>Reset</expression> andrej@1552: </inVariable> andrej@2346: <block localId="17" typeName="AverageVal" executionOrderId="0" height="470" width="100"> surkovsv93@2170: <position x="514" y="28"/> surkovsv93@2170: <inputVariables> surkovsv93@2170: <variable formalParameter="Cnt1"> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="65"/> surkovsv93@2170: <connection refLocalId="3"> surkovsv93@2170: <position x="514" y="93"/> surkovsv93@2170: <position x="474" y="93"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: </variable> surkovsv93@2170: <variable formalParameter="Cnt2"> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="155"/> surkovsv93@2170: <connection refLocalId="5"> surkovsv93@2170: <position x="514" y="183"/> andrej@2346: <position x="473" y="183"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: </variable> surkovsv93@2170: <variable formalParameter="Cnt3"> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="245"/> surkovsv93@2170: <connection refLocalId="8"> surkovsv93@2170: <position x="514" y="273"/> surkovsv93@2170: <position x="472" y="273"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: </variable> surkovsv93@2170: <variable formalParameter="Cnt4"> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="335"/> surkovsv93@2170: <connection refLocalId="11"> surkovsv93@2170: <position x="514" y="363"/> surkovsv93@2170: <position x="469" y="363"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: </variable> surkovsv93@2170: <variable formalParameter="Cnt5"> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="425"/> surkovsv93@2170: <connection refLocalId="15"> surkovsv93@2170: <position x="514" y="453"/> andrej@2346: <position x="469" y="453"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: </variable> surkovsv93@2170: </inputVariables> surkovsv93@2170: <inOutVariables/> surkovsv93@2170: <outputVariables> surkovsv93@2170: <variable formalParameter="OUT"> surkovsv93@2170: <connectionPointOut> andrej@2346: <relPosition x="100" y="65"/> surkovsv93@2170: </connectionPointOut> surkovsv93@2170: </variable> surkovsv93@2170: </outputVariables> surkovsv93@2170: </block> andrej@2346: <outVariable localId="18" executionOrderId="0" height="30" width="55" negated="false"> surkovsv93@2170: <position x="649" y="78"/> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="15"/> surkovsv93@2170: <connection refLocalId="17" formalParameter="OUT"> surkovsv93@2170: <position x="649" y="93"/> andrej@2346: <position x="614" y="93"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: <expression>AVCnt</expression> surkovsv93@2170: </outVariable> surkovsv93@2170: <inOutVariable localId="3" executionOrderId="0" height="30" width="106" negatedOut="false" negatedIn="false"> surkovsv93@2170: <position x="368" y="78"/> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="15"/> surkovsv93@2170: <connection refLocalId="1" formalParameter="OUT"> surkovsv93@2170: <position x="368" y="93"/> surkovsv93@2170: <position x="332" y="93"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: <connectionPointOut> surkovsv93@2170: <relPosition x="106" y="15"/> surkovsv93@2170: </connectionPointOut> surkovsv93@2170: <expression>Cnt1</expression> surkovsv93@2170: </inOutVariable> surkovsv93@2170: <inOutVariable localId="5" executionOrderId="0" height="30" width="103" negatedOut="false" negatedIn="false"> andrej@2346: <position x="370" y="168"/> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="15"/> surkovsv93@2170: <connection refLocalId="4" formalParameter="OUT"> andrej@2346: <position x="370" y="183"/> andrej@2346: <position x="332" y="183"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: <connectionPointOut> surkovsv93@2170: <relPosition x="103" y="15"/> surkovsv93@2170: </connectionPointOut> surkovsv93@2170: <expression>Cnt2</expression> surkovsv93@2170: </inOutVariable> surkovsv93@2170: <inOutVariable localId="8" executionOrderId="0" height="30" width="97" negatedOut="false" negatedIn="false"> surkovsv93@2170: <position x="375" y="258"/> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="15"/> surkovsv93@2170: <connection refLocalId="7" formalParameter="OUT"> surkovsv93@2170: <position x="375" y="273"/> surkovsv93@2170: <position x="332" y="273"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: <connectionPointOut> surkovsv93@2170: <relPosition x="97" y="15"/> surkovsv93@2170: </connectionPointOut> surkovsv93@2170: <expression>Cnt3</expression> surkovsv93@2170: </inOutVariable> surkovsv93@2170: <inOutVariable localId="11" executionOrderId="0" height="30" width="91" negatedOut="false" negatedIn="false"> surkovsv93@2170: <position x="378" y="348"/> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="15"/> surkovsv93@2170: <connection refLocalId="9" formalParameter="OUT"> surkovsv93@2170: <position x="378" y="363"/> surkovsv93@2170: <position x="332" y="363"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: <connectionPointOut> surkovsv93@2170: <relPosition x="91" y="15"/> surkovsv93@2170: </connectionPointOut> surkovsv93@2170: <expression>Cnt4</expression> surkovsv93@2170: </inOutVariable> surkovsv93@2170: <inOutVariable localId="15" executionOrderId="0" height="30" width="88" negatedOut="false" negatedIn="false"> andrej@2346: <position x="381" y="438"/> surkovsv93@2170: <connectionPointIn> surkovsv93@2170: <relPosition x="0" y="15"/> surkovsv93@2170: <connection refLocalId="14" formalParameter="Out"> andrej@2346: <position x="381" y="453"/> andrej@2346: <position x="334" y="453"/> surkovsv93@2170: </connection> surkovsv93@2170: </connectionPointIn> surkovsv93@2170: <connectionPointOut> surkovsv93@2170: <relPosition x="88" y="15"/> surkovsv93@2170: </connectionPointOut> surkovsv93@2170: <expression>Cnt5</expression> surkovsv93@2170: </inOutVariable> andrej@1552: </FBD> andrej@1552: </body> andrej@1552: </pou> andrej@1552: <pou name="CounterST" pouType="functionBlock"> andrej@1552: <interface> andrej@1552: <inputVars> andrej@1552: <variable name="Reset"> andrej@1552: <type> andrej@1552: <BOOL/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </inputVars> andrej@1552: <localVars> andrej@1552: <variable name="Cnt"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </localVars> andrej@1552: <outputVars> andrej@1552: <variable name="OUT"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </outputVars> andrej@1552: <externalVars constant="true"> andrej@1552: <variable name="ResetCounterValue"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </externalVars> andrej@1552: </interface> andrej@1552: <body> andrej@1552: <ST> andrej@1552: <xhtml:p><![CDATA[IF Reset THEN andrej@1552: Cnt := ResetCounterValue; andrej@1552: ELSE andrej@1552: Cnt := Cnt + 1; andrej@1552: END_IF; andrej@1552: andrej@1552: Out := Cnt;]]></xhtml:p> andrej@1552: </ST> andrej@1552: </body> andrej@1552: </pou> andrej@1552: <pou name="CounterFBD" pouType="functionBlock"> andrej@1552: <interface> andrej@1552: <inputVars> andrej@1552: <variable name="Reset"> andrej@1552: <type> andrej@1552: <BOOL/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </inputVars> andrej@1552: <outputVars> andrej@1552: <variable name="OUT"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </outputVars> andrej@1552: <localVars> andrej@1552: <variable name="Cnt"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </localVars> andrej@1552: <externalVars constant="true"> andrej@1552: <variable name="ResetCounterValue"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </externalVars> andrej@1552: </interface> andrej@1552: <body> andrej@1552: <FBD> andrej@2296: <inVariable localId="1" executionOrderId="0" height="30" width="61" negated="false"> andrej@1552: <position x="321" y="58"/> andrej@1552: <connectionPointOut> andrej@2296: <relPosition x="61" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>Reset</expression> andrej@1552: </inVariable> andrej@2296: <outVariable localId="2" executionOrderId="0" height="30" width="39" negated="false"> andrej@1552: <position x="675" y="137"/> andrej@1552: <connectionPointIn> andrej@2296: <relPosition x="0" y="15"/> andrej@1552: <connection refLocalId="3"> andrej@2296: <position x="675" y="152"/> andrej@2296: <position x="589" y="152"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <expression>OUT</expression> andrej@1552: </outVariable> andrej@2346: <inOutVariable localId="3" executionOrderId="0" height="30" width="37" negatedOut="false" negatedIn="false"> andrej@1552: <position x="557" y="137"/> andrej@1552: <connectionPointIn> andrej@2296: <relPosition x="0" y="15"/> andrej@1552: <connection refLocalId="7" formalParameter="OUT"> andrej@2296: <position x="557" y="152"/> andrej@2346: <position x="527" y="152"/> andrej@2346: <position x="527" y="130"/> andrej@2346: <position x="517" y="130"/> andrej@2346: </connection> andrej@2346: </connectionPointIn> andrej@2346: <connectionPointOut> andrej@2346: <relPosition x="37" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>Cnt</expression> andrej@1552: </inOutVariable> andrej@2346: <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="69"> andrej@1552: <position x="328" y="115"/> andrej@1552: <inputVariables> andrej@1552: <variable formalParameter="IN1"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="35"/> andrej@1552: <connection refLocalId="6"> andrej@1552: <position x="328" y="150"/> andrej@2346: <position x="275" y="150"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: <variable formalParameter="IN2"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="65"/> andrej@1552: <connection refLocalId="3"> andrej@1552: <position x="328" y="180"/> andrej@1552: <position x="317" y="180"/> andrej@1552: <position x="317" y="213"/> andrej@2346: <position x="604" y="213"/> andrej@2346: <position x="604" y="152"/> andrej@2346: <position x="594" y="152"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: </inputVariables> andrej@1552: <inOutVariables/> andrej@1552: <outputVariables> andrej@1552: <variable formalParameter="OUT"> andrej@1552: <connectionPointOut> andrej@2346: <relPosition x="69" y="35"/> andrej@1552: </connectionPointOut> andrej@1552: </variable> andrej@1552: </outputVariables> andrej@1552: </block> andrej@2346: <inVariable localId="5" executionOrderId="0" height="30" width="163" negated="false"> andrej@1552: <position x="222" y="256"/> andrej@1552: <connectionPointOut> andrej@2346: <relPosition x="163" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>ResetCounterValue</expression> andrej@1552: </inVariable> andrej@2296: <inVariable localId="6" executionOrderId="0" height="30" width="21" negated="false"> andrej@2346: <position x="254" y="135"/> andrej@1552: <connectionPointOut> andrej@2296: <relPosition x="21" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>1</expression> andrej@1552: </inVariable> andrej@2346: <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="69"> andrej@1552: <position x="448" y="100"/> andrej@1552: <inputVariables> andrej@1552: <variable formalParameter="G"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="30"/> andrej@1552: <connection refLocalId="1"> andrej@1552: <position x="448" y="130"/> andrej@1552: <position x="415" y="130"/> andrej@2296: <position x="415" y="73"/> andrej@2296: <position x="382" y="73"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: <variable formalParameter="IN0"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="50"/> andrej@1552: <connection refLocalId="4" formalParameter="OUT"> andrej@1552: <position x="448" y="150"/> andrej@2346: <position x="397" y="150"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: <variable formalParameter="IN1"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="70"/> andrej@1552: <connection refLocalId="5"> andrej@1552: <position x="448" y="170"/> andrej@1552: <position x="414" y="170"/> andrej@2296: <position x="414" y="271"/> andrej@2346: <position x="385" y="271"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: </inputVariables> andrej@1552: <inOutVariables/> andrej@1552: <outputVariables> andrej@1552: <variable formalParameter="OUT"> andrej@1552: <connectionPointOut> andrej@2346: <relPosition x="69" y="30"/> andrej@1552: </connectionPointOut> andrej@1552: </variable> andrej@1552: </outputVariables> andrej@1552: </block> andrej@1552: </FBD> andrej@1552: </body> andrej@1552: </pou> andrej@1552: <pou name="CounterSFC" pouType="functionBlock"> andrej@1552: <interface> andrej@1552: <inputVars> andrej@1552: <variable name="Reset"> andrej@1552: <type> andrej@1552: <BOOL/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </inputVars> andrej@1552: <outputVars> andrej@1552: <variable name="OUT"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </outputVars> andrej@1552: <localVars> andrej@1552: <variable name="Cnt"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </localVars> andrej@1552: <externalVars constant="true"> andrej@1552: <variable name="ResetCounterValue"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </externalVars> andrej@1552: </interface> andrej@1552: <actions/> andrej@1552: <body> andrej@1552: <SFC> andrej@2296: <step localId="1" name="Start" initialStep="true" height="34" width="90"> andrej@1552: <position x="241" y="14"/> andrej@1552: <connectionPointOut formalParameter=""> andrej@2296: <relPosition x="45" y="34"/> andrej@1552: </connectionPointOut> andrej@1552: </step> andrej@1552: <selectionDivergence localId="2" height="1" width="431"> andrej@1552: <position x="70" y="86"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="216" y="0"/> andrej@1552: <connection refLocalId="1"> andrej@1552: <position x="286" y="86"/> andrej@1552: <position x="286" y="42"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointOut formalParameter=""> andrej@1552: <relPosition x="0" y="1"/> andrej@1552: </connectionPointOut> andrej@1552: <connectionPointOut formalParameter=""> andrej@1552: <relPosition x="431" y="1"/> andrej@1552: </connectionPointOut> andrej@1552: </selectionDivergence> andrej@1552: <transition localId="3" height="2" width="20"> andrej@1552: <position x="491" y="132"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="10" y="0"/> andrej@1552: <connection refLocalId="2"> andrej@1552: <position x="501" y="132"/> andrej@1552: <position x="501" y="87"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="10" y="2"/> andrej@1552: </connectionPointOut> andrej@1552: <condition> andrej@1552: <inline name=""> andrej@1552: <ST> andrej@1552: <xhtml:p><![CDATA[Reset]]></xhtml:p> andrej@1552: </ST> andrej@1552: </inline> andrej@1552: </condition> andrej@1552: </transition> andrej@1552: <transition localId="4" height="2" width="20" executionOrderId="0"> andrej@1552: <position x="60" y="135"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="10" y="0"/> andrej@1552: <connection refLocalId="2"> andrej@1552: <position x="70" y="135"/> andrej@1552: <position x="70" y="87"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="10" y="2"/> andrej@1552: </connectionPointOut> andrej@1552: <condition> andrej@1552: <inline name=""> andrej@1552: <ST> andrej@1552: <xhtml:p><![CDATA[NOT Reset]]></xhtml:p> andrej@1552: </ST> andrej@1552: </inline> andrej@1552: </condition> andrej@1552: </transition> andrej@2346: <step localId="5" name="ResetCounter" initialStep="false" height="30" width="134"> andrej@2346: <position x="434" y="190"/> andrej@2346: <connectionPointIn> andrej@2346: <relPosition x="67" y="0"/> andrej@1552: <connection refLocalId="3"> andrej@1552: <position x="501" y="190"/> andrej@1552: <position x="501" y="134"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointOut formalParameter=""> andrej@2346: <relPosition x="67" y="30"/> andrej@1552: </connectionPointOut> andrej@1552: <connectionPointOutAction formalParameter=""> andrej@2346: <relPosition x="134" y="15"/> andrej@1552: </connectionPointOutAction> andrej@1552: </step> andrej@2346: <actionBlock localId="6" height="63" width="254"> andrej@2346: <position x="641" y="190"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="15"/> andrej@1552: <connection refLocalId="5"> andrej@2346: <position x="641" y="205"/> andrej@2346: <position x="568" y="205"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <action localId="0"> andrej@1552: <relPosition x="0" y="0"/> andrej@1552: <inline> andrej@1552: <ST> andrej@1552: <xhtml:p><![CDATA[Cnt := ResetCounterValue;]]></xhtml:p> andrej@1552: </ST> andrej@1552: </inline> andrej@1552: </action> andrej@1552: <action localId="0"> andrej@1552: <relPosition x="0" y="0"/> andrej@1552: <inline> andrej@1552: <ST> andrej@1552: <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p> andrej@1552: </ST> andrej@1552: </inline> andrej@1552: </action> andrej@1552: </actionBlock> andrej@2296: <step localId="7" name="Count" initialStep="false" height="30" width="85" executionOrderId="0"> andrej@1552: <position x="28" y="191"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="42" y="0"/> andrej@1552: <connection refLocalId="4"> andrej@1552: <position x="70" y="191"/> andrej@1552: <position x="70" y="137"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointOut formalParameter=""> andrej@2296: <relPosition x="42" y="30"/> andrej@1552: </connectionPointOut> andrej@1552: <connectionPointOutAction formalParameter=""> andrej@2296: <relPosition x="85" y="15"/> andrej@1552: </connectionPointOutAction> andrej@1552: </step> andrej@2534: <actionBlock localId="8" height="52" width="164" executionOrderId="0"> andrej@2346: <position x="154" y="191"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="15"/> andrej@1552: <connection refLocalId="7"> andrej@2346: <position x="154" y="206"/> andrej@2346: <position x="113" y="206"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <action localId="0"> andrej@1552: <relPosition x="0" y="0"/> andrej@1552: <inline> andrej@1552: <ST> andrej@1552: <xhtml:p><![CDATA[Cnt := Cnt + 1;]]></xhtml:p> andrej@1552: </ST> andrej@1552: </inline> andrej@1552: </action> andrej@1552: <action localId="0"> andrej@1552: <relPosition x="0" y="0"/> andrej@1552: <inline> andrej@1552: <ST> andrej@1552: <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p> andrej@1552: </ST> andrej@1552: </inline> andrej@1552: </action> andrej@1552: </actionBlock> andrej@1552: <selectionConvergence localId="10" height="1" width="431"> andrej@2534: <position x="70" y="273"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="0"/> andrej@1552: <connection refLocalId="13"> andrej@2534: <position x="70" y="273"/> andrej@1552: <position x="70" y="244"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="431" y="0"/> andrej@1552: <connection refLocalId="14"> andrej@2534: <position x="501" y="273"/> andrej@1552: <position x="501" y="250"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="216" y="1"/> andrej@1552: </connectionPointOut> andrej@1552: </selectionConvergence> andrej@1552: <jumpStep localId="12" targetName="Start" height="13" width="12"> andrej@2534: <position x="280" y="317"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="6" y="0"/> andrej@1552: <connection refLocalId="10"> andrej@2534: <position x="286" y="317"/> andrej@2534: <position x="286" y="274"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </jumpStep> andrej@1552: <transition localId="13" height="2" width="20" executionOrderId="0"> andrej@1552: <position x="60" y="242"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="10" y="0"/> andrej@1552: <connection refLocalId="7"> andrej@1552: <position x="70" y="242"/> andrej@2534: <position x="70" y="215"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="10" y="2"/> andrej@1552: </connectionPointOut> andrej@1552: <condition> andrej@1552: <inline name=""> andrej@1552: <ST> andrej@1552: <xhtml:p><![CDATA[Reset]]></xhtml:p> andrej@1552: </ST> andrej@1552: </inline> andrej@1552: </condition> andrej@1552: </transition> andrej@1552: <transition localId="14" height="2" width="20" executionOrderId="0"> andrej@1552: <position x="491" y="248"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="10" y="0"/> andrej@1552: <connection refLocalId="5"> andrej@1552: <position x="501" y="248"/> andrej@2346: <position x="501" y="220"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="10" y="2"/> andrej@1552: </connectionPointOut> andrej@1552: <condition> andrej@1552: <inline name=""> andrej@1552: <ST> andrej@1552: <xhtml:p><![CDATA[NOT Reset]]></xhtml:p> andrej@1552: </ST> andrej@1552: </inline> andrej@1552: </condition> andrej@1552: </transition> andrej@1552: </SFC> andrej@1552: </body> andrej@1552: </pou> andrej@1552: <pou name="CounterIL" pouType="functionBlock"> andrej@1552: <interface> andrej@1552: <localVars> andrej@1552: <variable name="Cnt"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </localVars> andrej@1552: <inputVars> andrej@1552: <variable name="Reset"> andrej@1552: <type> andrej@1552: <BOOL/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </inputVars> andrej@1552: <outputVars> andrej@1552: <variable name="OUT"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </outputVars> andrej@1552: <externalVars constant="true"> andrej@1552: <variable name="ResetCounterValue"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </externalVars> andrej@1552: </interface> andrej@1552: <body> andrej@1552: <IL> andrej@1552: <xhtml:p><![CDATA[LD Reset andrej@1552: JMPC ResetCnt andrej@1552: andrej@1552: (* increment counter *) andrej@1552: LD Cnt andrej@1552: ADD 1 andrej@1552: JMP QuitFb andrej@1552: andrej@1552: ResetCnt: andrej@1552: (* reset counter *) andrej@1552: LD ResetCounterValue andrej@1552: andrej@1552: QuitFb: andrej@1552: (* save results *) andrej@1552: ST Cnt andrej@1552: ST Out andrej@1552: ]]></xhtml:p> andrej@1552: </IL> andrej@1552: </body> andrej@1552: </pou> andrej@1552: <pou name="CounterLD" pouType="functionBlock"> andrej@1552: <interface> andrej@1552: <inputVars> andrej@1552: <variable name="Reset"> andrej@1552: <type> andrej@1552: <BOOL/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </inputVars> andrej@1552: <outputVars> andrej@1552: <variable name="Out"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </outputVars> andrej@1552: <localVars> andrej@1552: <variable name="Cnt"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </localVars> andrej@1552: <externalVars constant="true"> andrej@1552: <variable name="ResetCounterValue"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: </variable> andrej@1552: </externalVars> andrej@1552: </interface> andrej@1552: <body> andrej@1552: <LD> andrej@2296: <outVariable localId="2" executionOrderId="0" height="30" width="34" negated="false"> andrej@2346: <position x="527" y="87"/> andrej@1552: <connectionPointIn> andrej@2296: <relPosition x="0" y="15"/> andrej@1552: <connection refLocalId="3"> andrej@2346: <position x="527" y="102"/> andrej@2346: <position x="443" y="102"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <expression>Out</expression> andrej@1552: </outVariable> andrej@2346: <inOutVariable localId="3" executionOrderId="0" height="30" width="34" negatedOut="false" negatedIn="false"> andrej@2346: <position x="409" y="87"/> andrej@1552: <connectionPointIn> andrej@2296: <relPosition x="0" y="15"/> andrej@1552: <connection refLocalId="7" formalParameter="OUT"> andrej@2346: <position x="409" y="102"/> andrej@2296: <position x="367" y="102"/> andrej@2296: </connection> andrej@2296: </connectionPointIn> andrej@2296: <connectionPointOut> andrej@2346: <relPosition x="34" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>Cnt</expression> andrej@1552: </inOutVariable> andrej@2296: <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="67"> andrej@1552: <position x="180" y="87"/> andrej@1552: <inputVariables> andrej@1552: <variable formalParameter="IN1"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="35"/> andrej@1552: <connection refLocalId="6"> andrej@1552: <position x="180" y="122"/> andrej@2346: <position x="127" y="122"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: <variable formalParameter="IN2"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="65"/> andrej@1552: <connection refLocalId="3"> andrej@1552: <position x="180" y="152"/> andrej@1552: <position x="169" y="152"/> andrej@1552: <position x="169" y="185"/> andrej@2346: <position x="453" y="185"/> andrej@2346: <position x="453" y="102"/> andrej@2346: <position x="443" y="102"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: </inputVariables> andrej@1552: <inOutVariables/> andrej@1552: <outputVariables> andrej@1552: <variable formalParameter="OUT"> andrej@1552: <connectionPointOut> andrej@2296: <relPosition x="67" y="35"/> andrej@1552: </connectionPointOut> andrej@1552: </variable> andrej@1552: </outputVariables> andrej@1552: </block> andrej@2296: <inVariable localId="5" executionOrderId="0" height="30" width="158" negated="false"> andrej@1552: <position x="74" y="228"/> andrej@1552: <connectionPointOut> andrej@2296: <relPosition x="158" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>ResetCounterValue</expression> andrej@1552: </inVariable> andrej@2296: <inVariable localId="6" executionOrderId="0" height="30" width="21" negated="false"> andrej@2346: <position x="106" y="107"/> andrej@1552: <connectionPointOut> andrej@2296: <relPosition x="21" y="15"/> andrej@1552: </connectionPointOut> andrej@1552: <expression>1</expression> andrej@1552: </inVariable> andrej@2296: <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="67"> andrej@1552: <position x="300" y="72"/> andrej@1552: <inputVariables> andrej@1552: <variable formalParameter="G"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="30"/> andrej@1552: <connection refLocalId="9"> andrej@1552: <position x="300" y="102"/> andrej@1552: <position x="266" y="102"/> andrej@1552: <position x="266" y="62"/> andrej@1552: <position x="134" y="62"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: <variable formalParameter="IN0"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="50"/> andrej@1552: <connection refLocalId="4" formalParameter="OUT"> andrej@1552: <position x="300" y="122"/> andrej@2296: <position x="247" y="122"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: <variable formalParameter="IN1"> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="70"/> andrej@1552: <connection refLocalId="5"> andrej@1552: <position x="300" y="142"/> andrej@1552: <position x="266" y="142"/> andrej@2296: <position x="266" y="243"/> andrej@2296: <position x="232" y="243"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: </variable> andrej@1552: </inputVariables> andrej@1552: <inOutVariables/> andrej@1552: <outputVariables> andrej@1552: <variable formalParameter="OUT"> andrej@1552: <connectionPointOut> andrej@2296: <relPosition x="67" y="30"/> andrej@1552: </connectionPointOut> andrej@1552: </variable> andrej@1552: </outputVariables> andrej@1552: </block> andrej@1552: <leftPowerRail localId="8" height="40" width="3"> andrej@1552: <position x="46" y="42"/> andrej@1552: <connectionPointOut formalParameter=""> andrej@1552: <relPosition x="3" y="20"/> andrej@1552: </connectionPointOut> andrej@1552: </leftPowerRail> andrej@1552: <contact localId="9" height="15" width="21" negated="false"> andrej@1552: <position x="113" y="54"/> andrej@1552: <connectionPointIn> andrej@1552: <relPosition x="0" y="8"/> andrej@1552: <connection refLocalId="8"> andrej@1552: <position x="113" y="62"/> andrej@1552: <position x="49" y="62"/> andrej@1552: </connection> andrej@1552: </connectionPointIn> andrej@1552: <connectionPointOut> andrej@1552: <relPosition x="21" y="8"/> andrej@1552: </connectionPointOut> andrej@1552: <variable>Reset</variable> andrej@1552: </contact> andrej@1552: </LD> andrej@1552: </body> andrej@1552: </pou> andrej@1552: </pous> andrej@1552: </types> andrej@1552: <instances> andrej@1552: <configurations> andrej@1552: <configuration name="config"> andrej@1552: <resource name="resource1"> andrej@1552: <task name="plc_task" priority="1" interval="T#100ms"> andrej@1552: <pouInstance name="plc_task_instance" typeName="plc_prg"/> andrej@1552: </task> andrej@1552: </resource> andrej@1552: <globalVars constant="true"> andrej@1552: <variable name="ResetCounterValue"> andrej@1552: <type> andrej@1552: <INT/> andrej@1552: </type> andrej@1552: <initialValue> andrej@1552: <simpleValue value="17"/> andrej@1552: </initialValue> andrej@1552: </variable> andrej@1552: </globalVars> andrej@1552: </configuration> andrej@1552: </configurations> andrej@1552: </instances> andrej@1552: </project>