<?xml version="1.0" encoding="utf-8"?>
<!-- counter_reset: a free-running counter with a reset-to-value.
   Reset loads ResetCounterValue, otherwise Cnt increments; OUT follows Cnt.
   Imported from the Beremiz IEC 61131-3 language test (CounterFBD function block),
   re-expressed as a PROGRAM so it stands alone. See benchmark.yml for provenance. -->
<project xmlns="http://www.plcopen.org/xml/tc6_0200">
  <fileHeader companyName="Anonymous" productName="Benchmark Suite" productVersion="1.0" creationDateTime="2026-08-29T00:00:00" />
  <contentHeader name="fbd_counter_reset"><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="Reset"><type><BOOL /></type></variable>
        <variable name="ResetCounterValue"><type><INT /></type></variable>
      </inputVars>
      <outputVars><variable name="OUT"><type><INT /></type></variable></outputVars>
      <localVars><variable name="Cnt"><type><INT /></type></variable></localVars>
    </interface>
    <body><FBD>
            <inVariable localId="1" executionOrderId="0" height="30" width="61" negated="false">
              <position x="321" y="58" />
              <connectionPointOut>
                <relPosition x="61" y="15" />
              </connectionPointOut>
              <expression>Reset</expression>
            </inVariable>
            <outVariable localId="2" executionOrderId="0" height="30" width="39" negated="false">
              <position x="675" y="137" />
              <connectionPointIn>
                <relPosition x="0" y="15" />
                <connection refLocalId="3">
                  <position x="675" y="152" />
                  <position x="589" y="152" />
                </connection>
              </connectionPointIn>
              <expression>OUT</expression>
            </outVariable>
            <inOutVariable localId="3" executionOrderId="0" height="30" width="37" negatedOut="false" negatedIn="false">
              <position x="557" y="137" />
              <connectionPointIn>
                <relPosition x="0" y="15" />
                <connection refLocalId="7" formalParameter="OUT">
                  <position x="557" y="152" />
                  <position x="527" y="152" />
                  <position x="527" y="130" />
                  <position x="517" y="130" />
                </connection>
              </connectionPointIn>
              <connectionPointOut>
                <relPosition x="37" y="15" />
              </connectionPointOut>
              <expression>Cnt</expression>
            </inOutVariable>
            <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="69">
              <position x="328" y="115" />
              <inputVariables>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="35" />
                    <connection refLocalId="6">
                      <position x="328" y="150" />
                      <position x="275" y="150" />
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN2">
                  <connectionPointIn>
                    <relPosition x="0" y="65" />
                    <connection refLocalId="3">
                      <position x="328" y="180" />
                      <position x="317" y="180" />
                      <position x="317" y="213" />
                      <position x="604" y="213" />
                      <position x="604" y="152" />
                      <position x="594" y="152" />
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables />
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="69" y="35" />
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
            <inVariable localId="5" executionOrderId="0" height="30" width="163" negated="false">
              <position x="222" y="256" />
              <connectionPointOut>
                <relPosition x="163" y="15" />
              </connectionPointOut>
              <expression>ResetCounterValue</expression>
            </inVariable>
            <inVariable localId="6" executionOrderId="0" height="30" width="21" negated="false">
              <position x="254" y="135" />
              <connectionPointOut>
                <relPosition x="21" y="15" />
              </connectionPointOut>
              <expression>1</expression>
            </inVariable>
            <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="69">
              <position x="448" y="100" />
              <inputVariables>
                <variable formalParameter="G">
                  <connectionPointIn>
                    <relPosition x="0" y="30" />
                    <connection refLocalId="1">
                      <position x="448" y="130" />
                      <position x="415" y="130" />
                      <position x="415" y="73" />
                      <position x="382" y="73" />
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN0">
                  <connectionPointIn>
                    <relPosition x="0" y="50" />
                    <connection refLocalId="4" formalParameter="OUT">
                      <position x="448" y="150" />
                      <position x="397" y="150" />
                    </connection>
                  </connectionPointIn>
                </variable>
                <variable formalParameter="IN1">
                  <connectionPointIn>
                    <relPosition x="0" y="70" />
                    <connection refLocalId="5">
                      <position x="448" y="170" />
                      <position x="414" y="170" />
                      <position x="414" y="271" />
                      <position x="385" y="271" />
                    </connection>
                  </connectionPointIn>
                </variable>
              </inputVariables>
              <inOutVariables />
              <outputVariables>
                <variable formalParameter="OUT">
                  <connectionPointOut>
                    <relPosition x="69" y="30" />
                  </connectionPointOut>
                </variable>
              </outputVariables>
            </block>
          </FBD></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>
