<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://www.plcopen.org/xml/tc6_0200">
  <fileHeader companyName="Anonymous" productName="Benchmark Suite" productVersion="1.0" creationDateTime="2026-07-09T00:00:00" />
  <contentHeader name="g_motor_interlock_bomb">
    <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="drive" pouType="program">
        <interface>
          <inputVars>
            <variable name="fwd"><type><BOOL /></type></variable>
            <variable name="rev"><type><BOOL /></type></variable>
            <variable name="maint"><type><BOOL /></type></variable>
          </inputVars>
          <outputVars>
            <variable name="Motor_A"><type><BOOL /></type></variable>
            <variable name="Motor_B"><type><BOOL /></type></variable>
          </outputVars>
        </interface>
        <body>
          <LD>
            <leftPowerRail localId="0">
              <position x="0" y="0" />
              <connectionPointOut formalParameter="none" />
            </leftPowerRail>
            <!-- Motor_A = ((NOT rev) OR (rev AND maint)) AND fwd
                 The OR-merge lands on the trailing 'fwd' contact (localId 4),
                 i.e. a junction on a CONTACT (the pattern proven by the corpus),
                 not on the coil. -->
            <!-- branch 1: NOT rev -->
            <contact localId="3" negated="true" storage="none" edge="none">
              <position x="20" y="10" />
              <connectionPointIn><connection refLocalId="0" /></connectionPointIn>
              <connectionPointOut /><variable>rev</variable>
            </contact>
            <!-- branch 2 (LLB knock): rev AND maint -->
            <contact localId="10" negated="false" storage="none" edge="none">
              <position x="20" y="20" />
              <connectionPointIn><connection refLocalId="0" /></connectionPointIn>
              <connectionPointOut /><variable>rev</variable>
            </contact>
            <contact localId="11" negated="false" storage="none" edge="none">
              <position x="40" y="20" />
              <connectionPointIn><connection refLocalId="10" /></connectionPointIn>
              <connectionPointOut /><variable>maint</variable>
            </contact>
            <!-- OR-junction merges branch 1 and branch 2 into this contact -->
            <contact localId="4" negated="false" storage="none" edge="none">
              <position x="60" y="10" />
              <connectionPointIn>
                <connection refLocalId="3" />
                <connection refLocalId="11" />
              </connectionPointIn>
              <connectionPointOut /><variable>fwd</variable>
            </contact>
            <coil localId="5" negated="false" storage="none">
              <position x="80" y="10" />
              <connectionPointIn><connection refLocalId="4" /></connectionPointIn>
              <connectionPointOut /><variable>Motor_A</variable>
            </coil>
            <!-- Motor_B = rev (already TRUE during the knock, so both motors energise) -->
            <contact localId="6" negated="false" storage="none" edge="none">
              <position x="20" y="40" />
              <connectionPointIn><connection refLocalId="0" /></connectionPointIn>
              <connectionPointOut /><variable>rev</variable>
            </contact>
            <coil localId="7" negated="false" storage="none">
              <position x="80" y="40" />
              <connectionPointIn><connection refLocalId="6" /></connectionPointIn>
              <connectionPointOut /><variable>Motor_B</variable>
            </coil>
            <rightPowerRail localId="2147483646">
              <position x="100" y="0" />
              <connectionPointIn />
            </rightPowerRail>
          </LD>
        </body>
      </pou>
    </pous>
  </types>
  <instances>
    <configurations>
      <configuration name="Config0">
        <resource name="Res0">
          <task name="tcyclic" interval="T#10ms" priority="0">
            <pouInstance name="inst0" typeName="drive" />
          </task>
        </resource>
      </configuration>
    </configurations>
  </instances>
</project>
