<?xml version="1.0" encoding="UTF-8"?>
<net name="ME_Validade" type="iopt-flow">
  <operation id="o19" x="350" y="290" rot="0" shape="arrow" size="32">
    <name off_x="-27" off_y="-32" text="o19"/>
    <input off_x="-32" off_y="-16" name="max" id="o19.max" type="range" min="-32768" max="32767" frac="0"/>
    <input off_x="-32" off_y="0" name="event" id="o19.event" type="range" min="-32768" max="32767" frac="0"/>
    <input off_x="-32" off_y="16" name="count" id="o19.count" type="range" min="-32768" max="32767" frac="0"/>
    <output off_x="32" off_y="0" name="out" id="o19.out" type="range" min="0" max="32767" dynamic="none" frac="0">
      <expression>
        <operand type="literal" value="0"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="event"/>
        </operand>
        <text>0 WHEN (event)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="count" delay="1"/>
        <operator type="add"/>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="count" delay="1"/>
          <operator type="less-or-equal"/>
          <operand type="sub-expression">
            <operand type="signal" idRef="max"/>
            <operator type="add"/>
            <operand type="literal" value="2"/>
          </operand>
        </operand>
        <text>count[-1] + 1 WHEN (count[-1] &lt;= (max + 2))</text>
      </expression>
      <expression>
        <operand type="signal" idRef="count" delay="1"/>
        <text>count[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a21" type="read" source="o19.out" target="o19.count" view="symbolic"/>
  <operation id="o4" x="485" y="295" rot="0" shape="arrow" size="32">
    <name off_x="-27" off_y="-32" text="o4"/>
    <input off_x="-32" off_y="-16" name="max" id="o4.max" type="range" min="0" max="100" dynamic="all" frac="0"/>
    <input off_x="-32" off_y="0" name="o19" id="o4.o19" type="range" min="0" max="32767" dynamic="all" frac="0"/>
    <input off_x="-32" off_y="16" name="min" id="o4.min" type="range" min="0" max="100" dynamic="all" frac="0"/>
    <output off_x="32" off_y="0" name="out" id="o4.out" type="boolean" min="0" max="1" dynamic="type" frac="0">
      <expression>
        <operand type="sub-expression">
          <operand type="signal" idRef="o19"/>
          <operator type="more-or-equal"/>
          <operand type="signal" idRef="min"/>
        </operand>
        <operator type="and"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="o19"/>
          <operator type="less-or-equal"/>
          <operand type="signal" idRef="max"/>
        </operand>
        <text>(o19 &gt;= min) AND (o19 &lt;= max)</text>
      </expression>
    </output>
  </operation>
  <arc id="a5" type="read" source="o19.out" target="o4.o19"/>
  <signal id="max" x="405" y="195" mode="input" type="range" min="0" max="100" frac="0" value="0" dynamic="none" io_pin="0"/>
  <signal id="min" x="355" y="400" mode="input" type="range" min="0" max="100" frac="0" value="0" dynamic="none" io_pin="0"/>
  <arc id="a8" type="read" source="min" target="o4.min"/>
  <arc id="a9" type="read" source="max" target="o4.max"/>
  <arc id="a10" type="read" source="max" target="o19.max"/>
  <signal id="event" x="65" y="305" mode="input" type="boolean" min="0" max="1"/>
  <signal id="valid_Out" x="580" y="295" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0"/>
  <arc id="a15" type="read" source="o4.out" target="valid_Out"/>
  <signal id="Valid_In" x="65" y="250" mode="input" type="boolean" min="0" max="1"/>
  <operation id="op1" x="165" y="280" rot="0" shape="arrow" size="25" locked="true">
    <name text="AND" off_x="-12" off_y="-5"/>
    <input id="op1.Valid_In" name="Valid_In" type="boolean" dynamic="name" off_x="-25" off_y="-10"/>
    <input id="op1.event" name="event" type="boolean" dynamic="name" off_x="-25" off_y="10"/>
    <output id="op1.out" name="out" type="boolean" off_x="25" off_y="0">
      <expression>
        <text>Valid_In AND event</text>
        <operand type="signal" idRef="Valid_In"/>
        <operator type="and"/>
        <operand type="signal" idRef="event"/>
      </expression>
    </output>
  </operation>
  <arc id="a22" type="read" source="Valid_In" target="op1.Valid_In"/>
  <arc id="a23" type="read" source="event" target="op1.event"/>
  <arc id="a24" type="read" source="op1.out" target="o19.event"/>
</net>
