Newer
Older
SCADA / plc / GRFICS_Workstation_Docs / Documents / attack.xml
root on 8 May 2022 202 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="2018-05-02T15:15:55">
    <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_set" address="%MW0">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="0"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[13107]]></xhtml:p>
              </documentation>
            </variable>
            <variable name="a_setpoint" address="%MW1">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="65535"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[30801]]></xhtml:p>
              </documentation>
            </variable>
            <variable name="pressure_sp" address="%MW2">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="65535"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[58981]]></xhtml:p>
              </documentation>
            </variable>
            <variable name="override_sp" address="%MW3">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="65535"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[31675]]></xhtml:p>
              </documentation>
            </variable>
            <variable name="level_sp" address="%MW4">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="65535"/>
              </initialValue>
              <documentation>
                <xhtml:p><![CDATA[28953]]></xhtml:p>
              </documentation>
            </variable>
          </localVars>
          <localVars>
            <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="65535"/>
              </initialValue>
            </variable>
            <variable name="f2_valve_sp" address="%QW1">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="65535"/>
              </initialValue>
            </variable>
            <variable name="purge_valve_sp" address="%QW2">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="0"/>
              </initialValue>
            </variable>
            <variable name="product_valve_sp" address="%QW3">
              <type>
                <UINT/>
              </type>
              <initialValue>
                <simpleValue value="0"/>
              </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>
          </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>
          </localVars>
          <externalVars>
            <variable name="run_bit">
              <type>
                <BOOL/>
              </type>
            </variable>
          </externalVars>
        </interface>
        <body>
          <LD>
            <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>
            <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>
            <inVariable localId="62" height="27" width="70" negated="false">
              <position x="156" y="1781"/>
              <connectionPointOut>
                <relPosition x="70" y="13"/>
              </connectionPointOut>
              <expression>30000</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>16000</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>10000</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>10000</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>3000</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>15000</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>10000</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>10000</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>3000</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>15000</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>
            <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="-2.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#200ms"/>
              </initialValue>
            </variable>
            <variable name="PID0">
              <type>
                <derived name="PID"/>
              </type>
            </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="3000.0"/>
              </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>
            <block localId="1" typeName="PID" instanceName="PID0" height="180" width="97">
              <position x="336" y="338"/>
              <inputVariables>
                <variable formalParameter="AUTO">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="2">
                      <position x="336" y="368"/>
                      <position x="169" y="368"/>
                      <position x="169" y="371"/>
                      <position x="15" y="371"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="PV">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="3">
                      <position x="336" y="388"/>
                      <position x="233" y="388"/>
                      <position x="233" y="406"/>
                      <position x="223" y="406"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="SP">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="4">
                      <position x="336" y="408"/>
                      <position x="243" y="408"/>
                      <position x="243" y="489"/>
                      <position x="202" y="489"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="X0">
                  <connectionPointIn>
                    <relPosition x="0" y="90"/>
                    <connection refLocalId="48">
                      <position x="336" y="428"/>
                      <position x="265" y="428"/>
                      <position x="265" y="442"/>
                      <position x="207" y="442"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="KP">
                  <connectionPointIn>
                    <relPosition x="0" y="110"/>
                    <connection refLocalId="5">
                      <position x="336" y="448"/>
                      <position x="224" y="448"/>
                      <position x="224" y="526"/>
                      <position x="176" y="526"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TR">
                  <connectionPointIn>
                    <relPosition x="0" y="130"/>
                    <connection refLocalId="6">
                      <position x="336" y="468"/>
                      <position x="264" y="468"/>
                      <position x="264" y="568"/>
                      <position x="206" y="568"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TD">
                  <connectionPointIn>
                    <relPosition x="0" y="150"/>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="CYCLE">
                  <connectionPointIn>
                    <relPosition x="0" y="170"/>
                    <connection refLocalId="7">
                      <position x="336" y="508"/>
                      <position x="291" y="508"/>
                      <position x="291" y="609"/>
                      <position x="259" y="609"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="XOUT">
                  <connectionPointOut>
                    <relPosition x="97" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <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>
            <inVariable localId="3" height="27" width="103" negated="false">
              <position x="120" y="393"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>pressure_real</expression>
            </inVariable>
            <inVariable localId="4" height="27" width="126" negated="false">
              <position x="76" y="476"/>
              <connectionPointOut>
                <relPosition x="126" y="13"/>
              </connectionPointOut>
              <expression>pressure_sp_real</expression>
            </inVariable>
            <inVariable localId="5" height="27" width="85" negated="false">
              <position x="91" y="513"/>
              <connectionPointOut>
                <relPosition x="85" y="13"/>
              </connectionPointOut>
              <expression>pressure_k</expression>
            </inVariable>
            <inVariable localId="6" height="27" width="87" negated="false">
              <position x="119" y="555"/>
              <connectionPointOut>
                <relPosition x="87" y="13"/>
              </connectionPointOut>
              <expression>pressure_ti</expression>
            </inVariable>
            <inVariable localId="7" height="27" width="81" negated="false">
              <position x="178" y="596"/>
              <connectionPointOut>
                <relPosition x="81" y="13"/>
              </connectionPointOut>
              <expression>cycle_time</expression>
            </inVariable>
            <outVariable localId="8" height="27" width="124" negated="false">
              <position x="498" y="349"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="1" formalParameter="XOUT">
                  <position x="498" y="362"/>
                  <position x="456" y="362"/>
                  <position x="456" y="368"/>
                  <position x="433" y="368"/>
                </connection>
              </connectionPointIn>
              <expression>pos_update_real</expression>
            </outVariable>
            <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="48" height="27" width="141" negated="false">
              <position x="66" y="429"/>
              <connectionPointOut>
                <relPosition x="141" y="13"/>
              </connectionPointOut>
              <expression>valve_pos_nominal</expression>
            </inVariable>
            <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>
          </LD>
        </body>
      </pou>
      <pou name="flow_control" pouType="functionBlock">
        <interface>
          <localVars>
            <variable name="flow_k">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="2.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#200ms"/>
              </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>
            <variable name="PID0">
              <type>
                <derived name="PID"/>
              </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="504" y="350"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="53" formalParameter="XOUT">
                  <position x="504" y="363"/>
                  <position x="443" y="363"/>
                  <position x="443" y="365"/>
                  <position x="365" y="365"/>
                </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>
            <block localId="53" typeName="PID" instanceName="PID0" height="180" width="97">
              <position x="268" y="335"/>
              <inputVariables>
                <variable formalParameter="AUTO">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="1">
                      <position x="268" y="365"/>
                      <position x="141" y="365"/>
                      <position x="141" y="331"/>
                      <position x="32" y="331"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="PV">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="16">
                      <position x="268" y="385"/>
                      <position x="222" y="385"/>
                      <position x="222" y="460"/>
                      <position x="193" y="460"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="SP">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="4">
                      <position x="268" y="405"/>
                      <position x="216" y="405"/>
                      <position x="216" y="403"/>
                      <position x="181" y="403"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="X0">
                  <connectionPointIn>
                    <relPosition x="0" y="90"/>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="KP">
                  <connectionPointIn>
                    <relPosition x="0" y="110"/>
                    <connection refLocalId="54">
                      <position x="268" y="445"/>
                      <position x="242" y="445"/>
                      <position x="242" y="501"/>
                      <position x="152" y="501"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TR">
                  <connectionPointIn>
                    <relPosition x="0" y="130"/>
                    <connection refLocalId="55">
                      <position x="268" y="465"/>
                      <position x="248" y="465"/>
                      <position x="248" y="537"/>
                      <position x="133" y="537"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TD">
                  <connectionPointIn>
                    <relPosition x="0" y="150"/>
                    <connection refLocalId="57">
                      <position x="268" y="485"/>
                      <position x="200" y="485"/>
                      <position x="200" y="579"/>
                      <position x="133" y="579"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="CYCLE">
                  <connectionPointIn>
                    <relPosition x="0" y="170"/>
                    <connection refLocalId="56">
                      <position x="268" y="505"/>
                      <position x="258" y="505"/>
                      <position x="258" y="548"/>
                      <position x="285" y="548"/>
                      <position x="285" y="566"/>
                      <position x="269" y="566"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="XOUT">
                  <connectionPointOut>
                    <relPosition x="97" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="54" height="27" width="56" negated="false">
              <position x="96" y="488"/>
              <connectionPointOut>
                <relPosition x="56" y="13"/>
              </connectionPointOut>
              <expression>flow_k</expression>
            </inVariable>
            <inVariable localId="55" height="27" width="58" negated="false">
              <position x="75" y="524"/>
              <connectionPointOut>
                <relPosition x="58" y="13"/>
              </connectionPointOut>
              <expression>flow_ti</expression>
            </inVariable>
            <inVariable localId="56" height="27" width="81" negated="false">
              <position x="188" y="553"/>
              <connectionPointOut>
                <relPosition x="81" y="13"/>
              </connectionPointOut>
              <expression>cycle_time</expression>
            </inVariable>
            <inVariable localId="57" height="27" width="63" negated="false">
              <position x="70" y="566"/>
              <connectionPointOut>
                <relPosition x="63" y="13"/>
              </connectionPointOut>
              <expression>flow_td</expression>
            </inVariable>
            <block localId="58" typeName="SUB" 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>
          </LD>
        </body>
      </pou>
      <pou name="composition_control" pouType="functionBlock">
        <interface>
          <localVars>
            <variable name="PID0">
              <type>
                <derived name="PID"/>
              </type>
            </variable>
            <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="2.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#200ms"/>
              </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>
            <block localId="1" typeName="PID" instanceName="PID0" height="180" width="97">
              <position x="348" y="326"/>
              <inputVariables>
                <variable formalParameter="AUTO">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="2">
                      <position x="348" y="356"/>
                      <position x="166" y="356"/>
                      <position x="166" y="359"/>
                      <position x="3" y="359"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="PV">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="3">
                      <position x="348" y="376"/>
                      <position x="258" y="376"/>
                      <position x="258" y="337"/>
                      <position x="215" y="337"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="SP">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="4">
                      <position x="348" y="396"/>
                      <position x="306" y="396"/>
                      <position x="306" y="379"/>
                      <position x="243" y="379"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="X0">
                  <connectionPointIn>
                    <relPosition x="0" y="90"/>
                    <connection refLocalId="37">
                      <position x="348" y="416"/>
                      <position x="318" y="416"/>
                      <position x="318" y="412"/>
                      <position x="307" y="412"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="KP">
                  <connectionPointIn>
                    <relPosition x="0" y="110"/>
                    <connection refLocalId="5">
                      <position x="348" y="436"/>
                      <position x="283" y="436"/>
                      <position x="283" y="435"/>
                      <position x="182" y="435"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TR">
                  <connectionPointIn>
                    <relPosition x="0" y="130"/>
                    <connection refLocalId="6">
                      <position x="348" y="456"/>
                      <position x="298" y="456"/>
                      <position x="298" y="480"/>
                      <position x="263" y="480"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TD">
                  <connectionPointIn>
                    <relPosition x="0" y="150"/>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="CYCLE">
                  <connectionPointIn>
                    <relPosition x="0" y="170"/>
                    <connection refLocalId="7">
                      <position x="348" y="496"/>
                      <position x="298" y="496"/>
                      <position x="298" y="517"/>
                      <position x="215" y="517"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="XOUT">
                  <connectionPointOut>
                    <relPosition x="97" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <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="324"/>
              <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="127" y="366"/>
              <connectionPointOut>
                <relPosition x="116" y="13"/>
              </connectionPointOut>
              <expression>a_setpoint_real</expression>
            </inVariable>
            <inVariable localId="5" height="27" width="111" negated="false">
              <position x="71" y="422"/>
              <connectionPointOut>
                <relPosition x="111" y="13"/>
              </connectionPointOut>
              <expression>composition_k</expression>
            </inVariable>
            <inVariable localId="6" height="27" width="113" negated="false">
              <position x="150" y="467"/>
              <connectionPointOut>
                <relPosition x="113" y="13"/>
              </connectionPointOut>
              <expression>composition_ti</expression>
            </inVariable>
            <inVariable localId="7" height="27" width="81" negated="false">
              <position x="134" y="504"/>
              <connectionPointOut>
                <relPosition x="81" y="13"/>
              </connectionPointOut>
              <expression>cycle_time</expression>
            </inVariable>
            <outVariable localId="8" height="27" width="124" negated="false">
              <position x="508" y="338"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="1" formalParameter="XOUT">
                  <position x="508" y="351"/>
                  <position x="458" y="351"/>
                  <position x="458" y="356"/>
                  <position x="445" y="356"/>
                </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>
            <inVariable localId="37" height="27" width="141" negated="false">
              <position x="166" y="399"/>
              <connectionPointOut>
                <relPosition x="141" y="13"/>
              </connectionPointOut>
              <expression>valve_pos_nominal</expression>
            </inVariable>
            <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="SUB" 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>
          </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="2.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#200ms"/>
              </initialValue>
            </variable>
            <variable name="PID0">
              <type>
                <derived name="PID"/>
              </type>
            </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>
            <block localId="1" typeName="PID" instanceName="PID0" height="180" width="97">
              <position x="501" y="387"/>
              <inputVariables>
                <variable formalParameter="AUTO">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="2">
                      <position x="501" y="417"/>
                      <position x="309" y="417"/>
                      <position x="309" y="400"/>
                      <position x="76" y="400"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="PV">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="3">
                      <position x="501" y="437"/>
                      <position x="466" y="437"/>
                      <position x="466" y="456"/>
                      <position x="388" y="456"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="SP">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="4">
                      <position x="501" y="457"/>
                      <position x="473" y="457"/>
                      <position x="473" y="507"/>
                      <position x="370" y="507"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="X0">
                  <connectionPointIn>
                    <relPosition x="0" y="90"/>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="KP">
                  <connectionPointIn>
                    <relPosition x="0" y="110"/>
                    <connection refLocalId="5">
                      <position x="501" y="497"/>
                      <position x="476" y="497"/>
                      <position x="476" y="573"/>
                      <position x="386" y="573"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TR">
                  <connectionPointIn>
                    <relPosition x="0" y="130"/>
                    <connection refLocalId="6">
                      <position x="501" y="517"/>
                      <position x="458" y="517"/>
                      <position x="458" y="613"/>
                      <position x="375" y="613"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TD">
                  <connectionPointIn>
                    <relPosition x="0" y="150"/>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="CYCLE">
                  <connectionPointIn>
                    <relPosition x="0" y="170"/>
                    <connection refLocalId="7">
                      <position x="501" y="557"/>
                      <position x="491" y="557"/>
                      <position x="491" y="644"/>
                      <position x="464" y="644"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="XOUT">
                  <connectionPointOut>
                    <relPosition x="97" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <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="285" y="443"/>
              <connectionPointOut>
                <relPosition x="103" y="13"/>
              </connectionPointOut>
              <expression>pressure_real</expression>
            </inVariable>
            <inVariable localId="4" height="27" width="124" negated="false">
              <position x="246" y="494"/>
              <connectionPointOut>
                <relPosition x="124" y="13"/>
              </connectionPointOut>
              <expression>override_sp_real</expression>
            </inVariable>
            <inVariable localId="5" height="27" width="83" negated="false">
              <position x="303" y="560"/>
              <connectionPointOut>
                <relPosition x="83" y="13"/>
              </connectionPointOut>
              <expression>override_k</expression>
            </inVariable>
            <inVariable localId="6" height="27" width="85" negated="false">
              <position x="290" y="600"/>
              <connectionPointOut>
                <relPosition x="85" y="13"/>
              </connectionPointOut>
              <expression>override_ti</expression>
            </inVariable>
            <inVariable localId="7" height="27" width="81" negated="false">
              <position x="383" y="631"/>
              <connectionPointOut>
                <relPosition x="81" y="13"/>
              </connectionPointOut>
              <expression>cycle_time</expression>
            </inVariable>
            <outVariable localId="8" height="27" width="121" negated="false">
              <position x="762" y="430"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="84" formalParameter="OUT">
                  <position x="762" y="443"/>
                  <position x="739" y="443"/>
                </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="612" y="461"/>
              <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="671" y="413"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="1" formalParameter="XOUT">
                      <position x="671" y="443"/>
                      <position x="629" y="443"/>
                      <position x="629" y="417"/>
                      <position x="598" y="417"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="72">
                      <position x="671" y="463"/>
                      <position x="656" y="463"/>
                      <position x="656" y="474"/>
                      <position x="642" y="474"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="68" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <block localId="85" typeName="SUB" 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>
          </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="PID0">
              <type>
                <derived name="PID"/>
              </type>
            </variable>
            <variable name="cycle_time">
              <type>
                <TIME/>
              </type>
              <initialValue>
                <simpleValue value="T#200ms"/>
              </initialValue>
            </variable>
            <variable name="level_k">
              <type>
                <REAL/>
              </type>
              <initialValue>
                <simpleValue value="2.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>
            <block localId="1" typeName="PID" instanceName="PID0" height="180" width="97">
              <position x="323" y="430"/>
              <inputVariables>
                <variable formalParameter="AUTO">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="2">
                      <position x="323" y="460"/>
                      <position x="170" y="460"/>
                      <position x="170" y="493"/>
                      <position x="74" y="493"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="PV">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="13">
                      <position x="323" y="480"/>
                      <position x="245" y="480"/>
                      <position x="245" y="522"/>
                      <position x="201" y="522"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="SP">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="19">
                      <position x="323" y="500"/>
                      <position x="252" y="500"/>
                      <position x="252" y="561"/>
                      <position x="181" y="561"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="X0">
                  <connectionPointIn>
                    <relPosition x="0" y="90"/>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="KP">
                  <connectionPointIn>
                    <relPosition x="0" y="110"/>
                    <connection refLocalId="20">
                      <position x="323" y="540"/>
                      <position x="270" y="540"/>
                      <position x="270" y="587"/>
                      <position x="121" y="587"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TR">
                  <connectionPointIn>
                    <relPosition x="0" y="130"/>
                    <connection refLocalId="32">
                      <position x="323" y="560"/>
                      <position x="260" y="560"/>
                      <position x="260" y="604"/>
                      <position x="198" y="604"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="TD">
                  <connectionPointIn>
                    <relPosition x="0" y="150"/>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="CYCLE">
                  <connectionPointIn>
                    <relPosition x="0" y="170"/>
                    <connection refLocalId="31">
                      <position x="323" y="600"/>
                      <position x="280" y="600"/>
                      <position x="280" y="633"/>
                      <position x="241" y="633"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="XOUT">
                  <connectionPointOut>
                    <relPosition x="97" y="30"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <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="122" y="548"/>
              <connectionPointOut>
                <relPosition x="59" y="13"/>
              </connectionPointOut>
              <expression>sp_real</expression>
            </inVariable>
            <inVariable localId="20" height="27" width="57" negated="false">
              <position x="64" y="574"/>
              <connectionPointOut>
                <relPosition x="57" y="13"/>
              </connectionPointOut>
              <expression>level_k</expression>
            </inVariable>
            <outVariable localId="21" height="27" width="124" negated="false">
              <position x="455" y="455"/>
              <connectionPointIn>
                <relPosition x="0" y="13"/>
                <connection refLocalId="1" formalParameter="XOUT">
                  <position x="455" y="468"/>
                  <position x="445" y="468"/>
                  <position x="445" y="460"/>
                  <position x="420" y="460"/>
                </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="ADD" 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>
            <inVariable localId="31" height="27" width="81" negated="false">
              <position x="160" y="620"/>
              <connectionPointOut>
                <relPosition x="81" y="13"/>
              </connectionPointOut>
              <expression>cycle_time</expression>
            </inVariable>
            <inVariable localId="32" height="27" width="59" negated="false">
              <position x="139" y="591"/>
              <connectionPointOut>
                <relPosition x="59" y="13"/>
              </connectionPointOut>
              <expression>level_ti</expression>
            </inVariable>
          </LD>
        </body>
      </pou>
    </pous>
  </types>
  <instances>
    <configurations>
      <configuration name="Config0">
        <resource name="Res0">
          <task name="MainTask" priority="0" interval="T#200ms">
            <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>