Newer
Older
SCADA / plc / GRFICS_Workstation_Docs / Documents / simplified_te.xml
root on 8 May 2022 210 KB playing with modbus day #1
<?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="victor" productName="openplc" productVersion="2" creationDateTime="2018-03-28T16:39:26"/>
  <contentHeader name="simplified_te" modificationDateTime="2020-02-03T11:00:07">
    <coordinateInfo>
      <fbd>
        <scaling x="0" y="0"/>
      </fbd>
      <ld>
        <scaling x="0" y="0"/>
      </ld>
      <sfc>
        <scaling x="0" y="0"/>
      </sfc>
    </coordinateInfo>
  </contentHeader>
  <types>
    <dataTypes/>
    <pous>
      <pou name="main" pouType="program">
        <interface>
          <localVars>
            <variable name="flow_control0">
              <type>
                <derived name="flow_control"/>
              </type>
            </variable>
          </localVars>
          <localVars>
            <variable name="flow_set" address="%MW0">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="13107"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[13107]]></xhtml:p>
              </documentation>
            </variable>
            <variable name="a_setpoint" address="%MW1">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30801"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[30801]]></xhtml:p>
              </documentation>
            </variable>
            <variable name="pressure_sp" address="%MW2">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="55295"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[55295]]></xhtml:p>
              </documentation>
            </variable>
            <variable name="override_sp" address="%MW3">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="31675"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[31675]]></xhtml:p>
              </documentation>
            </variable>
            <variable name="level_sp" address="%MW4">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="28835"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[28835]]></xhtml:p>
              </documentation>
            </variable>
          </localVars>
          <localVars>
            <variable name="composition_control0">
              <type>
                <derived name="composition_control"/>
              </type>
            </variable>
            <variable name="scale_to_signed0">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
          </localVars>
          <localVars>
            <variable name="f1_valve_pos" address="%IW0">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="f1_flow" address="%IW1">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="f2_valve_pos" address="%IW2">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="f2_flow" address="%IW3">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="purge_valve_pos" address="%IW4">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="purge_flow" address="%IW5">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="product_valve_pos" address="%IW6">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="product_flow" address="%IW7">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="10000"/>
              </initialValue>
            </variable>
            <variable name="pressure" address="%IW8">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="60000"/>
              </initialValue>
            </variable>
            <variable name="level" address="%IW9">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="a_in_purge" address="%IW10">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="b_in_purge" address="%IW11">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="10000"/>
              </initialValue>
            </variable>
            <variable name="c_in_purge" address="%IW12">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="10000"/>
              </initialValue>
            </variable>
            <variable name="f1_valve_sp" address="%QW0">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="f2_valve_sp" address="%QW1">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="purge_valve_sp" address="%QW2">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="product_valve_sp" address="%QW3">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
          </localVars>
          <localVars>
            <variable name="product_valve_safe">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="0"/>
              </initialValue>
            </variable>
            <variable name="purge_valve_safe">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="65535"/>
              </initialValue>
            </variable>
            <variable name="f1_valve_safe">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="0"/>
              </initialValue>
            </variable>
            <variable name="f2_valve_safe">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="0"/>
              </initialValue>
            </variable>
            <variable name="pressure_control0">
              <type>
                <derived name="pressure_control"/>
              </type>
            </variable>
          </localVars>
          <localVars>
            <variable name="hmi_pressure" address="%MW20">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="hmi_level" address="%MW21">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="hmi_f1_valve_pos" address="%MW22">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="hmi_f1_flow" address="%MW23">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="hmi_f2_valve_pos" address="%MW24">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="hmi_f2_flow" address="%MW25">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="hmi_purge_valve_pos" address="%MW26">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="hmi_purge_flow" address="%MW27">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="hmi_product_valve_pos" address="%MW28">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="hmi_product_flow" address="%MW29">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="scan_count" address="%MW30">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="0"/>
              </initialValue>
            </variable>
          </localVars>
          <localVars>
            <variable name="scale_to_signed1">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
            <variable name="scale_to_signed2">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
            <variable name="scale_to_signed3">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
            <variable name="scale_to_signed4">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
            <variable name="scale_to_signed5">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
            <variable name="scale_to_signed6">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
            <variable name="scale_to_signed7">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
            <variable name="scale_to_signed8">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
            <variable name="scale_to_signed9">
              <type>
                <derived name="scale_to_signed"/>
              </type>
            </variable>
            <variable name="pressure_override0">
              <type>
                <derived name="pressure_override"/>
              </type>
            </variable>
            <variable name="level_control0">
              <type>
                <derived name="level_control"/>
              </type>
            </variable>
          </localVars>
          <externalVars>
            <variable name="run_bit">
              <type>
                <BOOL/>
              </type>
            </variable>
          </externalVars>
        </interface>
        <body>
          <LD>
            <block localId="3" typeName="flow_control" instanceName="flow_control0" height="80" width="219">
              <position x="310" y="201"/>
              <inputVariables>
                <variable formalParameter="product_flow">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="6">
                      <position x="310" y="231"/>
                      <position x="300" y="231"/>
                      <position x="300" y="187"/>
                      <position x="165" y="187"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="curr_pos">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="64">
                      <position x="310" y="251"/>
                      <position x="272" y="251"/>
                      <position x="272" y="248"/>
                      <position x="215" y="248"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="flow_set_in">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="1">
                      <position x="310" y="271"/>
                      <position x="297" y="271"/>
                      <position x="297" y="322"/>
                      <position x="233" y="322"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="new_pos">
                  <connectionPointOut>
                    <relPosition x="219" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="6" height="27" width="103" negated="false">
              <position x="62" y="174"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>product_flow</expression>
            </inVariable>
            <inVariable localId="1" height="27" width="103" negated="false" executionOrderId="0">
              <position x="130" y="309"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>flow_set</expression>
            </inVariable>
            <rightPowerRail localId="14" height="928" width="3">
              <position x="943" y="279"/>
              <connectionPointIn>
                <relPosition x="0" y="20"/>
              </connectionPointIn>
              <connectionPointIn>
                <relPosition x="0" y="131"/>
              </connectionPointIn>
              <connectionPointIn>
                <relPosition x="0" y="242"/>
              </connectionPointIn>
              <connectionPointIn>
                <relPosition x="0" y="353"/>
              </connectionPointIn>
              <connectionPointIn>
                <relPosition x="0" y="464"/>
              </connectionPointIn>
              <connectionPointIn>
                <relPosition x="0" y="575"/>
              </connectionPointIn>
              <connectionPointIn>
                <relPosition x="0" y="686"/>
              </connectionPointIn>
              <connectionPointIn>
                <relPosition x="0" y="797"/>
              </connectionPointIn>
              <connectionPointIn>
                <relPosition x="0" y="908"/>
              </connectionPointIn>
            </rightPowerRail>
            <inVariable localId="15" height="27" width="103" negated="false" executionOrderId="0">
              <position x="78" y="655"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>a_setpoint</expression>
            </inVariable>
            <inVariable localId="18" height="27" width="103" negated="false" executionOrderId="0">
              <position x="92" y="605"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>a_in_purge</expression>
            </inVariable>
            <block localId="27" typeName="composition_control" instanceName="composition_control0" height="80" width="159">
              <position x="414" y="610"/>
              <inputVariables>
                <variable formalParameter="a_in_purge">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="18">
                      <position x="414" y="640"/>
                      <position x="311" y="640"/>
                      <position x="311" y="618"/>
                      <position x="195" y="618"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="a_setpoint">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="15">
                      <position x="414" y="660"/>
                      <position x="311" y="660"/>
                      <position x="311" y="668"/>
                      <position x="181" y="668"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="curr_pos">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="65">
                      <position x="414" y="680"/>
                      <position x="340" y="680"/>
                      <position x="340" y="716"/>
                      <position x="267" y="716"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="new_pos">
                  <connectionPointOut>
                    <relPosition x="159" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <comment localId="55" height="152" width="642">
              <position x="113" y="1"/>
              <content>
                <xhtml:p><![CDATA[Main control loops:
1. Product Flow
2. Pressure
3. Composition
4. Pressure Override
5. Tank level]]></xhtml:p>
              </content>
            </comment>
            <comment localId="56" height="42" width="557">
              <position x="106" y="1683"/>
              <content>
                <xhtml:p><![CDATA[Scale variables for HMI (it treats everything as signed integers)]]></xhtml:p>
              </content>
            </comment>
            <block localId="57" typeName="scale_to_signed" instanceName="scale_to_signed0" height="40" width="161">
              <position x="268" y="1761"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="62">
                      <position x="268" y="1791"/>
                      <position x="247" y="1791"/>
                      <position x="247" y="1794"/>
                      <position x="226" y="1794"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <outVariable localId="58" height="27" width="90" negated="false">
              <position x="608" y="222"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="3" formalParameter="new_pos">
                  <position x="608" y="235"/>
                  <position x="568" y="235"/>
                  <position x="568" y="231"/>
                  <position x="529" y="231"/>
                </connection>
              </connectionPointIn>
              <expression>f1_valve_sp</expression>
            </outVariable>
            <outVariable localId="59" height="27" width="99" negated="false">
              <position x="641" y="620"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="27" formalParameter="new_pos">
                  <position x="641" y="633"/>
                  <position x="607" y="633"/>
                  <position x="607" y="640"/>
                  <position x="573" y="640"/>
                </connection>
              </connectionPointIn>
              <expression>f2_valve_sp</expression>
            </outVariable>
            <inVariable localId="22" height="27" width="103" negated="false" executionOrderId="0">
              <position x="113" y="475"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>pressure_sp</expression>
            </inVariable>
            <inVariable localId="31" height="27" width="103" negated="false" executionOrderId="0">
              <position x="74" y="417"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>pressure</expression>
            </inVariable>
            <block localId="38" typeName="pressure_control" instanceName="pressure_control0" height="80" width="166" executionOrderId="0">
              <position x="448" y="421"/>
              <inputVariables>
                <variable formalParameter="pressure">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="31">
                      <position x="448" y="451"/>
                      <position x="312" y="451"/>
                      <position x="312" y="430"/>
                      <position x="177" y="430"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="pressure_sp">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="22">
                      <position x="448" y="471"/>
                      <position x="342" y="471"/>
                      <position x="342" y="488"/>
                      <position x="216" y="488"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="curr_pos">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="66">
                      <position x="448" y="491"/>
                      <position x="428" y="491"/>
                      <position x="428" y="534"/>
                      <position x="363" y="534"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="valve_pos">
                  <connectionPointOut>
                    <relPosition x="166" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="62" height="27" width="70" negated="false">
              <position x="156" y="1781"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>pressure</expression>
            </inVariable>
            <outVariable localId="63" height="27" width="103" negated="false">
              <position x="496" y="1765"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="57" formalParameter="output_int">
                  <position x="496" y="1778"/>
                  <position x="455" y="1778"/>
                  <position x="455" y="1791"/>
                  <position x="429" y="1791"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_pressure</expression>
            </outVariable>
            <block localId="2" typeName="scale_to_signed" instanceName="scale_to_signed1" height="40" width="161" executionOrderId="0">
              <position x="251" y="1840"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="4">
                      <position x="251" y="1870"/>
                      <position x="230" y="1870"/>
                      <position x="230" y="1873"/>
                      <position x="209" y="1873"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="4" height="27" width="70" negated="false" executionOrderId="0">
              <position x="139" y="1860"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>level</expression>
            </inVariable>
            <outVariable localId="5" height="27" width="103" negated="false" executionOrderId="0">
              <position x="479" y="1844"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="2" formalParameter="output_int">
                  <position x="479" y="1857"/>
                  <position x="438" y="1857"/>
                  <position x="438" y="1870"/>
                  <position x="412" y="1870"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_level</expression>
            </outVariable>
            <block localId="7" typeName="scale_to_signed" instanceName="scale_to_signed2" height="40" width="161" executionOrderId="0">
              <position x="250" y="1922"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="8">
                      <position x="250" y="1952"/>
                      <position x="229" y="1952"/>
                      <position x="229" y="1953"/>
                      <position x="247" y="1953"/>
                      <position x="247" y="1949"/>
                      <position x="219" y="1949"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="8" height="27" width="99" negated="false" executionOrderId="0">
              <position x="120" y="1936"/>
              <connectionPointOut>
                <relPosition x="99" y="13"/>
              </connectionPointOut>
              <expression>f1_valve_pos</expression>
            </inVariable>
            <outVariable localId="9" height="27" width="132" negated="false" executionOrderId="0">
              <position x="478" y="1926"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="7" formalParameter="output_int">
                  <position x="478" y="1939"/>
                  <position x="437" y="1939"/>
                  <position x="437" y="1952"/>
                  <position x="411" y="1952"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_f1_valve_pos</expression>
            </outVariable>
            <block localId="10" typeName="scale_to_signed" instanceName="scale_to_signed3" height="40" width="161" executionOrderId="0">
              <position x="241" y="2014"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="11">
                      <position x="241" y="2044"/>
                      <position x="220" y="2044"/>
                      <position x="220" y="2045"/>
                      <position x="238" y="2045"/>
                      <position x="238" y="2047"/>
                      <position x="228" y="2047"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="11" height="27" width="99" negated="false" executionOrderId="0">
              <position x="129" y="2034"/>
              <connectionPointOut>
                <relPosition x="99" y="13"/>
              </connectionPointOut>
              <expression>f2_valve_pos</expression>
            </inVariable>
            <outVariable localId="12" height="27" width="132" negated="false" executionOrderId="0">
              <position x="469" y="2018"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="10" formalParameter="output_int">
                  <position x="469" y="2031"/>
                  <position x="428" y="2031"/>
                  <position x="428" y="2044"/>
                  <position x="402" y="2044"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_f2_valve_pos</expression>
            </outVariable>
            <block localId="13" typeName="scale_to_signed" instanceName="scale_to_signed4" height="40" width="161" executionOrderId="0">
              <position x="255" y="2079"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="16">
                      <position x="255" y="2109"/>
                      <position x="228" y="2109"/>
                      <position x="228" y="2124"/>
                      <position x="273" y="2124"/>
                      <position x="273" y="2129"/>
                      <position x="202" y="2129"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="16" height="27" width="126" negated="false" executionOrderId="0">
              <position x="76" y="2116"/>
              <connectionPointOut>
                <relPosition x="126" y="13"/>
              </connectionPointOut>
              <expression>purge_valve_pos</expression>
            </inVariable>
            <outVariable localId="17" height="27" width="159" negated="false" executionOrderId="0">
              <position x="477" y="2097"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="13" formalParameter="output_int">
                  <position x="477" y="2110"/>
                  <position x="465" y="2110"/>
                  <position x="465" y="2112"/>
                  <position x="474" y="2112"/>
                  <position x="474" y="2109"/>
                  <position x="416" y="2109"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_purge_valve_pos</expression>
            </outVariable>
            <block localId="19" typeName="scale_to_signed" instanceName="scale_to_signed5" height="40" width="161" executionOrderId="0">
              <position x="244" y="2170"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="20">
                      <position x="244" y="2200"/>
                      <position x="223" y="2200"/>
                      <position x="223" y="2201"/>
                      <position x="282" y="2201"/>
                      <position x="282" y="2200"/>
                      <position x="210" y="2200"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="20" height="27" width="140" negated="false" executionOrderId="0">
              <position x="70" y="2187"/>
              <connectionPointOut>
                <relPosition x="140" y="13"/>
              </connectionPointOut>
              <expression>product_valve_pos</expression>
            </inVariable>
            <outVariable localId="21" height="27" width="173" negated="false" executionOrderId="0">
              <position x="472" y="2174"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="19" formalParameter="output_int">
                  <position x="472" y="2187"/>
                  <position x="431" y="2187"/>
                  <position x="431" y="2200"/>
                  <position x="405" y="2200"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_product_valve_pos</expression>
            </outVariable>
            <block localId="23" typeName="scale_to_signed" instanceName="scale_to_signed6" height="40" width="161" executionOrderId="0">
              <position x="236" y="2248"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="24">
                      <position x="236" y="2278"/>
                      <position x="215" y="2278"/>
                      <position x="215" y="2281"/>
                      <position x="194" y="2281"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="24" height="27" width="70" negated="false" executionOrderId="0">
              <position x="124" y="2268"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>f1_flow</expression>
            </inVariable>
            <outVariable localId="25" height="27" width="103" negated="false" executionOrderId="0">
              <position x="464" y="2252"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="23" formalParameter="output_int">
                  <position x="464" y="2265"/>
                  <position x="423" y="2265"/>
                  <position x="423" y="2278"/>
                  <position x="397" y="2278"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_f1_flow</expression>
            </outVariable>
            <block localId="26" typeName="scale_to_signed" instanceName="scale_to_signed7" height="40" width="161" executionOrderId="0">
              <position x="231" y="2330"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="28">
                      <position x="231" y="2360"/>
                      <position x="210" y="2360"/>
                      <position x="210" y="2363"/>
                      <position x="189" y="2363"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="28" height="27" width="70" negated="false" executionOrderId="0">
              <position x="119" y="2350"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>f2_flow</expression>
            </inVariable>
            <outVariable localId="29" height="27" width="103" negated="false" executionOrderId="0">
              <position x="459" y="2334"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="26" formalParameter="output_int">
                  <position x="459" y="2347"/>
                  <position x="418" y="2347"/>
                  <position x="418" y="2360"/>
                  <position x="392" y="2360"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_f2_flow</expression>
            </outVariable>
            <block localId="30" typeName="scale_to_signed" instanceName="scale_to_signed8" height="40" width="161" executionOrderId="0">
              <position x="228" y="2403"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="32">
                      <position x="228" y="2433"/>
                      <position x="215" y="2433"/>
                      <position x="215" y="2437"/>
                      <position x="184" y="2437"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="32" height="27" width="89" negated="false" executionOrderId="0">
              <position x="95" y="2424"/>
              <connectionPointOut>
                <relPosition x="89" y="13"/>
              </connectionPointOut>
              <expression>purge_flow</expression>
            </inVariable>
            <outVariable localId="33" height="27" width="122" negated="false" executionOrderId="0">
              <position x="456" y="2407"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="30" formalParameter="output_int">
                  <position x="456" y="2420"/>
                  <position x="415" y="2420"/>
                  <position x="415" y="2433"/>
                  <position x="389" y="2433"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_purge_flow</expression>
            </outVariable>
            <block localId="34" typeName="scale_to_signed" instanceName="scale_to_signed9" height="40" width="161" executionOrderId="0">
              <position x="242" y="2480"/>
              <inputVariables>
                <variable formalParameter="input_uint">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="35">
                      <position x="242" y="2510"/>
                      <position x="204" y="2510"/>
                      <position x="204" y="2518"/>
                      <position x="226" y="2518"/>
                      <position x="226" y="2520"/>
                      <position x="216" y="2520"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="output_int">
                  <connectionPointOut>
                    <relPosition x="161" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="35" height="27" width="103" negated="false" executionOrderId="0">
              <position x="113" y="2507"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>product_flow</expression>
            </inVariable>
            <outVariable localId="36" height="27" width="136" negated="false" executionOrderId="0">
              <position x="463" y="2487"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="34" formalParameter="output_int">
                  <position x="463" y="2500"/>
                  <position x="413" y="2500"/>
                  <position x="413" y="2510"/>
                  <position x="403" y="2510"/>
                </connection>
              </connectionPointIn>
              <expression>hmi_product_flow</expression>
            </outVariable>
            <inVariable localId="64" height="27" width="99" negated="false">
              <position x="116" y="235"/>
              <connectionPointOut>
                <relPosition x="99" y="13"/>
              </connectionPointOut>
              <expression>f1_valve_pos</expression>
            </inVariable>
            <inVariable localId="65" height="27" width="99" negated="false">
              <position x="168" y="703"/>
              <connectionPointOut>
                <relPosition x="99" y="13"/>
              </connectionPointOut>
              <expression>f2_valve_pos</expression>
            </inVariable>
            <inVariable localId="66" height="27" width="126" negated="false">
              <position x="237" y="521"/>
              <connectionPointOut>
                <relPosition x="126" y="13"/>
              </connectionPointOut>
              <expression>purge_valve_pos</expression>
            </inVariable>
            <outVariable localId="67" height="27" width="117" negated="false">
              <position x="656" y="420"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="38" formalParameter="valve_pos">
                  <position x="656" y="433"/>
                  <position x="645" y="433"/>
                  <position x="645" y="451"/>
                  <position x="614" y="451"/>
                </connection>
              </connectionPointIn>
              <expression>purge_valve_sp</expression>
            </outVariable>
            <block localId="72" typeName="pressure_override" instanceName="pressure_override0" height="80" width="174">
              <position x="352" y="778"/>
              <inputVariables>
                <variable formalParameter="pressure">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="73">
                      <position x="352" y="808"/>
                      <position x="277" y="808"/>
                      <position x="277" y="805"/>
                      <position x="234" y="805"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="curr_sp">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="74">
                      <position x="352" y="828"/>
                      <position x="276" y="828"/>
                      <position x="276" y="863"/>
                      <position x="232" y="863"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="override_sp">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="75">
                      <position x="352" y="848"/>
                      <position x="315" y="848"/>
                      <position x="315" y="916"/>
                      <position x="279" y="916"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="product_sp">
                  <connectionPointOut>
                    <relPosition x="174" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="73" height="27" width="70" negated="false">
              <position x="164" y="792"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>pressure</expression>
            </inVariable>
            <inVariable localId="74" height="27" width="69" negated="false">
              <position x="163" y="850"/>
              <connectionPointOut>
                <relPosition x="69" y="13"/>
              </connectionPointOut>
              <expression>flow_set</expression>
            </inVariable>
            <inVariable localId="75" height="27" width="91" negated="false">
              <position x="188" y="903"/>
              <connectionPointOut>
                <relPosition x="91" y="13"/>
              </connectionPointOut>
              <expression>override_sp</expression>
            </inVariable>
            <outVariable localId="76" height="27" width="69" negated="false">
              <position x="626" y="789"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="72" formalParameter="product_sp">
                  <position x="626" y="802"/>
                  <position x="575" y="802"/>
                  <position x="575" y="808"/>
                  <position x="526" y="808"/>
                </connection>
              </connectionPointIn>
              <expression>flow_set</expression>
            </outVariable>
            <block localId="77" typeName="level_control" instanceName="level_control0" height="80" width="154">
              <position x="370" y="968"/>
              <inputVariables>
                <variable formalParameter="liquid_level">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="78">
                      <position x="370" y="998"/>
                      <position x="305" y="998"/>
                      <position x="305" y="993"/>
                      <position x="240" y="993"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="level_sp">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="79">
                      <position x="370" y="1018"/>
                      <position x="295" y="1018"/>
                      <position x="295" y="1050"/>
                      <position x="240" y="1050"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="curr_pos">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="80">
                      <position x="370" y="1038"/>
                      <position x="339" y="1038"/>
                      <position x="339" y="1097"/>
                      <position x="309" y="1097"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="new_pos">
                  <connectionPointOut>
                    <relPosition x="154" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="78" height="27" width="42" negated="false">
              <position x="198" y="980"/>
              <connectionPointOut>
                <relPosition x="42" y="13"/>
              </connectionPointOut>
              <expression>level</expression>
            </inVariable>
            <inVariable localId="79" height="27" width="65" negated="false">
              <position x="194" y="1037"/>
              <connectionPointOut>
                <relPosition x="65" y="13"/>
              </connectionPointOut>
              <expression>level_sp</expression>
            </inVariable>
            <inVariable localId="80" height="27" width="140" negated="false">
              <position x="169" y="1084"/>
              <connectionPointOut>
                <relPosition x="140" y="13"/>
              </connectionPointOut>
              <expression>product_valve_pos</expression>
            </inVariable>
            <outVariable localId="81" height="27" width="131" negated="false">
              <position x="592" y="979"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="77" formalParameter="new_pos">
                  <position x="592" y="992"/>
                  <position x="558" y="992"/>
                  <position x="558" y="998"/>
                  <position x="524" y="998"/>
                </connection>
              </connectionPointIn>
              <expression>product_valve_sp</expression>
            </outVariable>
            <comment localId="86" height="39" width="763">
              <position x="60" y="1165"/>
              <content>
                <xhtml:p><![CDATA[If run_bit=0, then stop the process by setting everything to a safe state]]></xhtml:p>
              </content>
            </comment>
            <block localId="87" typeName="ADD" height="60" width="68">
              <position x="239" y="2575"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="88">
                      <position x="239" y="2605"/>
                      <position x="218" y="2605"/>
                      <position x="218" y="2597"/>
                      <position x="197" y="2597"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="89">
                      <position x="239" y="2625"/>
                      <position x="220" y="2625"/>
                      <position x="220" y="2648"/>
                      <position x="179" y="2648"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="88" height="27" width="88" negated="false">
              <position x="109" y="2584"/>
              <connectionPointOut>
                <relPosition x="88" y="13"/>
              </connectionPointOut>
              <expression>scan_count</expression>
            </inVariable>
            <inVariable localId="89" height="27" width="18" negated="false">
              <position x="161" y="2635"/>
              <connectionPointOut>
                <relPosition x="18" y="13"/>
              </connectionPointOut>
              <expression>1</expression>
            </inVariable>
            <outVariable localId="90" height="27" width="88" negated="false">
              <position x="373" y="2582"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="87" formalParameter="OUT">
                  <position x="373" y="2595"/>
                  <position x="325" y="2595"/>
                  <position x="325" y="2605"/>
                  <position x="307" y="2605"/>
                </connection>
              </connectionPointIn>
              <expression>scan_count</expression>
            </outVariable>
            <block localId="91" typeName="GE" height="60" width="68">
              <position x="248" y="2695"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="37">
                      <position x="248" y="2725"/>
                      <position x="207" y="2725"/>
                      <position x="207" y="2716"/>
                      <position x="175" y="2716"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="39">
                      <position x="248" y="2745"/>
                      <position x="218" y="2745"/>
                      <position x="218" y="2764"/>
                      <position x="208" y="2764"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="37" height="27" width="88" negated="false" executionOrderId="0">
              <position x="87" y="2703"/>
              <connectionPointOut>
                <relPosition x="88" y="13"/>
              </connectionPointOut>
              <expression>scan_count</expression>
            </inVariable>
            <inVariable localId="39" height="27" width="50" negated="false" executionOrderId="0">
              <position x="158" y="2751"/>
              <connectionPointOut>
                <relPosition x="50" y="13"/>
              </connectionPointOut>
              <expression>32000</expression>
            </inVariable>
            <block localId="92" typeName="MOVE" height="60" width="67">
              <position x="390" y="2733"/>
              <inputVariables>
                <variable formalParameter="EN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="91" formalParameter="OUT">
                      <position x="390" y="2763"/>
                      <position x="358" y="2763"/>
                      <position x="358" y="2725"/>
                      <position x="316" y="2725"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="40">
                      <position x="390" y="2783"/>
                      <position x="366" y="2783"/>
                      <position x="366" y="2792"/>
                      <position x="342" y="2792"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="ENO">
                  <connectionPointOut>
                    <relPosition x="67" y="30"/>
                  </connectionPointOut>
                </variable>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="67" y="50"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="40" height="27" width="50" negated="false" executionOrderId="0">
              <position x="292" y="2779"/>
              <connectionPointOut>
                <relPosition x="50" y="13"/>
              </connectionPointOut>
              <expression>0</expression>
            </inVariable>
            <outVariable localId="41" height="27" width="88" negated="false" executionOrderId="0">
              <position x="497" y="2750"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="92" formalParameter="OUT">
                  <position x="497" y="2763"/>
                  <position x="478" y="2763"/>
                  <position x="478" y="2783"/>
                  <position x="457" y="2783"/>
                </connection>
              </connectionPointIn>
              <expression>scan_count</expression>
            </outVariable>
          </LD>
        </body>
      </pou>
      <pou name="pressure_control" pouType="functionBlock">
        <interface>
          <localVars>
            <variable name="pressure_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="2700.0"/>
              </initialValue>
            </variable>
          </localVars>
          <inputVars>
            <variable name="pressure">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="58981"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="pressure_sp_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="2700.0"/>
              </initialValue>
            </variable>
          </localVars>
          <inputVars>
            <variable name="pressure_sp">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="58981"/>
              </initialValue>
            </variable>
            <variable name="curr_pos">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="valve_pos_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="39.25"/>
              </initialValue>
            </variable>
            <variable name="pos_update_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="valve_pos_nominal">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="39.25"/>
              </initialValue>
            </variable>
          </localVars>
          <outputVars>
            <variable name="valve_pos">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="25886"/>
              </initialValue>
            </variable>
          </outputVars>
          <localVars>
            <variable name="pressure_k">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="20.0"/>
              </initialValue>
            </variable>
            <variable name="pressure_ti">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="999.0"/>
              </initialValue>
            </variable>
            <variable name="cycle_time">
              <type>
                <TIME/>
              </type>
              <initialValue>
                <simpleValue value="T#50ms"/>
              </initialValue>
            </variable>
            <variable name="scale_to_real5">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="scale_to_real4">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="scale_to_uint0">
              <type>
                <derived name="scale_to_uint"/>
              </type>
            </variable>
            <variable name="pressure_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="3200.00"/>
              </initialValue>
            </variable>
            <variable name="pressure_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="pos_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="pos_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
            <variable name="scale_to_real0">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <LD>
            <leftPowerRail localId="2" height="320" width="3">
              <position x="12" y="351"/>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="20"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="60"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="100"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="140"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="180"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="220"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="260"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="300"/>
              </connectionPointOut>
            </leftPowerRail>
            <block localId="37" typeName="scale_to_real" instanceName="scale_to_real5" height="120" width="205" executionOrderId="0">
              <position x="206" y="19"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="36"/>
                    <connection refLocalId="41">
                      <position x="206" y="55"/>
                      <position x="173" y="55"/>
                      <position x="173" y="30"/>
                      <position x="140" y="30"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="69"/>
                    <connection refLocalId="39">
                      <position x="206" y="88"/>
                      <position x="171" y="88"/>
                      <position x="171" y="81"/>
                      <position x="123" y="81"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="102"/>
                    <connection refLocalId="40">
                      <position x="206" y="121"/>
                      <position x="173" y="121"/>
                      <position x="173" y="136"/>
                      <position x="128" y="136"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="36"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="39" height="27" width="106" negated="false" executionOrderId="0">
              <position x="17" y="68"/>
              <connectionPointOut>
                <relPosition x="106" y="13"/>
              </connectionPointOut>
              <expression>pressure_max</expression>
            </inVariable>
            <inVariable localId="40" height="27" width="103" negated="false" executionOrderId="0">
              <position x="25" y="123"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>pressure_min</expression>
            </inVariable>
            <inVariable localId="41" height="27" width="70" negated="false">
              <position x="70" y="17"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>pressure</expression>
            </inVariable>
            <outVariable localId="42" height="27" width="103" negated="false">
              <position x="453" y="28"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="37" formalParameter="scaled_real">
                  <position x="453" y="41"/>
                  <position x="427" y="41"/>
                  <position x="427" y="55"/>
                  <position x="411" y="55"/>
                </connection>
              </connectionPointIn>
              <expression>pressure_real</expression>
            </outVariable>
            <block localId="23" typeName="scale_to_real" instanceName="scale_to_real4" height="120" width="205" executionOrderId="0">
              <position x="216" y="160"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="36"/>
                    <connection refLocalId="43">
                      <position x="216" y="196"/>
                      <position x="173" y="196"/>
                      <position x="173" y="200"/>
                      <position x="131" y="200"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="69"/>
                    <connection refLocalId="30">
                      <position x="216" y="229"/>
                      <position x="170" y="229"/>
                      <position x="170" y="241"/>
                      <position x="125" y="241"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="102"/>
                    <connection refLocalId="32">
                      <position x="216" y="262"/>
                      <position x="180" y="262"/>
                      <position x="180" y="271"/>
                      <position x="145" y="271"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="36"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="30" height="27" width="106" negated="false" executionOrderId="0">
              <position x="19" y="228"/>
              <connectionPointOut>
                <relPosition x="106" y="13"/>
              </connectionPointOut>
              <expression>pressure_max</expression>
            </inVariable>
            <inVariable localId="32" height="27" width="103" negated="false" executionOrderId="0">
              <position x="42" y="258"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>pressure_min</expression>
            </inVariable>
            <inVariable localId="43" height="27" width="93" negated="false">
              <position x="38" y="187"/>
              <connectionPointOut>
                <relPosition x="93" y="13"/>
              </connectionPointOut>
              <expression>pressure_sp</expression>
            </inVariable>
            <outVariable localId="44" height="27" width="126" negated="false">
              <position x="467" y="173"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="23" formalParameter="scaled_real">
                  <position x="467" y="186"/>
                  <position x="450" y="186"/>
                  <position x="450" y="196"/>
                  <position x="421" y="196"/>
                </connection>
              </connectionPointIn>
              <expression>pressure_sp_real</expression>
            </outVariable>
            <block localId="45" typeName="scale_to_uint" instanceName="scale_to_uint0" height="40" width="120">
              <position x="534" y="820"/>
              <inputVariables>
                <variable formalParameter="real_in">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="55" formalParameter="OUT">
                      <position x="534" y="850"/>
                      <position x="485" y="850"/>
                      <position x="485" y="840"/>
                      <position x="436" y="840"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="uint_out">
                  <connectionPointOut>
                    <relPosition x="120" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <outVariable localId="47" height="27" width="78" negated="false">
              <position x="701" y="813"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="45" formalParameter="uint_out">
                  <position x="701" y="826"/>
                  <position x="680" y="826"/>
                  <position x="680" y="850"/>
                  <position x="654" y="850"/>
                </connection>
              </connectionPointIn>
              <expression>valve_pos</expression>
            </outVariable>
            <inVariable localId="49" height="27" width="70" negated="false">
              <position x="147" y="672"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>curr_pos</expression>
            </inVariable>
            <block localId="50" typeName="scale_to_real" instanceName="scale_to_real0" height="80" width="205">
              <position x="346" y="639"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="49">
                      <position x="346" y="669"/>
                      <position x="322" y="669"/>
                      <position x="322" y="685"/>
                      <position x="217" y="685"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="51">
                      <position x="346" y="689"/>
                      <position x="284" y="689"/>
                      <position x="284" y="717"/>
                      <position x="222" y="717"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="9">
                      <position x="346" y="709"/>
                      <position x="287" y="709"/>
                      <position x="287" y="747"/>
                      <position x="228" y="747"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="51" height="27" width="71" negated="false">
              <position x="151" y="704"/>
              <connectionPointOut>
                <relPosition x="71" y="13"/>
              </connectionPointOut>
              <expression>pos_max</expression>
            </inVariable>
            <inVariable localId="9" height="27" width="71" negated="false" executionOrderId="0">
              <position x="157" y="734"/>
              <connectionPointOut>
                <relPosition x="71" y="13"/>
              </connectionPointOut>
              <expression>pos_min</expression>
            </inVariable>
            <outVariable localId="52" height="27" width="111" negated="false">
              <position x="656" y="625"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="50" formalParameter="scaled_real">
                  <position x="656" y="638"/>
                  <position x="634" y="638"/>
                  <position x="634" y="669"/>
                  <position x="551" y="669"/>
                </connection>
              </connectionPointIn>
              <expression>valve_pos_real</expression>
            </outVariable>
            <block localId="53" typeName="SUB" height="60" width="68">
              <position x="191" y="819"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="54">
                      <position x="191" y="849"/>
                      <position x="158" y="849"/>
                      <position x="158" y="834"/>
                      <position x="138" y="834"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="10">
                      <position x="191" y="869"/>
                      <position x="165" y="869"/>
                      <position x="165" y="881"/>
                      <position x="151" y="881"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="54" height="27" width="111" negated="false">
              <position x="27" y="821"/>
              <connectionPointOut>
                <relPosition x="111" y="13"/>
              </connectionPointOut>
              <expression>valve_pos_real</expression>
            </inVariable>
            <inVariable localId="10" height="27" width="124" negated="false" executionOrderId="0">
              <position x="27" y="868"/>
              <connectionPointOut>
                <relPosition x="124" y="13"/>
              </connectionPointOut>
              <expression>pos_update_real</expression>
            </inVariable>
            <block localId="55" typeName="LIMIT" height="80" width="69">
              <position x="367" y="810"/>
              <inputVariables>
                <variable formalParameter="MN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="56">
                      <position x="367" y="840"/>
                      <position x="348" y="840"/>
                      <position x="348" y="811"/>
                      <position x="329" y="811"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="53" formalParameter="OUT">
                      <position x="367" y="860"/>
                      <position x="311" y="860"/>
                      <position x="311" y="849"/>
                      <position x="259" y="849"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="MX">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="11">
                      <position x="367" y="880"/>
                      <position x="354" y="880"/>
                      <position x="354" y="905"/>
                      <position x="341" y="905"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="69" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="56" height="27" width="68" negated="false">
              <position x="261" y="798"/>
              <connectionPointOut>
                <relPosition x="68" y="13"/>
              </connectionPointOut>
              <expression>pos_min</expression>
            </inVariable>
            <inVariable localId="11" height="27" width="71" negated="false" executionOrderId="0">
              <position x="270" y="892"/>
              <connectionPointOut>
                <relPosition x="71" y="13"/>
              </connectionPointOut>
              <expression>pos_max</expression>
            </inVariable>
            <block localId="57" typeName="SUB" height="60" width="68">
              <position x="373" y="423"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="58">
                      <position x="373" y="453"/>
                      <position x="343" y="453"/>
                      <position x="343" y="419"/>
                      <position x="314" y="419"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="59">
                      <position x="373" y="473"/>
                      <position x="329" y="473"/>
                      <position x="329" y="477"/>
                      <position x="285" y="477"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="58" height="27" width="126" negated="false">
              <position x="188" y="406"/>
              <connectionPointOut>
                <relPosition x="126" y="13"/>
              </connectionPointOut>
              <expression>pressure_sp_real</expression>
            </inVariable>
            <inVariable localId="59" height="27" width="103" negated="false">
              <position x="182" y="464"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>pressure_real</expression>
            </inVariable>
            <block localId="60" typeName="MUL" height="60" width="68">
              <position x="577" y="420"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="57" formalParameter="OUT">
                      <position x="577" y="450"/>
                      <position x="509" y="450"/>
                      <position x="509" y="453"/>
                      <position x="441" y="453"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="61">
                      <position x="577" y="470"/>
                      <position x="563" y="470"/>
                      <position x="563" y="521"/>
                      <position x="550" y="521"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="61" height="27" width="85" negated="false">
              <position x="465" y="508"/>
              <connectionPointOut>
                <relPosition x="85" y="13"/>
              </connectionPointOut>
              <expression>pressure_k</expression>
            </inVariable>
            <outVariable localId="62" height="27" width="124" negated="false">
              <position x="702" y="459"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="60" formalParameter="OUT">
                  <position x="702" y="472"/>
                  <position x="673" y="472"/>
                  <position x="673" y="450"/>
                  <position x="645" y="450"/>
                </connection>
              </connectionPointIn>
              <expression>pos_update_real</expression>
            </outVariable>
          </LD>
        </body>
      </pou>
      <pou name="flow_control" pouType="functionBlock">
        <interface>
          <localVars>
            <variable name="flow_k">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="1.0"/>
              </initialValue>
            </variable>
            <variable name="flow_ti">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="999.0"/>
              </initialValue>
            </variable>
            <variable name="flow_td">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
          </localVars>
          <inputVars>
            <variable name="product_flow">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="6554"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="product_flow_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
            <variable name="cycle_time">
              <type>
                <TIME/>
              </type>
              <initialValue>
                <simpleValue value="T#50ms"/>
              </initialValue>
            </variable>
            <variable name="pos_update_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="curr_pos_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="60.9"/>
              </initialValue>
            </variable>
          </localVars>
          <outputVars>
            <variable name="new_pos">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="35000"/>
              </initialValue>
            </variable>
          </outputVars>
          <inputVars>
            <variable name="curr_pos">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="35000"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="flow_set_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
          </localVars>
          <inputVars>
            <variable name="flow_set_in">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="6554"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="scale_to_real0">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="scale_to_real1">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="flow_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="500.0"/>
              </initialValue>
            </variable>
            <variable name="flow_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="pos_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="pos_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
            <variable name="scale_to_real2">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="scale_to_uint0">
              <type>
                <derived name="scale_to_uint"/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <LD>
            <leftPowerRail localId="1" height="715" width="3">
              <position x="29" y="311"/>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="20"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="189"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="358"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="526"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="695"/>
              </connectionPointOut>
            </leftPowerRail>
            <inVariable localId="4" height="27" width="102" negated="false">
              <position x="79" y="390"/>
              <connectionPointOut>
                <relPosition x="102" y="13"/>
              </connectionPointOut>
              <expression>flow_set_real</expression>
            </inVariable>
            <outVariable localId="9" height="27" width="124" negated="false">
              <position x="841" y="368"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="60" formalParameter="OUT">
                  <position x="841" y="381"/>
                  <position x="737" y="381"/>
                  <position x="737" y="406"/>
                  <position x="634" y="406"/>
                </connection>
              </connectionPointIn>
              <expression>pos_update_real</expression>
            </outVariable>
            <block localId="11" typeName="scale_to_real" instanceName="scale_to_real0" height="120" width="205" executionOrderId="0">
              <position x="260" y="19"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="5">
                      <position x="260" y="49"/>
                      <position x="227" y="49"/>
                      <position x="227" y="16"/>
                      <position x="194" y="16"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="12">
                      <position x="260" y="69"/>
                      <position x="206" y="69"/>
                      <position x="206" y="47"/>
                      <position x="151" y="47"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="10">
                      <position x="260" y="89"/>
                      <position x="203" y="89"/>
                      <position x="203" y="80"/>
                      <position x="146" y="80"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="raw_max">
                  <connectionPointIn>
                    <relPosition x="0" y="90"/>
                    <connection refLocalId="13">
                      <position x="260" y="109"/>
                      <position x="211" y="109"/>
                      <position x="211" y="108"/>
                      <position x="162" y="108"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="raw_min">
                  <connectionPointIn>
                    <relPosition x="0" y="110"/>
                    <connection refLocalId="14">
                      <position x="260" y="129"/>
                      <position x="213" y="129"/>
                      <position x="213" y="146"/>
                      <position x="167" y="146"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="12" height="27" width="117" negated="false" executionOrderId="0">
              <position x="34" y="34"/>
              <connectionPointOut>
                <relPosition x="117" y="13"/>
              </connectionPointOut>
              <expression>flow_max</expression>
            </inVariable>
            <inVariable localId="10" height="27" width="74" negated="false" executionOrderId="0">
              <position x="72" y="67"/>
              <connectionPointOut>
                <relPosition x="74" y="13"/>
              </connectionPointOut>
              <expression>flow_min</expression>
            </inVariable>
            <inVariable localId="5" height="27" width="103" negated="false" executionOrderId="0">
              <position x="91" y="3"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>product_flow</expression>
            </inVariable>
            <outVariable localId="15" height="27" width="136" negated="false">
              <position x="501" y="41"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="11" formalParameter="scaled_real">
                  <position x="501" y="54"/>
                  <position x="491" y="54"/>
                  <position x="491" y="49"/>
                  <position x="465" y="49"/>
                </connection>
              </connectionPointIn>
              <expression>product_flow_real</expression>
            </outVariable>
            <inVariable localId="16" height="27" width="136" negated="false">
              <position x="57" y="447"/>
              <connectionPointOut>
                <relPosition x="136" y="13"/>
              </connectionPointOut>
              <expression>product_flow_real</expression>
            </inVariable>
            <block localId="2" typeName="scale_to_real" instanceName="scale_to_real1" height="120" width="205" executionOrderId="0">
              <position x="253" y="165"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="36"/>
                    <connection refLocalId="25">
                      <position x="253" y="201"/>
                      <position x="230" y="201"/>
                      <position x="230" y="195"/>
                      <position x="245" y="195"/>
                      <position x="245" y="173"/>
                      <position x="144" y="173"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="69"/>
                    <connection refLocalId="20">
                      <position x="253" y="234"/>
                      <position x="200" y="234"/>
                      <position x="200" y="214"/>
                      <position x="147" y="214"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="102"/>
                    <connection refLocalId="21">
                      <position x="253" y="267"/>
                      <position x="196" y="267"/>
                      <position x="196" y="240"/>
                      <position x="140" y="240"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="36"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="20" height="27" width="117" negated="false" executionOrderId="0">
              <position x="30" y="201"/>
              <connectionPointOut>
                <relPosition x="117" y="13"/>
              </connectionPointOut>
              <expression>flow_max</expression>
            </inVariable>
            <inVariable localId="21" height="27" width="74" negated="false" executionOrderId="0">
              <position x="66" y="227"/>
              <connectionPointOut>
                <relPosition x="74" y="13"/>
              </connectionPointOut>
              <expression>flow_min</expression>
            </inVariable>
            <inVariable localId="25" height="27" width="89" negated="false">
              <position x="55" y="160"/>
              <connectionPointOut>
                <relPosition x="89" y="13"/>
              </connectionPointOut>
              <expression>flow_set_in</expression>
            </inVariable>
            <outVariable localId="26" height="27" width="102" negated="false">
              <position x="505" y="195"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="2" formalParameter="scaled_real">
                  <position x="505" y="208"/>
                  <position x="481" y="208"/>
                  <position x="481" y="197"/>
                  <position x="458" y="197"/>
                </connection>
              </connectionPointIn>
              <expression>flow_set_real</expression>
            </outVariable>
            <block localId="28" typeName="scale_to_real" instanceName="scale_to_real2" height="80" width="205">
              <position x="260" y="628"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="29">
                      <position x="260" y="658"/>
                      <position x="236" y="658"/>
                      <position x="236" y="633"/>
                      <position x="161" y="633"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="31">
                      <position x="260" y="678"/>
                      <position x="213" y="678"/>
                      <position x="213" y="681"/>
                      <position x="166" y="681"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="30">
                      <position x="260" y="698"/>
                      <position x="219" y="698"/>
                      <position x="219" y="712"/>
                      <position x="178" y="712"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="29" height="27" width="70" negated="false">
              <position x="91" y="620"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>curr_pos</expression>
            </inVariable>
            <inVariable localId="30" height="27" width="68" negated="false">
              <position x="110" y="699"/>
              <connectionPointOut>
                <relPosition x="68" y="13"/>
              </connectionPointOut>
              <expression>pos_min</expression>
            </inVariable>
            <inVariable localId="31" height="27" width="71" negated="false">
              <position x="95" y="668"/>
              <connectionPointOut>
                <relPosition x="71" y="13"/>
              </connectionPointOut>
              <expression>pos_max</expression>
            </inVariable>
            <outVariable localId="32" height="27" width="103" negated="false">
              <position x="506" y="670"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="28" formalParameter="scaled_real">
                  <position x="506" y="683"/>
                  <position x="482" y="683"/>
                  <position x="482" y="658"/>
                  <position x="465" y="658"/>
                </connection>
              </connectionPointIn>
              <expression>curr_pos_real</expression>
            </outVariable>
            <inVariable localId="34" height="27" width="103" negated="false">
              <position x="36" y="777"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>curr_pos_real</expression>
            </inVariable>
            <inVariable localId="35" height="27" width="124" negated="false">
              <position x="37" y="853"/>
              <connectionPointOut>
                <relPosition x="124" y="13"/>
              </connectionPointOut>
              <expression>pos_update_real</expression>
            </inVariable>
            <block localId="36" typeName="scale_to_uint" instanceName="scale_to_uint0" height="40" width="120">
              <position x="453" y="787"/>
              <inputVariables>
                <variable formalParameter="real_in">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="40" formalParameter="OUT">
                      <position x="453" y="817"/>
                      <position x="433" y="817"/>
                      <position x="433" y="786"/>
                      <position x="413" y="786"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="uint_out">
                  <connectionPointOut>
                    <relPosition x="120" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <outVariable localId="37" height="27" width="71" negated="false">
              <position x="606" y="818"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="36" formalParameter="uint_out">
                  <position x="606" y="831"/>
                  <position x="589" y="831"/>
                  <position x="589" y="817"/>
                  <position x="573" y="817"/>
                </connection>
              </connectionPointIn>
              <expression>new_pos</expression>
            </outVariable>
            <block localId="40" typeName="LIMIT" height="80" width="69">
              <position x="344" y="756"/>
              <inputVariables>
                <variable formalParameter="MN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="42">
                      <position x="344" y="786"/>
                      <position x="330" y="786"/>
                      <position x="330" y="753"/>
                      <position x="316" y="753"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="58" formalParameter="OUT">
                      <position x="344" y="806"/>
                      <position x="284" y="806"/>
                      <position x="284" y="799"/>
                      <position x="250" y="799"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="MX">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="41">
                      <position x="344" y="826"/>
                      <position x="329" y="826"/>
                      <position x="329" y="843"/>
                      <position x="314" y="843"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="69" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="41" height="27" width="71" negated="false">
              <position x="243" y="830"/>
              <connectionPointOut>
                <relPosition x="71" y="13"/>
              </connectionPointOut>
              <expression>pos_max</expression>
            </inVariable>
            <inVariable localId="42" height="27" width="68" negated="false">
              <position x="248" y="740"/>
              <connectionPointOut>
                <relPosition x="68" y="13"/>
              </connectionPointOut>
              <expression>pos_min</expression>
            </inVariable>
            <inVariable localId="54" height="27" width="56" negated="false">
              <position x="427" y="453"/>
              <connectionPointOut>
                <relPosition x="56" y="13"/>
              </connectionPointOut>
              <expression>flow_k</expression>
            </inVariable>
            <block localId="58" typeName="ADD" height="60" width="68">
              <position x="182" y="769"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="34">
                      <position x="182" y="799"/>
                      <position x="146" y="799"/>
                      <position x="146" y="795"/>
                      <position x="151" y="795"/>
                      <position x="151" y="790"/>
                      <position x="139" y="790"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="35">
                      <position x="182" y="819"/>
                      <position x="146" y="819"/>
                      <position x="146" y="849"/>
                      <position x="171" y="849"/>
                      <position x="171" y="866"/>
                      <position x="161" y="866"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="59" typeName="SUB" height="60" width="68">
              <position x="277" y="383"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="4">
                      <position x="277" y="413"/>
                      <position x="229" y="413"/>
                      <position x="229" y="403"/>
                      <position x="181" y="403"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="16">
                      <position x="277" y="433"/>
                      <position x="235" y="433"/>
                      <position x="235" y="460"/>
                      <position x="193" y="460"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="60" typeName="MUL" height="60" width="68">
              <position x="566" y="376"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="59" formalParameter="OUT">
                      <position x="566" y="406"/>
                      <position x="493" y="406"/>
                      <position x="493" y="413"/>
                      <position x="345" y="413"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="54">
                      <position x="566" y="426"/>
                      <position x="556" y="426"/>
                      <position x="556" y="466"/>
                      <position x="483" y="466"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
          </LD>
        </body>
      </pou>
      <pou name="composition_control" pouType="functionBlock">
        <interface>
          <localVars>
            <variable name="a_in_purge_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="47.00"/>
              </initialValue>
            </variable>
          </localVars>
          <inputVars>
            <variable name="a_in_purge">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="32000"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="a_setpoint_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="47.00"/>
              </initialValue>
            </variable>
          </localVars>
          <inputVars>
            <variable name="a_setpoint">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="32000"/>
              </initialValue>
            </variable>
            <variable name="curr_pos">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="16000"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="valve_pos_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="25.0"/>
              </initialValue>
            </variable>
            <variable name="pos_update_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="valve_pos_nominal">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="25.0"/>
              </initialValue>
            </variable>
          </localVars>
          <outputVars>
            <variable name="new_pos">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="16000"/>
              </initialValue>
            </variable>
          </outputVars>
          <localVars>
            <variable name="composition_k">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="1.0"/>
              </initialValue>
            </variable>
            <variable name="composition_ti">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="99.0"/>
              </initialValue>
            </variable>
            <variable name="cycle_time">
              <type>
                <TIME/>
              </type>
              <initialValue>
                <simpleValue value="T#50ms"/>
              </initialValue>
            </variable>
            <variable name="scale_to_real3">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="scale_to_real2">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="scale_to_uint0">
              <type>
                <derived name="scale_to_uint"/>
              </type>
            </variable>
            <variable name="comp_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
            <variable name="comp_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="pos_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
            <variable name="pos_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="scale_to_real0">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <LD>
            <leftPowerRail localId="2" height="200" width="3">
              <position x="0" y="339"/>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="20"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="60"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="100"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="140"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="180"/>
              </connectionPointOut>
            </leftPowerRail>
            <inVariable localId="3" height="27" width="119" negated="false">
              <position x="96" y="361"/>
              <connectionPointOut>
                <relPosition x="119" y="13"/>
              </connectionPointOut>
              <expression>a_in_purge_real</expression>
            </inVariable>
            <inVariable localId="4" height="27" width="116" negated="false">
              <position x="68" y="317"/>
              <connectionPointOut>
                <relPosition x="116" y="13"/>
              </connectionPointOut>
              <expression>a_setpoint_real</expression>
            </inVariable>
            <inVariable localId="5" height="27" width="111" negated="false">
              <position x="342" y="406"/>
              <connectionPointOut>
                <relPosition x="111" y="13"/>
              </connectionPointOut>
              <expression>composition_k</expression>
            </inVariable>
            <outVariable localId="8" height="27" width="124" negated="false">
              <position x="760" y="349"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="46" formalParameter="OUT">
                  <position x="760" y="362"/>
                  <position x="666" y="362"/>
                  <position x="666" y="376"/>
                  <position x="572" y="376"/>
                </connection>
              </connectionPointIn>
              <expression>pos_update_real</expression>
            </outVariable>
            <block localId="26" typeName="scale_to_real" instanceName="scale_to_real3" height="120" width="205" executionOrderId="0">
              <position x="234" y="19"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="36"/>
                    <connection refLocalId="30">
                      <position x="234" y="55"/>
                      <position x="212" y="55"/>
                      <position x="212" y="51"/>
                      <position x="191" y="51"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="69"/>
                    <connection refLocalId="28">
                      <position x="234" y="88"/>
                      <position x="160" y="88"/>
                      <position x="160" y="95"/>
                      <position x="117" y="95"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="102"/>
                    <connection refLocalId="29">
                      <position x="234" y="121"/>
                      <position x="162" y="121"/>
                      <position x="162" y="129"/>
                      <position x="121" y="129"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="36"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="28" height="27" width="84" negated="false" executionOrderId="0">
              <position x="33" y="82"/>
              <connectionPointOut>
                <relPosition x="84" y="13"/>
              </connectionPointOut>
              <expression>comp_max</expression>
            </inVariable>
            <inVariable localId="29" height="27" width="81" negated="false" executionOrderId="0">
              <position x="40" y="116"/>
              <connectionPointOut>
                <relPosition x="81" y="13"/>
              </connectionPointOut>
              <expression>comp_min</expression>
            </inVariable>
            <inVariable localId="30" height="27" width="86" negated="false">
              <position x="105" y="38"/>
              <connectionPointOut>
                <relPosition x="86" y="13"/>
              </connectionPointOut>
              <expression>a_in_purge</expression>
            </inVariable>
            <outVariable localId="31" height="27" width="119" negated="false">
              <position x="486" y="25"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="26" formalParameter="scaled_real">
                  <position x="486" y="38"/>
                  <position x="463" y="38"/>
                  <position x="463" y="55"/>
                  <position x="439" y="55"/>
                </connection>
              </connectionPointIn>
              <expression>a_in_purge_real</expression>
            </outVariable>
            <block localId="16" typeName="scale_to_real" instanceName="scale_to_real2" height="120" width="205" executionOrderId="0">
              <position x="239" y="163"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="36"/>
                    <connection refLocalId="32">
                      <position x="239" y="199"/>
                      <position x="216" y="199"/>
                      <position x="216" y="193"/>
                      <position x="193" y="193"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="69"/>
                    <connection refLocalId="17">
                      <position x="239" y="232"/>
                      <position x="184" y="232"/>
                      <position x="184" y="224"/>
                      <position x="129" y="224"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="102"/>
                    <connection refLocalId="19">
                      <position x="239" y="265"/>
                      <position x="192" y="265"/>
                      <position x="192" y="258"/>
                      <position x="145" y="258"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="36"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="17" height="27" width="84" negated="false" executionOrderId="0">
              <position x="45" y="211"/>
              <connectionPointOut>
                <relPosition x="84" y="13"/>
              </connectionPointOut>
              <expression>comp_max</expression>
            </inVariable>
            <inVariable localId="19" height="27" width="81" negated="false" executionOrderId="0">
              <position x="64" y="245"/>
              <connectionPointOut>
                <relPosition x="81" y="13"/>
              </connectionPointOut>
              <expression>comp_min</expression>
            </inVariable>
            <inVariable localId="32" height="27" width="83" negated="false">
              <position x="110" y="180"/>
              <connectionPointOut>
                <relPosition x="83" y="13"/>
              </connectionPointOut>
              <expression>a_setpoint</expression>
            </inVariable>
            <outVariable localId="33" height="27" width="116" negated="false">
              <position x="473" y="170"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="16" formalParameter="scaled_real">
                  <position x="473" y="183"/>
                  <position x="463" y="183"/>
                  <position x="463" y="199"/>
                  <position x="444" y="199"/>
                </connection>
              </connectionPointIn>
              <expression>a_setpoint_real</expression>
            </outVariable>
            <block localId="34" typeName="scale_to_uint" instanceName="scale_to_uint0" height="40" width="120">
              <position x="525" y="646"/>
              <inputVariables>
                <variable formalParameter="real_in">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="44" formalParameter="OUT">
                      <position x="525" y="676"/>
                      <position x="507" y="676"/>
                      <position x="507" y="691"/>
                      <position x="490" y="691"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="uint_out">
                  <connectionPointOut>
                    <relPosition x="120" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <outVariable localId="36" height="27" width="78" negated="false">
              <position x="703" y="661"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="34" formalParameter="uint_out">
                  <position x="703" y="674"/>
                  <position x="674" y="674"/>
                  <position x="674" y="676"/>
                  <position x="645" y="676"/>
                </connection>
              </connectionPointIn>
              <expression>new_pos</expression>
            </outVariable>
            <block localId="38" typeName="scale_to_real" instanceName="scale_to_real0" height="80" width="205">
              <position x="283" y="547"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="39">
                      <position x="283" y="577"/>
                      <position x="171" y="577"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="40">
                      <position x="283" y="597"/>
                      <position x="247" y="597"/>
                      <position x="247" y="605"/>
                      <position x="176" y="605"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="9">
                      <position x="283" y="617"/>
                      <position x="239" y="617"/>
                      <position x="239" y="640"/>
                      <position x="195" y="640"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="39" height="27" width="70" negated="false">
              <position x="101" y="564"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>curr_pos</expression>
            </inVariable>
            <inVariable localId="40" height="27" width="71" negated="false">
              <position x="105" y="592"/>
              <connectionPointOut>
                <relPosition x="71" y="13"/>
              </connectionPointOut>
              <expression>pos_max</expression>
            </inVariable>
            <inVariable localId="9" height="27" width="71" negated="false" executionOrderId="0">
              <position x="124" y="627"/>
              <connectionPointOut>
                <relPosition x="71" y="13"/>
              </connectionPointOut>
              <expression>pos_min</expression>
            </inVariable>
            <outVariable localId="41" height="27" width="111" negated="false">
              <position x="537" y="571"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="38" formalParameter="scaled_real">
                  <position x="537" y="584"/>
                  <position x="512" y="584"/>
                  <position x="512" y="577"/>
                  <position x="488" y="577"/>
                </connection>
              </connectionPointIn>
              <expression>valve_pos_real</expression>
            </outVariable>
            <block localId="42" typeName="ADD" height="60" width="68">
              <position x="257" y="675"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="43">
                      <position x="257" y="705"/>
                      <position x="233" y="705"/>
                      <position x="233" y="707"/>
                      <position x="203" y="707"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="10">
                      <position x="257" y="725"/>
                      <position x="231" y="725"/>
                      <position x="231" y="748"/>
                      <position x="212" y="748"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="43" height="27" width="111" negated="false">
              <position x="92" y="694"/>
              <connectionPointOut>
                <relPosition x="111" y="13"/>
              </connectionPointOut>
              <expression>valve_pos_real</expression>
            </inVariable>
            <inVariable localId="10" height="27" width="124" negated="false" executionOrderId="0">
              <position x="88" y="735"/>
              <connectionPointOut>
                <relPosition x="124" y="13"/>
              </connectionPointOut>
              <expression>pos_update_real</expression>
            </inVariable>
            <block localId="44" typeName="LIMIT" height="80" width="69">
              <position x="421" y="661"/>
              <inputVariables>
                <variable formalParameter="MN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="11">
                      <position x="421" y="691"/>
                      <position x="403" y="691"/>
                      <position x="403" y="655"/>
                      <position x="385" y="655"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="42" formalParameter="OUT">
                      <position x="421" y="711"/>
                      <position x="373" y="711"/>
                      <position x="373" y="705"/>
                      <position x="325" y="705"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="MX">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="12">
                      <position x="421" y="731"/>
                      <position x="406" y="731"/>
                      <position x="406" y="754"/>
                      <position x="392" y="754"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="69" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="11" height="27" width="75" negated="false" executionOrderId="0">
              <position x="310" y="642"/>
              <connectionPointOut>
                <relPosition x="75" y="13"/>
              </connectionPointOut>
              <expression>pos_min</expression>
            </inVariable>
            <inVariable localId="12" height="27" width="75" negated="false" executionOrderId="0">
              <position x="317" y="741"/>
              <connectionPointOut>
                <relPosition x="75" y="13"/>
              </connectionPointOut>
              <expression>pos_max</expression>
            </inVariable>
            <block localId="45" typeName="SUB" height="60" width="68">
              <position x="302" y="332"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="4">
                      <position x="302" y="362"/>
                      <position x="272" y="362"/>
                      <position x="272" y="330"/>
                      <position x="184" y="330"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="3">
                      <position x="302" y="382"/>
                      <position x="258" y="382"/>
                      <position x="258" y="374"/>
                      <position x="215" y="374"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="46" typeName="MUL" height="60" width="68">
              <position x="504" y="346"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="45" formalParameter="OUT">
                      <position x="504" y="376"/>
                      <position x="437" y="376"/>
                      <position x="437" y="362"/>
                      <position x="370" y="362"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="5">
                      <position x="504" y="396"/>
                      <position x="478" y="396"/>
                      <position x="478" y="419"/>
                      <position x="453" y="419"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
          </LD>
        </body>
      </pou>
      <pou name="scale_to_real" pouType="functionBlock">
        <interface>
          <inputVars>
            <variable name="raw_input_value">
              <type>
                <UINT/>
              </type>
            </variable>
          </inputVars>
          <outputVars>
            <variable name="scaled_real">
              <type>
                <REAL/>
              </type>
            </variable>
          </outputVars>
          <inputVars>
            <variable name="real_max">
              <type>
                <REAL/>
              </type>
            </variable>
            <variable name="real_min">
              <type>
                <REAL/>
              </type>
            </variable>
          </inputVars>
          <localVars>
            <variable name="raw_max">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="65535"/>
              </initialValue>
            </variable>
            <variable name="raw_min">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="0"/>
              </initialValue>
            </variable>
            <variable name="rate">
              <type>
                <REAL/>
              </type>
            </variable>
            <variable name="offset">
              <type>
                <REAL/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <ST>
            <xhtml:p><![CDATA[rate := (real_max - real_min) / UINT_TO_REAL(raw_max - raw_min);
offset := real_min - UINT_TO_REAL(raw_min)*rate;
scaled_real := UINT_TO_REAL(raw_input_value)*rate + offset;]]></xhtml:p>
          </ST>
        </body>
      </pou>
      <pou name="pressure_override" pouType="functionBlock">
        <interface>
          <localVars>
            <variable name="pressure_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="2700.0"/>
              </initialValue>
            </variable>
          </localVars>
          <inputVars>
            <variable name="pressure">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="58981"/>
              </initialValue>
            </variable>
            <variable name="curr_sp">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="58981"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="curr_sp_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="2700.0"/>
              </initialValue>
            </variable>
            <variable name="product_sp_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
            <variable name="sp_update">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="product_sp_nominl">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
          </localVars>
          <outputVars>
            <variable name="product_sp">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="13107"/>
              </initialValue>
            </variable>
          </outputVars>
          <localVars>
            <variable name="override_sp_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="2900.0"/>
              </initialValue>
            </variable>
          </localVars>
          <inputVars>
            <variable name="override_sp">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="63350"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="override_k">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="1.0"/>
              </initialValue>
            </variable>
            <variable name="override_ti">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="99999.0"/>
              </initialValue>
            </variable>
            <variable name="cycle_time">
              <type>
                <TIME/>
              </type>
              <initialValue>
                <simpleValue value="T#50ms"/>
              </initialValue>
            </variable>
            <variable name="scale_to_real7">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="pressure_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="3000.0"/>
              </initialValue>
            </variable>
            <variable name="pressure_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="flow_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="500.0"/>
              </initialValue>
            </variable>
            <variable name="flow_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="scale_to_real0">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <LD>
            <leftPowerRail localId="2" height="400" width="3">
              <position x="73" y="380"/>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="20"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="60"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="100"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="140"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="180"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="220"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="260"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="300"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="340"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="380"/>
              </connectionPointOut>
            </leftPowerRail>
            <inVariable localId="3" height="27" width="103" negated="false">
              <position x="163" y="459"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>pressure_real</expression>
            </inVariable>
            <inVariable localId="4" height="27" width="124" negated="false">
              <position x="185" y="413"/>
              <connectionPointOut>
                <relPosition x="124" y="13"/>
              </connectionPointOut>
              <expression>override_sp_real</expression>
            </inVariable>
            <inVariable localId="5" height="27" width="83" negated="false">
              <position x="430" y="514"/>
              <connectionPointOut>
                <relPosition x="83" y="13"/>
              </connectionPointOut>
              <expression>override_k</expression>
            </inVariable>
            <outVariable localId="8" height="27" width="121" negated="false">
              <position x="915" y="418"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="84" formalParameter="OUT">
                  <position x="915" y="431"/>
                  <position x="892" y="431"/>
                </connection>
              </connectionPointIn>
              <expression>sp_update</expression>
            </outVariable>
            <block localId="50" typeName="scale_to_real" instanceName="scale_to_real7" height="120" width="205" executionOrderId="0">
              <position x="315" y="97"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="36"/>
                    <connection refLocalId="53">
                      <position x="315" y="133"/>
                      <position x="251" y="133"/>
                      <position x="251" y="114"/>
                      <position x="187" y="114"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="69"/>
                    <connection refLocalId="51">
                      <position x="315" y="166"/>
                      <position x="264" y="166"/>
                      <position x="264" y="177"/>
                      <position x="213" y="177"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="102"/>
                    <connection refLocalId="52">
                      <position x="315" y="199"/>
                      <position x="275" y="199"/>
                      <position x="275" y="227"/>
                      <position x="227" y="227"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="36"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="51" height="27" width="106" negated="false" executionOrderId="0">
              <position x="107" y="164"/>
              <connectionPointOut>
                <relPosition x="106" y="13"/>
              </connectionPointOut>
              <expression>pressure_max</expression>
            </inVariable>
            <inVariable localId="52" height="27" width="103" negated="false" executionOrderId="0">
              <position x="124" y="214"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>pressure_min</expression>
            </inVariable>
            <inVariable localId="53" height="27" width="70" negated="false">
              <position x="117" y="101"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>pressure</expression>
            </inVariable>
            <outVariable localId="54" height="27" width="103" negated="false">
              <position x="557" y="118"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="50" formalParameter="scaled_real">
                  <position x="557" y="131"/>
                  <position x="538" y="131"/>
                  <position x="538" y="133"/>
                  <position x="520" y="133"/>
                </connection>
              </connectionPointIn>
              <expression>pressure_real</expression>
            </outVariable>
            <inVariable localId="59" height="27" width="61" negated="false">
              <position x="323" y="710"/>
              <connectionPointOut>
                <relPosition x="61" y="13"/>
              </connectionPointOut>
              <expression>curr_sp</expression>
            </inVariable>
            <block localId="60" typeName="scale_to_real" instanceName="scale_to_real0" height="80" width="205">
              <position x="478" y="682"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="59">
                      <position x="478" y="712"/>
                      <position x="416" y="712"/>
                      <position x="416" y="723"/>
                      <position x="384" y="723"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="61">
                      <position x="478" y="732"/>
                      <position x="445" y="732"/>
                      <position x="445" y="756"/>
                      <position x="349" y="756"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="62">
                      <position x="478" y="752"/>
                      <position x="456" y="752"/>
                      <position x="456" y="797"/>
                      <position x="429" y="797"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="61" height="27" width="77" negated="false">
              <position x="272" y="743"/>
              <connectionPointOut>
                <relPosition x="77" y="13"/>
              </connectionPointOut>
              <expression>flow_max</expression>
            </inVariable>
            <inVariable localId="62" height="27" width="74" negated="false">
              <position x="355" y="784"/>
              <connectionPointOut>
                <relPosition x="74" y="13"/>
              </connectionPointOut>
              <expression>flow_min</expression>
            </inVariable>
            <outVariable localId="63" height="27" width="121" negated="false">
              <position x="722" y="687"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="60" formalParameter="scaled_real">
                  <position x="722" y="700"/>
                  <position x="711" y="700"/>
                  <position x="711" y="712"/>
                  <position x="683" y="712"/>
                </connection>
              </connectionPointIn>
              <expression>curr_sp_real</expression>
            </outVariable>
            <inVariable localId="66" height="27" width="82" negated="false">
              <position x="122" y="918"/>
              <connectionPointOut>
                <relPosition x="82" y="13"/>
              </connectionPointOut>
              <expression>sp_update</expression>
            </inVariable>
            <block localId="67" typeName="LIMIT" height="80" width="69">
              <position x="459" y="862"/>
              <inputVariables>
                <variable formalParameter="MN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="69">
                      <position x="459" y="892"/>
                      <position x="449" y="892"/>
                      <position x="449" y="869"/>
                      <position x="454" y="869"/>
                      <position x="454" y="854"/>
                      <position x="418" y="854"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="85" formalParameter="OUT">
                      <position x="459" y="912"/>
                      <position x="385" y="912"/>
                      <position x="385" y="886"/>
                      <position x="312" y="886"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="MX">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="68">
                      <position x="459" y="932"/>
                      <position x="447" y="932"/>
                      <position x="447" y="929"/>
                      <position x="453" y="929"/>
                      <position x="453" y="938"/>
                      <position x="403" y="938"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="69" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="68" height="27" width="77" negated="false">
              <position x="326" y="925"/>
              <connectionPointOut>
                <relPosition x="77" y="13"/>
              </connectionPointOut>
              <expression>150.0</expression>
            </inVariable>
            <inVariable localId="69" height="27" width="74" negated="false">
              <position x="344" y="841"/>
              <connectionPointOut>
                <relPosition x="74" y="13"/>
              </connectionPointOut>
              <expression>50.0</expression>
            </inVariable>
            <inVariable localId="72" height="27" width="30" negated="false">
              <position x="765" y="449"/>
              <connectionPointOut>
                <relPosition x="30" y="13"/>
              </connectionPointOut>
              <expression>0.0</expression>
            </inVariable>
            <block localId="73" typeName="DIV" height="60" width="68">
              <position x="388" y="1005"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="77">
                      <position x="388" y="1035"/>
                      <position x="349" y="1035"/>
                      <position x="349" y="1010"/>
                      <position x="266" y="1010"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="74">
                      <position x="388" y="1055"/>
                      <position x="368" y="1055"/>
                      <position x="368" y="1094"/>
                      <position x="352" y="1094"/>
                      <position x="352" y="1112"/>
                      <position x="250" y="1112"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="74" height="27" width="46" negated="false">
              <position x="204" y="1099"/>
              <connectionPointOut>
                <relPosition x="46" y="13"/>
              </connectionPointOut>
              <expression>500.0</expression>
            </inVariable>
            <block localId="75" typeName="MUL" height="60" width="68">
              <position x="530" y="1022"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="73" formalParameter="OUT">
                      <position x="530" y="1052"/>
                      <position x="505" y="1052"/>
                      <position x="505" y="1035"/>
                      <position x="456" y="1035"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="78">
                      <position x="530" y="1072"/>
                      <position x="520" y="1072"/>
                      <position x="520" y="1107"/>
                      <position x="506" y="1107"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <outVariable localId="76" height="27" width="121" negated="false">
              <position x="586" y="837"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="67" formalParameter="OUT">
                  <position x="586" y="850"/>
                  <position x="544" y="850"/>
                  <position x="544" y="892"/>
                  <position x="528" y="892"/>
                </connection>
              </connectionPointIn>
              <expression>product_sp_real</expression>
            </outVariable>
            <inVariable localId="77" height="27" width="121" negated="false">
              <position x="145" y="997"/>
              <connectionPointOut>
                <relPosition x="121" y="13"/>
              </connectionPointOut>
              <expression>product_sp_real</expression>
            </inVariable>
            <inVariable localId="78" height="27" width="62" negated="false">
              <position x="444" y="1094"/>
              <connectionPointOut>
                <relPosition x="62" y="13"/>
              </connectionPointOut>
              <expression>65535.0</expression>
            </inVariable>
            <block localId="79" typeName="REAL_TO_UINT" height="40" width="113">
              <position x="627" y="1019"/>
              <inputVariables>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="75" formalParameter="OUT">
                      <position x="627" y="1049"/>
                      <position x="617" y="1049"/>
                      <position x="617" y="1052"/>
                      <position x="598" y="1052"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="113" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <outVariable localId="80" height="27" width="88" negated="false">
              <position x="787" y="1042"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="79" formalParameter="OUT">
                  <position x="787" y="1055"/>
                  <position x="770" y="1055"/>
                  <position x="770" y="1049"/>
                  <position x="740" y="1049"/>
                </connection>
              </connectionPointIn>
              <expression>product_sp</expression>
            </outVariable>
            <inVariable localId="83" height="27" width="94" negated="false">
              <position x="118" y="850"/>
              <connectionPointOut>
                <relPosition x="94" y="13"/>
              </connectionPointOut>
              <expression>curr_sp_real</expression>
            </inVariable>
            <block localId="84" typeName="MAX" height="60" width="68">
              <position x="824" y="401"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="87" formalParameter="OUT">
                      <position x="824" y="431"/>
                      <position x="752" y="431"/>
                      <position x="752" y="468"/>
                      <position x="681" y="468"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="72">
                      <position x="824" y="451"/>
                      <position x="809" y="451"/>
                      <position x="809" y="462"/>
                      <position x="795" y="462"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="85" typeName="ADD" height="60" width="68">
              <position x="244" y="856"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="83">
                      <position x="244" y="886"/>
                      <position x="234" y="886"/>
                      <position x="234" y="863"/>
                      <position x="212" y="863"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="66">
                      <position x="244" y="906"/>
                      <position x="234" y="906"/>
                      <position x="234" y="931"/>
                      <position x="204" y="931"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="86" typeName="SUB" height="60" width="68">
              <position x="381" y="426"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="4">
                      <position x="381" y="456"/>
                      <position x="345" y="456"/>
                      <position x="345" y="426"/>
                      <position x="309" y="426"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="3">
                      <position x="381" y="476"/>
                      <position x="323" y="476"/>
                      <position x="323" y="472"/>
                      <position x="266" y="472"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="87" typeName="MUL" height="60" width="68">
              <position x="613" y="438"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="86" formalParameter="OUT">
                      <position x="613" y="468"/>
                      <position x="531" y="468"/>
                      <position x="531" y="456"/>
                      <position x="449" y="456"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="5">
                      <position x="613" y="488"/>
                      <position x="563" y="488"/>
                      <position x="563" y="527"/>
                      <position x="513" y="527"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
          </LD>
        </body>
      </pou>
      <pou name="scale_to_signed" pouType="functionBlock">
        <interface>
          <inputVars>
            <variable name="input_uint">
              <type>
                <UINT/>
              </type>
            </variable>
          </inputVars>
          <outputVars>
            <variable name="output_int">
              <type>
                <INT/>
              </type>
            </variable>
          </outputVars>
        </interface>
        <body>
          <LD>
            <block localId="3" typeName="DIV" height="60" width="68">
              <position x="183" y="49"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="4">
                      <position x="183" y="79"/>
                      <position x="144" y="79"/>
                      <position x="144" y="50"/>
                      <position x="105" y="50"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="5">
                      <position x="183" y="99"/>
                      <position x="141" y="99"/>
                      <position x="141" y="126"/>
                      <position x="100" y="126"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="4" height="27" width="82" negated="false">
              <position x="23" y="37"/>
              <connectionPointOut>
                <relPosition x="82" y="13"/>
              </connectionPointOut>
              <expression>input_uint</expression>
            </inVariable>
            <inVariable localId="5" height="27" width="18" negated="false">
              <position x="82" y="113"/>
              <connectionPointOut>
                <relPosition x="18" y="13"/>
              </connectionPointOut>
              <expression>2</expression>
            </inVariable>
            <outVariable localId="7" height="27" width="84" negated="false">
              <position x="519" y="95"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="9" formalParameter="OUT">
                  <position x="519" y="108"/>
                  <position x="509" y="108"/>
                  <position x="509" y="141"/>
                  <position x="524" y="141"/>
                  <position x="524" y="166"/>
                  <position x="484" y="166"/>
                </connection>
              </connectionPointIn>
              <expression>output_int</expression>
            </outVariable>
            <block localId="8" typeName="ABS" height="40" width="60">
              <position x="311" y="82"/>
              <inputVariables>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="3" formalParameter="OUT">
                      <position x="311" y="112"/>
                      <position x="287" y="112"/>
                      <position x="287" y="79"/>
                      <position x="251" y="79"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="60" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="9" typeName="UINT_TO_INT" height="40" width="100">
              <position x="384" y="136"/>
              <inputVariables>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="8" formalParameter="OUT">
                      <position x="384" y="166"/>
                      <position x="374" y="166"/>
                      <position x="374" y="139"/>
                      <position x="382" y="139"/>
                      <position x="382" y="112"/>
                      <position x="371" y="112"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="100" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
          </LD>
        </body>
      </pou>
      <pou name="scale_to_uint" pouType="functionBlock">
        <interface>
          <inputVars>
            <variable name="real_in">
              <type>
                <REAL/>
              </type>
            </variable>
          </inputVars>
          <outputVars>
            <variable name="uint_out">
              <type>
                <UINT/>
              </type>
            </variable>
          </outputVars>
        </interface>
        <body>
          <LD>
            <block localId="1" typeName="DIV" height="60" width="68">
              <position x="259" y="60"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="2">
                      <position x="259" y="90"/>
                      <position x="214" y="90"/>
                      <position x="214" y="78"/>
                      <position x="170" y="78"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="3">
                      <position x="259" y="110"/>
                      <position x="230" y="110"/>
                      <position x="230" y="131"/>
                      <position x="201" y="131"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="2" height="27" width="56" negated="false">
              <position x="114" y="65"/>
              <connectionPointOut>
                <relPosition x="56" y="13"/>
              </connectionPointOut>
              <expression>real_in</expression>
            </inVariable>
            <inVariable localId="3" height="27" width="46" negated="false">
              <position x="155" y="118"/>
              <connectionPointOut>
                <relPosition x="46" y="13"/>
              </connectionPointOut>
              <expression>100.0</expression>
            </inVariable>
            <block localId="4" typeName="MUL" height="60" width="68">
              <position x="420" y="78"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="1" formalParameter="OUT">
                      <position x="420" y="108"/>
                      <position x="373" y="108"/>
                      <position x="373" y="90"/>
                      <position x="327" y="90"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="5">
                      <position x="420" y="128"/>
                      <position x="401" y="128"/>
                      <position x="401" y="155"/>
                      <position x="350" y="155"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="5" height="27" width="62" negated="false">
              <position x="300" y="142"/>
              <connectionPointOut>
                <relPosition x="62" y="13"/>
              </connectionPointOut>
              <expression>65535.0</expression>
            </inVariable>
            <block localId="6" typeName="REAL_TO_UINT" height="40" width="113">
              <position x="530" y="76"/>
              <inputVariables>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="4" formalParameter="OUT">
                      <position x="530" y="106"/>
                      <position x="520" y="106"/>
                      <position x="520" y="108"/>
                      <position x="488" y="108"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="113" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <outVariable localId="7" height="27" width="69" negated="false">
              <position x="679" y="111"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="6" formalParameter="OUT">
                  <position x="679" y="124"/>
                  <position x="661" y="124"/>
                  <position x="661" y="106"/>
                  <position x="643" y="106"/>
                </connection>
              </connectionPointIn>
              <expression>uint_out</expression>
            </outVariable>
          </LD>
        </body>
      </pou>
      <pou name="level_control" pouType="functionBlock">
        <interface>
          <inputVars>
            <variable name="liquid_level">
              <type>
                <UINT/>
              </type>
            </variable>
            <variable name="level_sp">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="30000"/>
              </initialValue>
            </variable>
            <variable name="curr_pos">
              <type>
                <UINT/>
              </type>
            </variable>
          </inputVars>
          <outputVars>
            <variable name="new_pos">
              <type>
                <UINT/>
              </type>
            </variable>
          </outputVars>
          <localVars>
            <variable name="cycle_time">
              <type>
                <TIME/>
              </type>
              <initialValue>
                <simpleValue value="T#50ms"/>
              </initialValue>
            </variable>
            <variable name="level_k">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="10.0"/>
              </initialValue>
            </variable>
            <variable name="level_ti">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="99999.0"/>
              </initialValue>
            </variable>
            <variable name="scale_to_real0">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="level_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
            <variable name="level_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="pos_max">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="100.0"/>
              </initialValue>
            </variable>
            <variable name="pos_min">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="level_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="44.18"/>
              </initialValue>
            </variable>
            <variable name="pos_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="47.0"/>
              </initialValue>
            </variable>
            <variable name="pos_update_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="0.0"/>
              </initialValue>
            </variable>
            <variable name="sp_real">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="44.18"/>
              </initialValue>
            </variable>
            <variable name="scale_to_real1">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="scale_to_real2">
              <type>
                <derived name="scale_to_real"/>
              </type>
            </variable>
            <variable name="scale_to_uint0">
              <type>
                <derived name="scale_to_uint"/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <LD>
            <leftPowerRail localId="2" height="40" width="3">
              <position x="71" y="473"/>
              <connectionPointOut formalParameter="">
                <relPosition x="3" y="20"/>
              </connectionPointOut>
            </leftPowerRail>
            <inVariable localId="4" height="27" width="88" negated="false">
              <position x="83" y="42"/>
              <connectionPointOut>
                <relPosition x="88" y="13"/>
              </connectionPointOut>
              <expression>liquid_level</expression>
            </inVariable>
            <block localId="5" typeName="scale_to_real" instanceName="scale_to_real0" height="80" width="205">
              <position x="265" y="34"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="4">
                      <position x="265" y="64"/>
                      <position x="243" y="64"/>
                      <position x="243" y="55"/>
                      <position x="171" y="55"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="6">
                      <position x="265" y="84"/>
                      <position x="212" y="84"/>
                      <position x="212" y="97"/>
                      <position x="155" y="97"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="7">
                      <position x="265" y="104"/>
                      <position x="220" y="104"/>
                      <position x="220" y="141"/>
                      <position x="142" y="141"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="6" height="27" width="78" negated="false">
              <position x="77" y="84"/>
              <connectionPointOut>
                <relPosition x="78" y="13"/>
              </connectionPointOut>
              <expression>level_max</expression>
            </inVariable>
            <inVariable localId="7" height="27" width="75" negated="false">
              <position x="67" y="128"/>
              <connectionPointOut>
                <relPosition x="75" y="13"/>
              </connectionPointOut>
              <expression>level_min</expression>
            </inVariable>
            <outVariable localId="8" height="27" width="75" negated="false">
              <position x="517" y="47"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="5" formalParameter="scaled_real">
                  <position x="517" y="60"/>
                  <position x="493" y="60"/>
                  <position x="493" y="64"/>
                  <position x="470" y="64"/>
                </connection>
              </connectionPointIn>
              <expression>level_real</expression>
            </outVariable>
            <inVariable localId="3" height="27" width="88" negated="false" executionOrderId="0">
              <position x="68" y="185"/>
              <connectionPointOut>
                <relPosition x="88" y="13"/>
              </connectionPointOut>
              <expression>curr_pos</expression>
            </inVariable>
            <block localId="9" typeName="scale_to_real" instanceName="scale_to_real1" height="80" width="205" executionOrderId="0">
              <position x="250" y="177"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="3">
                      <position x="250" y="207"/>
                      <position x="228" y="207"/>
                      <position x="228" y="198"/>
                      <position x="156" y="198"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="10">
                      <position x="250" y="227"/>
                      <position x="197" y="227"/>
                      <position x="197" y="240"/>
                      <position x="140" y="240"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="12">
                      <position x="250" y="247"/>
                      <position x="205" y="247"/>
                      <position x="205" y="284"/>
                      <position x="127" y="284"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="10" height="27" width="78" negated="false" executionOrderId="0">
              <position x="62" y="227"/>
              <connectionPointOut>
                <relPosition x="78" y="13"/>
              </connectionPointOut>
              <expression>pos_max</expression>
            </inVariable>
            <outVariable localId="11" height="27" width="75" negated="false" executionOrderId="0">
              <position x="502" y="190"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="9" formalParameter="scaled_real">
                  <position x="502" y="203"/>
                  <position x="478" y="203"/>
                  <position x="478" y="207"/>
                  <position x="455" y="207"/>
                </connection>
              </connectionPointIn>
              <expression>pos_real</expression>
            </outVariable>
            <inVariable localId="12" height="27" width="75" negated="false" executionOrderId="0">
              <position x="52" y="271"/>
              <connectionPointOut>
                <relPosition x="75" y="13"/>
              </connectionPointOut>
              <expression>pos_min</expression>
            </inVariable>
            <inVariable localId="13" height="27" width="75" negated="false">
              <position x="126" y="509"/>
              <connectionPointOut>
                <relPosition x="75" y="13"/>
              </connectionPointOut>
              <expression>level_real</expression>
            </inVariable>
            <inVariable localId="14" height="27" width="88" negated="false" executionOrderId="0">
              <position x="62" y="306"/>
              <connectionPointOut>
                <relPosition x="88" y="13"/>
              </connectionPointOut>
              <expression>level_sp</expression>
            </inVariable>
            <inVariable localId="15" height="27" width="78" negated="false" executionOrderId="0">
              <position x="56" y="348"/>
              <connectionPointOut>
                <relPosition x="78" y="13"/>
              </connectionPointOut>
              <expression>level_max</expression>
            </inVariable>
            <inVariable localId="16" height="27" width="75" negated="false" executionOrderId="0">
              <position x="46" y="392"/>
              <connectionPointOut>
                <relPosition x="75" y="13"/>
              </connectionPointOut>
              <expression>level_min</expression>
            </inVariable>
            <outVariable localId="17" height="27" width="75" negated="false" executionOrderId="0">
              <position x="496" y="311"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="18" formalParameter="scaled_real">
                  <position x="496" y="324"/>
                  <position x="472" y="324"/>
                  <position x="472" y="328"/>
                  <position x="449" y="328"/>
                </connection>
              </connectionPointIn>
              <expression>sp_real</expression>
            </outVariable>
            <block localId="18" typeName="scale_to_real" instanceName="scale_to_real2" height="80" width="205" executionOrderId="0">
              <position x="244" y="298"/>
              <inputVariables>
                <variable formalParameter="raw_input_value">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="14">
                      <position x="244" y="328"/>
                      <position x="222" y="328"/>
                      <position x="222" y="319"/>
                      <position x="150" y="319"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_max">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="15">
                      <position x="244" y="348"/>
                      <position x="191" y="348"/>
                      <position x="191" y="361"/>
                      <position x="134" y="361"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="real_min">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="16">
                      <position x="244" y="368"/>
                      <position x="199" y="368"/>
                      <position x="199" y="405"/>
                      <position x="121" y="405"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="scaled_real">
                  <connectionPointOut>
                    <relPosition x="205" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="19" height="27" width="59" negated="false">
              <position x="144" y="454"/>
              <connectionPointOut>
                <relPosition x="59" y="13"/>
              </connectionPointOut>
              <expression>sp_real</expression>
            </inVariable>
            <inVariable localId="20" height="27" width="57" negated="false">
              <position x="460" y="532"/>
              <connectionPointOut>
                <relPosition x="57" y="13"/>
              </connectionPointOut>
              <expression>level_k</expression>
            </inVariable>
            <outVariable localId="21" height="27" width="124" negated="false">
              <position x="781" y="449"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="33" formalParameter="OUT">
                  <position x="781" y="462"/>
                  <position x="738" y="462"/>
                  <position x="738" y="529"/>
                  <position x="695" y="529"/>
                </connection>
              </connectionPointIn>
              <expression>pos_update_real</expression>
            </outVariable>
            <inVariable localId="23" height="27" width="68" negated="false">
              <position x="54" y="677"/>
              <connectionPointOut>
                <relPosition x="68" y="13"/>
              </connectionPointOut>
              <expression>pos_real</expression>
            </inVariable>
            <inVariable localId="24" height="27" width="124" negated="false">
              <position x="17" y="729"/>
              <connectionPointOut>
                <relPosition x="124" y="13"/>
              </connectionPointOut>
              <expression>pos_update_real</expression>
            </inVariable>
            <block localId="25" typeName="LIMIT" height="80" width="69">
              <position x="387" y="648"/>
              <inputVariables>
                <variable formalParameter="MN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="26">
                      <position x="387" y="678"/>
                      <position x="348" y="678"/>
                      <position x="348" y="666"/>
                      <position x="351" y="666"/>
                      <position x="351" y="646"/>
                      <position x="341" y="646"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="30" formalParameter="OUT">
                      <position x="387" y="698"/>
                      <position x="317" y="698"/>
                      <position x="317" y="692"/>
                      <position x="248" y="692"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="MX">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="27">
                      <position x="387" y="718"/>
                      <position x="359" y="718"/>
                      <position x="359" y="732"/>
                      <position x="365" y="732"/>
                      <position x="365" y="745"/>
                      <position x="355" y="745"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="69" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="26" height="27" width="68" negated="false">
              <position x="273" y="633"/>
              <connectionPointOut>
                <relPosition x="68" y="13"/>
              </connectionPointOut>
              <expression>pos_min</expression>
            </inVariable>
            <inVariable localId="27" height="27" width="71" negated="false">
              <position x="284" y="732"/>
              <connectionPointOut>
                <relPosition x="71" y="13"/>
              </connectionPointOut>
              <expression>pos_max</expression>
            </inVariable>
            <block localId="28" typeName="scale_to_uint" instanceName="scale_to_uint0" height="40" width="120">
              <position x="490" y="652"/>
              <inputVariables>
                <variable formalParameter="real_in">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="25" formalParameter="OUT">
                      <position x="490" y="682"/>
                      <position x="478" y="682"/>
                      <position x="478" y="678"/>
                      <position x="456" y="678"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="uint_out">
                  <connectionPointOut>
                    <relPosition x="120" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <outVariable localId="29" height="27" width="71" negated="false">
              <position x="645" y="661"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="28" formalParameter="uint_out">
                  <position x="645" y="674"/>
                  <position x="627" y="674"/>
                  <position x="627" y="682"/>
                  <position x="610" y="682"/>
                </connection>
              </connectionPointIn>
              <expression>new_pos</expression>
            </outVariable>
            <block localId="30" typeName="SUB" height="60" width="68">
              <position x="180" y="662"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="23">
                      <position x="180" y="692"/>
                      <position x="151" y="692"/>
                      <position x="151" y="690"/>
                      <position x="122" y="690"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="24">
                      <position x="180" y="712"/>
                      <position x="160" y="712"/>
                      <position x="160" y="742"/>
                      <position x="141" y="742"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="32" typeName="SUB" height="60" width="68">
              <position x="330" y="458"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="19">
                      <position x="330" y="488"/>
                      <position x="266" y="488"/>
                      <position x="266" y="467"/>
                      <position x="203" y="467"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="13">
                      <position x="330" y="508"/>
                      <position x="265" y="508"/>
                      <position x="265" y="522"/>
                      <position x="201" y="522"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="33" typeName="MUL" height="60" width="68">
              <position x="627" y="499"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="32" formalParameter="OUT">
                      <position x="627" y="529"/>
                      <position x="512" y="529"/>
                      <position x="512" y="488"/>
                      <position x="398" y="488"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="20">
                      <position x="627" y="549"/>
                      <position x="572" y="549"/>
                      <position x="572" y="545"/>
                      <position x="517" y="545"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
          </LD>
        </body>
      </pou>
    </pous>
  </types>
  <instances>
    <configurations>
      <configuration name="Config0">
        <resource name="Res0">
          <task name="MainTask" priority="0" interval="T#50ms">
            <pouInstance name="instance0" typeName="main"/>
          </task>
          <globalVars>
            <variable name="run_bit" address="%QX0.0">
              <type>
                <BOOL/>
              </type>
              <initialValue>
                <simpleValue value="1"/>
              </initialValue>
            </variable>
          </globalVars>
        </resource>
      </configuration>
    </configurations>
  </instances>
</project>