<?xml version="1.0" encoding="UTF-8"?>
<net name="Test" type="iopt-flow">
  <operation id="o1" x="305" y="90" constant="1023" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="1023"/>
    <output off_x="20" off_y="0" name="K" id="o1.K" type="range" min="1023" max="1023" dynamic="none" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="literal" value="1023"/>
        <text>1023</text>
      </expression>
    </output>
  </operation>
  <arc id="a2" type="read" source="o1.K" target="c1.Period"/>
  <operation id="o5" x="305" y="130" constant="20" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="20"/>
    <output off_x="20" off_y="0" name="K" id="o5.K" type="range" min="20" max="20" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>20</text>
        <operand type="literal" value="20"/>
      </expression>
    </output>
  </operation>
  <arc id="a6" type="read" source="o5.K" target="c1.DeadTime"/>
  <signal id="Enb" x="235" y="70" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <arc id="a8" type="read" source="Enb" target="c1.Enable"/>
  <event id="Rst" x="70" y="50" mode="input" microstep="0" nano-step="0"/>
  <arc id="a10" type="read" source="Rst" target="c1.Rst"/>
  <component id="c1" class="local/PWM.xml" x="445" y="90" width="140" height="120" rot="0" implementation="iopt-flow">
    <name off_x="-70" off_y="-65" text="PWM_1"/>
    <source_model file="files/PWM.xml"/>
    <input id="c1.Rst" name="Rst" type="event" off_x="-70" off_y="-40" microstep="0" nano-step="1"/>
    <input id="c1.Enable" name="Enable" off_x="-70" off_y="-20" type="boolean" microstep="0" nano-step="1"/>
    <input id="c1.Period" name="Period" off_x="-70" off_y="0" type="range" min="1" max="4096" microstep="0" nano-step="1"/>
    <input id="c1.DC" name="DC" off_x="-70" off_y="20" type="range" min="0" max="4095" microstep="1" nano-step="3"/>
    <input id="c1.DeadTime" name="DeadTime" off_x="-70" off_y="40" type="range" min="0" max="255" microstep="0" nano-step="1"/>
    <output id="c1.Center" name="Center" type="event" off_x="70" off_y="-40" microstep="1" nano-step="1"/>
    <output id="c1.Start" name="Start" type="event" off_x="70" off_y="-20" microstep="1" nano-step="1"/>
    <output id="c1.Cntr" name="Cntr" off_x="70" off_y="0" type="range" min="0" max="4095" microstep="0" nano-step="4"/>
    <output id="c1.OutL" name="OutL" off_x="70" off_y="20" type="boolean" microstep="1" nano-step="5"/>
    <output id="c1.OutH" name="OutH" off_x="70" off_y="40" type="boolean" microstep="1" nano-step="5"/>
  </component>
  <arc id="a3" type="read" source="c2.Cntr" target="c1.DC"/>
  <signal id="A" x="35" y="130" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="B" x="55" y="150" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <arc id="a7" type="read" source="A" target="c2.ChA"/>
  <arc id="a9" type="read" source="B" target="c2.ChB"/>
  <arc id="a11" type="read" source="Rst" target="c2.Rst"/>
  <signal id="QECntr" x="685" y="80" mode="output" type="range" min="0" max="1023" dynamic="type" microstep="1" nano-step="3"/>
  <arc id="a14" type="read" source="c2.Cntr" target="QECntr" view="symbolic"/>
  <component id="c3" class="local/bldc_commut.xml" x="690" y="255" width="170" height="180" rot="0" implementation="iopt-flow">
    <name off_x="-85" off_y="-95" text="commut"/>
    <source_model file="files/bldc_commut.xml"/>
    <input id="c3.UpdClk" name="UpdClk" type="event" off_x="-85" off_y="-70" microstep="1" nano-step="2"/>
    <input id="c3.OutEnb" name="OutEnb" off_x="-85" off_y="-50" type="boolean" microstep="0" nano-step="1"/>
    <input id="c3.U" name="U" off_x="-85" off_y="-30" type="boolean" microstep="0" nano-step="5"/>
    <input id="c3.V" name="V" off_x="-85" off_y="-10" type="boolean" microstep="0" nano-step="5"/>
    <input id="c3.W" name="W" off_x="-85" off_y="10" type="boolean" microstep="0" nano-step="5"/>
    <input id="c3.Dir" name="Dir" off_x="-85" off_y="30" type="boolean" microstep="0" nano-step="1"/>
    <input id="c3.PwmH" name="PwmH" off_x="-85" off_y="50" type="boolean" microstep="1" nano-step="6"/>
    <input id="c3.PwmL" name="PwmL" off_x="-85" off_y="70" type="boolean" microstep="1" nano-step="6"/>
    <output id="c3.UH" name="UH" off_x="85" off_y="-70" type="boolean" microstep="1" nano-step="8"/>
    <output id="c3.UL" name="UL" off_x="85" off_y="-50" type="boolean" microstep="1" nano-step="8"/>
    <output id="c3.VH" name="VH" off_x="85" off_y="-30" type="boolean" microstep="1" nano-step="8"/>
    <output id="c3.VL" name="VL" off_x="85" off_y="-10" type="boolean" microstep="1" nano-step="8"/>
    <output id="c3.WH" name="WH" off_x="85" off_y="10" type="boolean" microstep="1" nano-step="8"/>
    <output id="c3.WL" name="WL" off_x="85" off_y="30" type="boolean" microstep="1" nano-step="8"/>
    <output id="c3.Sector" name="Sector" off_x="85" off_y="50" type="range" min="0" max="6" microstep="0" nano-step="1"/>
  </component>
  <arc id="a16" type="read" source="Enb" target="c3.OutEnb" view="symbolic"/>
  <arc id="a21" type="read" source="c1.OutH" target="c3.PwmH" view="symbolic"/>
  <arc id="a22" type="read" source="c1.OutL" target="c3.PwmL" view="symbolic"/>
  <signal id="U_h" x="45" y="225" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="U_l" x="70" y="245" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="V_h" x="45" y="305" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="V_l" x="70" y="325" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="W_h" x="45" y="385" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="W_l" x="70" y="405" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <operation id="o2" x="930" y="50" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="uh_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o2.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o2.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o2.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <arc id="a39" type="read" source="c3.UH" target="o2.I"/>
  <operation id="o40" x="930" y="120" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="ul_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o40.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o40.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o40.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <arc id="a41" type="read" source="c3.UL" target="o40.I"/>
  <operation id="o42" x="930" y="195" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="vh_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o42.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o42.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o42.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <arc id="a43" type="read" source="c3.VH" target="o42.I"/>
  <operation id="o44" x="930" y="275" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="vl_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o44.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o44.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o44.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <arc id="a45" type="read" source="c3.VL" target="o44.I"/>
  <operation id="o46" x="930" y="355" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="wh_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o46.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o46.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o46.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <operation id="o47" x="930" y="435" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="wl_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o47.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o47.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o47.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="9">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <arc id="a48" type="read" source="c3.WH" target="o46.I"/>
  <arc id="a49" type="read" source="c3.WL" target="o47.I"/>
  <signal id="UHP" x="1045" y="40" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <arc id="a51" type="read" source="o2.OP" target="UHP"/>
  <signal id="UHN" x="1020" y="60" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <arc id="a53" type="read" source="o2.ON" target="UHN"/>
  <signal id="VHP" x="1045" y="185" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <signal id="VHN" x="1020" y="205" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <signal id="ULP" x="1045" y="110" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <signal id="ULN" x="1020" y="130" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <arc id="a27" type="read" source="o40.ON" target="ULN"/>
  <arc id="a28" type="read" source="o40.OP" target="ULP"/>
  <arc id="a31" type="read" source="o42.ON" target="VHN"/>
  <arc id="a32" type="read" source="o42.OP" target="VHP"/>
  <signal id="VLP" x="1045" y="265" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <signal id="VLN" x="1020" y="285" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <arc id="a35" type="read" source="o44.OP" target="VLP"/>
  <arc id="a36" type="read" source="o44.ON" target="VLN"/>
  <signal id="WHP" x="1045" y="345" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <signal id="WHN" x="1020" y="365" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <signal id="WLP" x="1040" y="425" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <signal id="WLN" x="1015" y="445" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="9"/>
  <arc id="a42" type="read" source="o46.OP" target="WHP"/>
  <arc id="a44" type="read" source="o46.ON" target="WHN"/>
  <arc id="a46" type="read" source="o47.OP" target="WLP"/>
  <arc id="a47" type="read" source="o47.ON" target="WLN"/>
  <component id="c7" class="local/nfilter.xml" x="350" y="385" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_w"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c7.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c7.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <component id="c8" class="local/nfilter.xml" x="350" y="305" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_v"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c8.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c8.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <component id="c9" class="local/nfilter.xml" x="350" y="225" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_u"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c9.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c9.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <arc id="a1" type="read" source="c4.O" target="c9.SIG"/>
  <arc id="a4" type="read" source="c5.O" target="c8.SIG"/>
  <arc id="a5" type="read" source="c6.O" target="c7.SIG"/>
  <arc id="a13" type="read" source="c9.FSIG" target="c3.U"/>
  <arc id="a15" type="read" source="c8.FSIG" target="c3.V"/>
  <arc id="a18" type="read" source="c7.FSIG" target="c3.W"/>
  <component id="c4" class="local/diff_in.xml" x="200" y="235" width="110" height="60" rot="0" implementation="iopt-flow">
    <name off_x="-55" off_y="-35" text="u_diff_in"/>
    <source_model file="files/diff_in.xml"/>
    <input id="c4.I_P" name="I_P" off_x="-55" off_y="-10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c4.I_N" name="I_N" off_x="-55" off_y="10" type="boolean" microstep="0" nano-step="1"/>
    <output id="c4.O" name="O" off_x="55" off_y="-10" type="boolean" microstep="0" nano-step="2"/>
  </component>
  <component id="c5" class="local/diff_in.xml" x="200" y="315" width="110" height="60" rot="0" implementation="iopt-flow">
    <name off_x="-55" off_y="-35" text="v_diff_in"/>
    <source_model file="files/diff_in.xml"/>
    <input id="c5.I_P" name="I_P" off_x="-55" off_y="-10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c5.I_N" name="I_N" off_x="-55" off_y="10" type="boolean" microstep="0" nano-step="1"/>
    <output id="c5.O" name="O" off_x="55" off_y="-10" type="boolean" microstep="0" nano-step="2"/>
  </component>
  <component id="c6" class="local/diff_in.xml" x="200" y="395" width="110" height="60" rot="0" implementation="iopt-flow">
    <name off_x="-55" off_y="-35" text="w_diff_in"/>
    <source_model file="files/diff_in.xml"/>
    <input id="c6.I_P" name="I_P" off_x="-55" off_y="-10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c6.I_N" name="I_N" off_x="-55" off_y="10" type="boolean" microstep="0" nano-step="1"/>
    <output id="c6.O" name="O" off_x="55" off_y="-10" type="boolean" microstep="0" nano-step="2"/>
  </component>
  <arc id="a12" type="read" source="U_h" target="c4.I_P"/>
  <arc id="a19" type="read" source="U_l" target="c4.I_N"/>
  <arc id="a20" type="read" source="V_h" target="c5.I_P"/>
  <arc id="a23" type="read" source="V_l" target="c5.I_N"/>
  <arc id="a24" type="read" source="W_h" target="c6.I_P"/>
  <arc id="a29" type="read" source="W_l" target="c6.I_N"/>
  <signal id="RotDir" x="480" y="290" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <arc id="a25" type="read" source="RotDir" target="c3.Dir"/>
  <signal id="Sector" x="810" y="390" mode="output" type="range" min="0" max="6" dynamic="type" microstep="0" nano-step="2"/>
  <arc id="a30" type="read" source="c3.Sector" target="Sector"/>
  <operation id="o18" x="580" y="60" rot="0" shape="arrow" size="24">
    <name off_x="-10" off_y="-20" text="or"/>
    <input off_x="-24" off_y="-8" name="Center" id="o18.Center" type="event" dynamic="all"/>
    <input off_x="-24" off_y="8" name="Start" id="o18.Start" type="event" dynamic="all"/>
    <output off_x="24" off_y="0" name="out" id="o18.out" type="event" min="0" max="1" frac="0" microstep="1" nano-step="2">
      <expression>
        <operand type="signal" idRef="Center"/>
        <operator type="or"/>
        <operand type="signal" idRef="Start"/>
        <text>Center OR Start</text>
      </expression>
    </output>
  </operation>
  <arc id="a26" type="read" source="c1.Center" target="o18.Center"/>
  <arc id="a33" type="read" source="c1.Start" target="o18.Start"/>
  <arc id="a34" type="read" source="o18.out" target="c3.UpdClk"/>
  <component id="c2" class="local/qe.xml" x="210" y="140" width="130" height="100" rot="0" implementation="iopt-flow">
    <name off_x="-65" off_y="-55" text="qenc"/>
    <source_model file="files/qe.xml"/>
    <input id="c2.Rst" name="Rst" type="event" off_x="-65" off_y="-30" microstep="0" nano-step="1"/>
    <input id="c2.ChA" name="ChA" off_x="-65" off_y="-10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c2.ChB" name="ChB" off_x="-65" off_y="10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c2.X4" name="X4" off_x="-65" off_y="30" type="boolean" microstep="0" nano-step="1"/>
    <output id="c2.Cntr" name="Cntr" off_x="65" off_y="-30" type="range" min="0" max="1023" microstep="1" nano-step="2"/>
  </component>
  <operation id="o3" x="90" y="170" constant="1" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="1"/>
    <output off_x="20" off_y="0" name="K" id="o3.K" type="range" min="1" max="1" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>1</text>
        <operand type="literal" value="1"/>
      </expression>
    </output>
  </operation>
  <arc id="a17" type="read" source="o3.K" target="c2.X4"/>
</net>
