<?xml version="1.0" encoding="UTF-8"?>
<net name="PWM" type="iopt-flow">
  <signal id="Enable" x="40" y="70" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <arc id="a2" type="read" source="Enable" target="c1.Enable"/>
  <signal id="Period" x="75" y="90" mode="input" type="range" min="1" max="4096" frac="0" value="1" dynamic="none" microstep="0" nano-step="0"/>
  <arc id="a4" type="read" source="Period" target="c1.Period"/>
  <event id="Rst" x="75" y="50" mode="input" microstep="0" nano-step="0"/>
  <arc id="a6" type="read" source="Rst" target="c1.Rst"/>
  <signal id="DC" x="50" y="215" mode="input" type="range" min="0" max="4095" frac="0" value="1" dynamic="none" microstep="0" nano-step="0"/>
  <signal id="DeadTime" x="50" y="260" mode="input" type="range" min="0" max="255" frac="0" value="0" dynamic="none" microstep="0" nano-step="0"/>
  <signal id="OutH" x="370" y="170" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="3"/>
  <signal id="OutL" x="370" y="245" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="3"/>
  <operation id="o11" x="255" y="170" rot="0" shape="arrow" size="24">
    <name off_x="-10" off_y="5" text="o11"/>
    <input off_x="-24" off_y="-8" name="Cntr" id="o11.Cntr" type="range" min="0" max="4095" dynamic="all"/>
    <input off_x="-24" off_y="8" name="dc" id="o11.dc" type="range" min="0" max="4095" dynamic="type" frac="0"/>
    <output off_x="24" off_y="0" name="out" id="o11.out" type="boolean" min="0" max="1" dynamic="none" frac="0" microstep="1" nano-step="3">
      <expression>
        <operand type="signal" idRef="Cntr"/>
        <operator type="less"/>
        <operand type="signal" idRef="dc"/>
        <text>Cntr &lt; dc</text>
      </expression>
    </output>
  </operation>
  <arc id="a12" type="read" source="c1.Cntr" target="o11.Cntr" view="symbolic"/>
  <operation id="o15" x="260" y="245" rot="0" shape="arrow" size="32">
    <name off_x="-10" off_y="5" text="o15"/>
    <input off_x="-32" off_y="-16" name="Cntr" id="o15.Cntr" type="range" min="0" max="4095" dynamic="all"/>
    <input off_x="-32" off_y="0" name="dc" id="o15.dc" type="range" min="0" max="4095" dynamic="type" frac="0"/>
    <input off_x="-32" off_y="16" name="DeadTime" id="o15.DeadTime" type="range" min="0" max="255" dynamic="all" frac="0"/>
    <output off_x="32" off_y="0" name="out" id="o15.out" type="boolean" min="0" max="1" dynamic="none" frac="0" microstep="1" nano-step="3">
      <expression>
        <operand type="signal" idRef="Cntr"/>
        <operator type="more"/>
        <operand type="signal" idRef="dc"/>
        <operator type="add"/>
        <operand type="signal" idRef="DeadTime"/>
        <text>Cntr &gt; dc + DeadTime</text>
      </expression>
    </output>
  </operation>
  <arc id="a17" type="read" source="c1.Cntr" target="o15.Cntr" view="symbolic"/>
  <arc id="a19" type="read" source="DeadTime" target="o15.DeadTime"/>
  <component id="c1" class="local/cntr_up_dn.xml" x="210" y="70" width="120" height="80" rot="0" implementation="iopt-flow">
    <name off_x="-60" off_y="-45" text="cntr_up_dn_0"/>
    <source_model file="files/cntr_up_dn.xml"/>
    <input id="c1.Rst" name="Rst" type="event" off_x="-60" off_y="-20" microstep="0" nano-step="1"/>
    <input id="c1.Enable" name="Enable" off_x="-60" off_y="0" type="boolean" microstep="0" nano-step="1"/>
    <input id="c1.Period" name="Period" off_x="-60" off_y="20" type="range" min="1" max="4096" microstep="0" nano-step="1"/>
    <output id="c1.Max" name="Max" type="event" off_x="60" off_y="-20" microstep="1" nano-step="0"/>
    <output id="c1.Min" name="Min" type="event" off_x="60" off_y="0" microstep="1" nano-step="0"/>
    <output id="c1.Cntr" name="Cntr" off_x="60" off_y="20" type="range" min="0" max="4095" microstep="0" nano-step="2"/>
  </component>
  <event id="Start" x="340" y="70" mode="output" microstep="1" nano-step="1"/>
  <event id="Center" x="370" y="50" mode="output" microstep="1" nano-step="1"/>
  <arc id="a23" type="read" source="c1.Max" target="Center"/>
  <arc id="a24" type="read" source="c1.Min" target="Start"/>
  <operation id="o1" x="135" y="205" rot="0" shape="arrow" size="24">
    <name off_x="-15" off_y="-25" text="DC_s"/>
    <input off_x="-24" off_y="-8" name="Start" id="o1.Start" type="event" min="0" max="1" dynamic="name" frac="0"/>
    <input off_x="-24" off_y="8" name="DC" id="o1.DC" type="range" min="0" max="4095" dynamic="all" frac="0"/>
    <output off_x="24" off_y="0" name="out" id="o1.out" type="range" min="0" max="4095" dynamic="type" frac="0" microstep="1" nano-step="2">
      <expression>
        <operand type="signal" idRef="DC"/>
        <operator type="when"/>
        <operand type="signal" idRef="Start"/>
        <text>DC WHEN (Start)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="DC" delay="1"/>
        <text>DC[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a3" type="read" source="Start" target="o1.Start" view="symbolic"/>
  <arc id="a5" type="read" source="DC" target="o1.DC"/>
  <arc id="a7" type="read" source="o1.out" target="o11.dc"/>
  <arc id="a8" type="read" source="o1.out" target="o15.dc"/>
  <signal id="Cntr" x="370" y="90" mode="output" type="range" min="0" max="4095" dynamic="type" microstep="0" nano-step="3"/>
  <arc id="a9" type="read" source="c1.Cntr" target="Cntr"/>
  <arc id="a1" type="read" source="o15.out" target="OutL"/>
  <arc id="a10" type="read" source="o11.out" target="OutH"/>
</net>
