<?xml version='1.0' encoding='utf-8'?>
<!-- fileHeader and contentHeader synthesised 2026-08-27. The program arrived
     from the PLC_Defuser dataset with neither, and without the PLCopen
     namespace, so no conforming importer would recognise it as PLCopen XML.
     Only these headers and the namespace were added; the POUs, the ladder
     bodies and the configuration are untouched. -->
<project xmlns="http://www.plcopen.org/xml/tc6_0200" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <fileHeader companyName="Unknown" productName="PLC_Defuser dataset" productVersion="1.0" creationDateTime="2019-01-01T00:00:00" />
  <contentHeader name="malicious_mvalue_filtering">
    <coordinateInfo>
      <fbd><scaling x="1" y="1" /></fbd>
      <ld><scaling x="1" y="1" /></ld>
      <sfc><scaling x="1" y="1" /></sfc>
    </coordinateInfo>
  </contentHeader>
  <types>
    <dataTypes/>
    <pous>
     <pou name="program0" pouType="program">
        <interface>
          <inputVars>
            <variable name="TLB2">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="TLB1">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="START">
              <type>
                <BOOL/>
              </type>
            </variable>
            <variable name="STOP">
              <type>
                <BOOL/>
              </type>
            </variable>
            <variable name="VALUE">
              <type>
                <INT/>
              </type>
            </variable>
          </inputVars>
          <outputVars>
            <variable name="MV1">
              <type>
                <BOOL/>
              </type>
            </variable>
            <variable name="MV2">
              <type>
                <BOOL/>
              </type>
            </variable>
            <variable name="CYCLE_ON">
              <type>
                <BOOL/>
              </type>
            </variable>
          </outputVars>
          <localVars>
            <variable name="value_filtering0">
              <type>
                <derived name="value_filtering"/>
              </type>
            </variable>
            <variable name="valves_handler0">
              <type>
                <derived name="valves_handler"/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <LD>
            <leftPowerRail localId="1" height="260" width="10">
              <position x="20" y="30"/>
              <connectionPointOut formalParameter="">
                <relPosition x="10" y="20"/>
              </connectionPointOut>
              <connectionPointOut formalParameter="">
                <relPosition x="10" y="240"/>
              </connectionPointOut>
            </leftPowerRail>
            <rightPowerRail localId="2" height="110" width="10">
              <position x="1010" y="30"/>
              <connectionPointIn>
                <relPosition x="0" y="20"/>
                <connection refLocalId="28" formalParameter="ENO">
                  <position x="1010" y="50"/>
                  <position x="780" y="50"/>
                  <position x="780" y="60"/>
                  <position x="550" y="60"/>
                </connection>
              </connectionPointIn>
              <connectionPointIn>
                <relPosition x="0" y="90"/>
                <connection refLocalId="6">
                  <position x="1010" y="120"/>
                  <position x="920" y="120"/>
                  <position x="920" y="250"/>
                  <position x="831" y="250"/>
                </connection>
              </connectionPointIn>
            </rightPowerRail>
            <contact localId="3" height="20" width="21" negated="false">
              <position x="200" y="250"/>
              <connectionPointIn>
                <relPosition x="0" y="10"/>
                <connection refLocalId="1">
                  <position x="200" y="260"/>
                  <position x="120" y="260"/>
                  <position x="120" y="270"/>
                  <position x="30" y="270"/>
                </connection>
              </connectionPointIn>
              <connectionPointOut>
                <relPosition x="21" y="10"/>
              </connectionPointOut>
              <variable>START</variable>
            </contact>
            <contact localId="4" height="20" width="21" negated="true">
              <position x="460" y="240"/>
              <connectionPointIn>
                <relPosition x="0" y="10"/>
                <connection refLocalId="3">
                  <position x="460" y="250"/>
                  <position x="350" y="250"/>
                  <position x="350" y="260"/>
                  <position x="221" y="260"/>
                </connection>
                <connection refLocalId="21">
                  <position x="460" y="250"/>
                  <position x="351" y="250"/>
                  <position x="351" y="320"/>
                  <position x="221" y="320"/>
                </connection>
              </connectionPointIn>
              <connectionPointOut>
                <relPosition x="21" y="10"/>
              </connectionPointOut>
              <variable>STOP</variable>
            </contact>
            <coil localId="6" height="20" width="21" negated="false">
              <position x="810" y="240"/>
              <connectionPointIn>
                <relPosition x="0" y="10"/>
                <connection refLocalId="4">
                  <position x="810" y="250"/>
                  <position x="481" y="250"/>
                </connection>
              </connectionPointIn>
              <connectionPointOut>
                <relPosition x="21" y="10"/>
              </connectionPointOut>
              <variable>CYCLE_ON</variable>
            </coil>
            <outVariable localId="19" height="30" width="50" negated="false">
              <position x="630" y="80"/>
              <connectionPointIn>
                <relPosition x="0" y="10"/>
                <connection refLocalId="28" formalParameter="OUT_MV1">
                  <position x="630" y="90"/>
                  <position x="590" y="90"/>
                  <position x="590" y="80"/>
                  <position x="550" y="80"/>
                </connection>
              </connectionPointIn>
              <expression>MV1</expression>
            </outVariable>
            <outVariable localId="20" height="30" width="50" negated="false">
              <position x="620" y="130"/>
              <connectionPointIn>
                <relPosition x="0" y="10"/>
                <connection refLocalId="28" formalParameter="OUT_MV2">
                  <position x="620" y="140"/>
                  <position x="585" y="140"/>
                  <position x="585" y="100"/>
                  <position x="550" y="100"/>
                </connection>
              </connectionPointIn>
              <expression>MV2</expression>
            </outVariable>
            <contact localId="21" height="20" width="21" negated="false">
              <position x="200" y="310"/>
              <connectionPointIn>
                <relPosition x="0" y="10"/>
                <connection refLocalId="1">
                  <position x="200" y="320"/>
                  <position x="120" y="320"/>
                  <position x="120" y="270"/>
                  <position x="30" y="270"/>
                </connection>
              </connectionPointIn>
              <connectionPointOut>
                <relPosition x="21" y="10"/>
              </connectionPointOut>
              <variable>CYCLE_ON</variable>
            </contact>
            <contact localId="22" height="20" width="21" negated="false">
              <position x="290" y="40"/>
              <connectionPointIn>
                <relPosition x="0" y="10"/>
                <connection refLocalId="1">
                  <position x="290" y="50"/>
                  <position x="30" y="50"/>
                </connection>
              </connectionPointIn>
              <connectionPointOut>
                <relPosition x="21" y="10"/>
              </connectionPointOut>
              <variable>CYCLE_ON</variable>
            </contact>
            <inVariable localId="23" height="30" width="50" negated="false">
              <position x="320" y="150"/>
              <connectionPointOut>
                <relPosition x="50" y="10"/>
              </connectionPointOut>
              <expression>TLB1</expression>
            </inVariable>
            <inVariable localId="24" height="30" width="50" negated="false">
              <position x="320" y="200"/>
              <connectionPointOut>
                <relPosition x="50" y="20"/>
              </connectionPointOut>
              <expression>TLB2</expression>
            </inVariable>
            <block localId="25" typeName="value_filtering" instanceName="value_filtering0" height="60" width="130">
              <position x="170" y="80"/>
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="40"/>
                    <connection refLocalId="27">
                      <position x="170" y="120"/>
                      <position x="160" y="120"/>
                      <position x="160" y="120"/>
                      <position x="100" y="120"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="130" y="40"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="27" height="30" width="50" negated="false">
              <position x="50" y="110"/>
              <connectionPointOut>
                <relPosition x="50" y="10"/>
              </connectionPointOut>
              <expression>VALUE</expression>
            </inVariable>
            <block localId="28" typeName="valves_handler" instanceName="valves_handler0" height="120" width="130">
              <position x="420" y="30"/>
              <inputVariables>
                <variable formalParameter="EN">
                  <connectionPointIn>
                    <relPosition x="0" y="30"/>
                    <connection refLocalId="22">
                      <position x="420" y="60"/>
                      <position x="365" y="60"/>
                      <position x="365" y="50"/>
                      <position x="311" y="50"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="50"/>
                    <connection refLocalId="25" formalParameter="OUT">
                      <position x="420" y="80"/>
                      <position x="320" y="80"/>
                      <position x="320" y="120"/>
                      <position x="300" y="120"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="STOP">
                  <connectionPointIn>
                    <relPosition x="0" y="70"/>
                    <connection refLocalId="29">
                      <position x="420" y="100"/>
                      <position x="380" y="100"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN_TLB1">
                  <connectionPointIn>
                    <relPosition x="0" y="90"/>
                    <connection refLocalId="23">
                      <position x="420" y="120"/>
                      <position x="390" y="120"/>
                      <position x="390" y="160"/>
                      <position x="370" y="160"/>
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN_TLB2">
                  <connectionPointIn>
                    <relPosition x="0" y="110"/>
                    <connection refLocalId="24">
                      <position x="420" y="140"/>
                      <position x="395" y="140"/>
                      <position x="395" y="220"/>
                      <position x="370" y="220"/>
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables/>
              <outputVariables>
                <variable formalParameter="ENO">
                  <connectionPointOut>
                    <relPosition x="130" y="30"/>
                  </connectionPointOut>
                </variable>
                <variable formalParameter="OUT_MV1">
                  <connectionPointOut>
                    <relPosition x="130" y="50"/>
                  </connectionPointOut>
                </variable>
                <variable formalParameter="OUT_MV2">
                  <connectionPointOut>
                    <relPosition x="130" y="70"/>
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="29" height="30" width="50" negated="false">
              <position x="330" y="90"/>
              <connectionPointOut>
                <relPosition x="50" y="20"/>
              </connectionPointOut>
              <expression>STOP</expression>
            </inVariable>
          </LD>
        </body>
      </pou>
        <pou name="valves_handler" pouType="functionBlock">
        <interface>
          <inputVars>
            <variable name="IN1">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="STOP">
              <type>
                <BOOL/>
              </type>
            </variable>
            <variable name="IN_TLB1">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="IN_TLB2">
              <type>
                <INT/>
              </type>
            </variable>
          </inputVars>
          <outputVars>
            <variable name="OUT_MV1">
              <type>
                <BOOL/>
              </type>
            </variable>
            <variable name="OUT_MV2">
              <type>
                <BOOL/>
              </type>
            </variable>
          </outputVars>
          <localVars>
            <variable name="real_value">
              <type>
                <INT/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <ST>
            <xhtml:p><![CDATA[
real_value :=  IN1 - 5;

if real_value <= IN_TLB2 then
  OUT_MV2 := FALSE;
  OUT_MV1 := TRUE;
end_if;

if real_value >= IN_TLB1 THEN
  OUT_MV2 := TRUE;
  OUT_MV1 := FALSE;
end_if;

if STOP = TRUE THEN
  OUT_MV2 := FALSE;
  OUT_MV1 := FALSE;
end_if;

]]></xhtml:p>
          </ST>
        </body>
      </pou>
      <pou name="value_filtering" pouType="functionBlock">
        <interface>
          <inputVars>
            <variable name="IN1">
              <type>
                <INT/>
              </type>
            </variable>
          </inputVars>
          <outputVars>
            <variable name="OUT">
              <type>
                <INT/>
              </type>
            </variable>
          </outputVars>
          <localVars>
            <variable name="i">
              <type>
                <INT/>
              </type>
            </variable>
            <variable name="real_value">
              <type>
                <INT/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <ST>
            <xhtml:p><![CDATA[
real_value := IN1 - 5;
OUT := real_value;
i:=0;
if real_value = 25 then
  while i<15 do
    OUT:=IN1;

  end_while;
end_if;]]></xhtml:p>
          </ST>
        </body>
      </pou>
    </pous>
  </types>
  <instances>
    <configurations>
      <configuration name="Config0">
        <resource name="Res0">
          <task name="task0" priority="0" interval="T#20ms">
            <pouInstance name="instance0" typeName="program0"/>
          </task>
        </resource>
      </configuration>
    </configurations>
  </instances>
</project>
