<?xml version="1.0"?>
<!DOCTYPE nta PUBLIC "-//Uppaal Team//DTD Flat System 1.0//EN" "http://www.docs.uu.se/docs/rtmv/uppaal/xml/flat-1_0.dtd">
<nta><declaration>// 1996-11-20, 1997-02-20, and 1997-07-31
// @ Uppsala University.
// Paul Pettersson, DoCS &amp; Magnus Lindahl, Mecel AB
//
// Engine
int    UseCase;
chan   ReqZeroTorque, TorqueZero, ReqSpeed;
chan   SpeedSet, ReqTorque;
// Clutch
chan   OpenClutch, CloseClutch, ClutchIsOpen, ClutchIsClosed;
// GearBox
chan   ReqNeu, GearNeu, ReqSet, GearSet;
// Gear
int    FromGear, ToGear;
chan   ReqNewGear, NewGear;
// System Decoration
int    ErrStat;
clock  CTimer, ETimer, GBTimer, GCTimer, SysTimer;</declaration><template><name x="5" y="5">Clutch</name><parameter x="10" y="25"/><declaration/><location id="id0" x="112" y="224"><name x="59" y="225">Closed</name></location><location id="id1" x="448" y="224"><name x="466" y="213">Closing</name><label kind="invariant" x="461" y="234"> CTimer&lt;=150</label></location><location id="id2" x="320" y="144"><name x="326" y="116">ErrorClose</name></location><location id="id3" x="232" y="144"><name x="153" y="145">ErrorOpen</name></location><location id="id4" x="448" y="72"><name x="467" y="60">Open</name></location><location id="id5" x="112" y="72"><name x="38" y="56">Opening</name><label kind="invariant" x="3" y="78"> CTimer&lt;=150</label></location><init ref="id0"/><transition><source ref="id0"/><target ref="id5"/><label kind="synchronisation" x="20" y="175">OpenClutch?</label><label kind="assignment" x="26" y="115">CTimer:=0</label></transition><transition><source ref="id1"/><target ref="id0"/><label kind="guard" x="322" y="228">CTimer>=100</label><label kind="synchronisation" x="158" y="229">ClutchIsClosed!</label></transition><transition><source ref="id1"/><target ref="id2"/><label kind="guard" x="307" y="186">CTimer==150</label><label kind="assignment" x="290" y="167">ErrStat:=1</label></transition><transition><source ref="id4"/><target ref="id1"/><label kind="synchronisation" x="455" y="120">CloseClutch?</label><label kind="assignment" x="458" y="158">CTimer:=0</label></transition><transition><source ref="id5"/><target ref="id3"/><label kind="guard" x="178" y="87">CTimer==150</label><label kind="assignment" x="200" y="107">ErrStat:=2</label></transition><transition><source ref="id5"/><target ref="id4"/><label kind="guard" x="140" y="47">CTimer>=100</label><label kind="synchronisation" x="307" y="47">ClutchIsOpen!</label></transition></template><template><name x="5" y="5">GearBox</name><parameter x="10" y="25"/><declaration/><location id="id6" x="112" y="200"><name x="38" y="189">Closing</name><label kind="invariant" x="33" y="211"> GBTimer&lt;=300</label></location><location id="id7" x="232" y="136"><name x="206" y="105">ErrorIdle</name></location><location id="id8" x="328" y="136"><name x="337" y="139">ErrorNeu</name></location><location id="id9" x="448" y="200"><name x="463" y="198">Idle</name></location><location id="id10" x="112" y="64"><name x="40" y="45">Neutral</name></location><location id="id11" x="448" y="64"><name x="463" y="46">Opening</name><label kind="invariant" x="461" y="70"> GBTimer&lt;=200</label></location><init ref="id10"/><transition><source ref="id6"/><target ref="id7"/><label kind="guard" x="177" y="168">GBTimer==300</label><label kind="assignment" x="207" y="148">ErrStat:=3</label></transition><transition><source ref="id6"/><target ref="id9"/><label kind="guard" x="179" y="207">GBTimer>=100</label><label kind="synchronisation" x="313" y="207">GearSet!</label></transition><transition><source ref="id9"/><target ref="id11"/><label kind="synchronisation" x="461" y="137">ReqNeu?</label><label kind="assignment" x="458" y="109">GBTimer:=0</label></transition><transition><source ref="id10"/><target ref="id6"/><label kind="synchronisation" x="46" y="106">ReqSet?</label><label kind="assignment" x="26" y="145">GBTimer:=0</label></transition><transition><source ref="id11"/><target ref="id8"/><label kind="guard" x="306" y="76">GBTimer>200</label><label kind="assignment" x="293" y="93">ErrStat:=4</label></transition><transition><source ref="id11"/><target ref="id10"/><label kind="guard" x="301" y="39">GBTimer>=100</label><label kind="synchronisation" x="156" y="38">GearNeu!</label></transition></template><template><name x="5" y="5">GearControl</name><parameter x="10" y="25"/><declaration/><location id="id12" x="344" y="928"><name x="362" y="927">CCloseError</name></location><location id="id13" x="376" y="288"><name x="385" y="286">COpenError</name></location><location id="id14" x="376" y="544"><name x="382" y="547">CheckClutch</name><label kind="invariant" x="378" y="568"> GCTimer&lt;=200</label></location><location id="id15" x="376" y="192"><name x="389" y="190">CheckClutch2</name><label kind="invariant" x="384" y="208"> GCTimer&lt;=200</label></location><location id="id16" x="344" y="832"><name x="352" y="831">CheckClutchClosed</name><label kind="invariant" x="351" y="848"> GCTimer&lt;=200</label></location><location id="id17" x="664" y="928"><name x="676" y="933">CheckClutchClosed2</name><label kind="invariant" x="671" y="949"> GCTimer&lt;=200</label></location><location id="id18" x="152" y="368"><name x="156" y="370">CheckGearNeu</name><label kind="invariant" x="155" y="387"> GCTimer&lt;=250</label></location><location id="id19" x="544" y="368"><name x="554" y="365">CheckGearNeu2</name><label kind="invariant" x="564" y="385"> GCTimer&lt;=250</label></location><location id="id20" x="152" y="736"><name x="156" y="742">CheckGearSet1</name><label kind="invariant" x="154" y="761"> GCTimer&lt;=350</label></location><location id="id21" x="536" y="736"><name x="542" y="743">CheckGearSet2</name><label kind="invariant" x="539" y="759"> GCTimer&lt;=350</label></location><location id="id22" x="152" y="544"><name x="161" y="551">CheckSyncSpeed</name><label kind="invariant" x="156" y="569"> GCTimer&lt;=155</label></location><location id="id23" x="152" y="192"><name x="164" y="193">CheckTorque</name><label kind="invariant" x="159" y="210"> GCTimer&lt;=255</label></location><location id="id24" x="536" y="832"><name x="549" y="833">ClutchClose</name><committed/></location><location id="id25" x="536" y="544"><name x="552" y="545">ClutchOpen</name><committed/></location><location id="id26" x="544" y="192"><name x="555" y="194">ClutchOpen2</name><committed/></location><location id="id27" x="408" y="368"><name x="419" y="375">GNeuError</name></location><location id="id28" x="392" y="736"><name x="401" y="744">GSetError</name></location><location id="id29" x="152" y="40"><name x="162" y="42">Gear</name></location><location id="id30" x="152" y="928"><name x="163" y="932">GearChanged</name><committed/></location><location id="id31" x="152" y="104"><name x="166" y="102">Initiate</name><committed/></location><location id="id32" x="152" y="288"><name x="174" y="280">ReqNeuGear</name><committed/></location><location id="id33" x="152" y="656"><name x="164" y="658">ReqSetGear</name><committed/></location><location id="id34" x="672" y="544"><name x="683" y="548">ReqSetGear2</name><committed/></location><location id="id35" x="152" y="456"><name x="164" y="456">ReqSyncSpeed</name><committed/></location><location id="id36" x="152" y="832"><name x="162" y="838">ReqTorqueC</name><committed/></location><init ref="id29"/><transition><source ref="id14"/><target ref="id13"/><label kind="guard" x="389" y="427">GCTimer>150,
GCTimer&lt;=200</label></transition><transition><source ref="id14"/><target ref="id25"/><label kind="synchronisation" x="409" y="516">ClutchIsOpen?</label></transition><transition><source ref="id15"/><target ref="id13"/><label kind="guard" x="268" y="220">GCTimer>150,
GCTimer&lt;=200</label></transition><transition><source ref="id15"/><target ref="id26"/><label kind="synchronisation" x="422" y="162">ClutchIsOpen?</label></transition><transition><source ref="id16"/><target ref="id12"/><label kind="guard" x="353" y="865">GCTimer>150,
GCTimer&lt;=200</label></transition><transition><source ref="id16"/><target ref="id36"/><label kind="synchronisation" x="208" y="809">ClutchIsClosed?</label></transition><transition><source ref="id17"/><target ref="id12"/><label kind="guard" x="521" y="884">GCTimer>150,
GCTimer&lt;=200</label></transition><transition><source ref="id17"/><target ref="id30"/><label kind="synchronisation" x="352" y="957">ClutchIsClosed?</label><nail x="664" y="984"/><nail x="152" y="984"/></transition><transition><source ref="id18"/><target ref="id27"/><label kind="guard" x="260" y="321">GCTimer>200,
GCTimer&lt;=250</label></transition><transition><source ref="id18"/><target ref="id35"/><label kind="synchronisation" x="160" y="412">GearNeu?</label></transition><transition><source ref="id19"/><target ref="id27"/><label kind="guard" x="426" y="321">GCTimer>200,
GCTimer&lt;=250</label></transition><transition><source ref="id19"/><target ref="id34"/><label kind="synchronisation" x="615" y="442">GearNeu?</label></transition><transition><source ref="id20"/><target ref="id28"/><label kind="guard" x="273" y="686">GCTimer>300,
GCTimer&lt;=350</label></transition><transition><source ref="id20"/><target ref="id36"/><label kind="synchronisation" x="158" y="783">GearSet?</label></transition><transition><source ref="id21"/><target ref="id24"/><label kind="synchronisation" x="543" y="787">GearSet?</label></transition><transition><source ref="id21"/><target ref="id28"/><label kind="guard" x="404" y="689">GCTimer>300,
GCTimer&lt;=350</label></transition><transition><source ref="id22"/><target ref="id14"/><label kind="guard" x="263" y="499">GCTimer>=150</label><label kind="synchronisation" x="264" y="516">OpenClutch!</label><label kind="assignment" x="285" y="547">GCTimer:=0</label></transition><transition><source ref="id22"/><target ref="id33"/><label kind="guard" x="160" y="596">GCTimer&lt;150</label><label kind="synchronisation" x="161" y="618">SpeedSet?</label></transition><transition><source ref="id23"/><target ref="id15"/><label kind="guard" x="286" y="133">GCTimer>=250</label><label kind="synchronisation" x="286" y="149">OpenClutch!</label><label kind="assignment" x="287" y="167">GCTimer:=0</label></transition><transition><source ref="id23"/><target ref="id32"/><label kind="guard" x="164" y="227">GCTimer&lt;250</label><label kind="synchronisation" x="165" y="245">TorqueZero?</label></transition><transition><source ref="id24"/><target ref="id16"/><label kind="synchronisation" x="386" y="789">CloseClutch!</label><label kind="assignment" x="387" y="806">GCTimer:=0</label></transition><transition><source ref="id25"/><target ref="id21"/><label kind="synchronisation" x="473" y="609">ReqSet!</label><label kind="assignment" x="432" y="635">GCTimer:=0</label></transition><transition><source ref="id26"/><target ref="id19"/><label kind="synchronisation" x="551" y="265">ReqNeu!</label><label kind="assignment" x="553" y="287">GCTimer:=0</label></transition><transition><source ref="id29"/><target ref="id31"/><label kind="synchronisation" x="160" y="61">ReqNewGear?</label><label kind="assignment" x="162" y="79">SysTimer:=0</label></transition><transition><source ref="id30"/><target ref="id29"/><label kind="synchronisation" x="17" y="937">NewGear!</label><nail x="35" y="928"/><nail x="35" y="41"/></transition><transition><source ref="id31"/><target ref="id23"/><label kind="guard" x="162" y="122">FromGear>0</label><label kind="synchronisation" x="163" y="141">ReqZeroTorque!</label><label kind="assignment" x="161" y="162">GCTimer:=0</label></transition><transition><source ref="id31"/><target ref="id35"/><label kind="guard" x="45" y="93">FromGear&lt;=0</label><nail x="108" y="134"/><nail x="109" y="421"/></transition><transition><source ref="id32"/><target ref="id18"/><label kind="synchronisation" x="163" y="307">ReqNeu!</label><label kind="assignment" x="162" y="326">GCTimer:=0</label></transition><transition><source ref="id33"/><target ref="id20"/><label kind="synchronisation" x="164" y="674">ReqSet!</label><label kind="assignment" x="163" y="695">GCTimer:=0</label></transition><transition><source ref="id34"/><target ref="id17"/><label kind="guard" x="703" y="746">ToGear==0</label><label kind="synchronisation" x="687" y="783">CloseClutch!</label><label kind="assignment" x="686" y="823">GCTimer:=0</label><nail x="784" y="544"/><nail x="784" y="928"/></transition><transition><source ref="id34"/><target ref="id21"/><label kind="guard" x="598" y="588">ToGear>0</label><label kind="synchronisation" x="608" y="652">ReqSet!</label><label kind="assignment" x="573" y="710">GCTimer:=0</label><nail x="672" y="736"/></transition><transition><source ref="id35"/><target ref="id22"/><label kind="guard" x="162" y="472">ToGear>0</label><label kind="synchronisation" x="162" y="492">ReqSpeed!</label><label kind="assignment" x="160" y="512">GCTimer:=0</label></transition><transition><source ref="id35"/><target ref="id30"/><label kind="guard" x="54" y="458">ToGear&lt;=0</label><nail x="108" y="485"/><nail x="108" y="891"/></transition><transition><source ref="id36"/><target ref="id30"/><label kind="synchronisation" x="162" y="877">ReqTorque!</label></transition></template><template><name x="5" y="5">Interface</name><parameter x="10" y="25"/><declaration/><location id="id37" x="600" y="120"><name x="590" y="90">Gear1</name></location><location id="id38" x="632" y="312"><name x="650" y="300">Gear2</name></location><location id="id39" x="640" y="512"><name x="654" y="500">Gear3</name></location><location id="id40" x="656" y="736"><name x="670" y="730">Gear4</name></location><location id="id41" x="656" y="952"><name x="676" y="933">Gear5</name></location><location id="id42" x="216" y="120"><name x="206" y="90">GearN</name></location><location id="id43" x="168" y="360"><name x="181" y="357">GearR</name></location><location id="id44" x="672" y="216"><name x="682" y="217">chkGear12</name></location><location id="id45" x="408" y="192"><name x="398" y="162">chkGear1N</name></location><location id="id46" x="552" y="224"><name x="465" y="228">chkGear21</name></location><location id="id47" x="688" y="424"><name x="698" y="425">chkGear23</name></location><location id="id48" x="576" y="416"><name x="481" y="414">chkGear32</name></location><location id="id49" x="712" y="632"><name x="729" y="621">chkGear34</name></location><location id="id50" x="576" y="624"><name x="478" y="620">chkGear43</name></location><location id="id51" x="696" y="864"><name x="707" y="860">chkGear45</name></location><location id="id52" x="576" y="856"><name x="477" y="847">chkGear54</name></location><location id="id53" x="400" y="64"><name x="390" y="34">chkGearN1</name></location><location id="id54" x="240" y="264"><name x="256" y="272">chkGearNR</name></location><location id="id55" x="128" y="240"><name x="36" y="210">chkGearRN</name></location><init ref="id42"/><transition><source ref="id37"/><target ref="id44"/><label kind="synchronisation" x="638" y="129">ReqNewGear!</label><label kind="assignment" x="670" y="151">FromGear:=1,
ToGear:=2</label></transition><transition><source ref="id37"/><target ref="id45"/><label kind="synchronisation" x="391" y="140">ReqNewGear!</label><label kind="assignment" x="379" y="118">FromGear:=1,ToGear:=0</label></transition><transition><source ref="id38"/><target ref="id46"/><label kind="synchronisation" x="473" y="249">ReqNewGear!</label><label kind="assignment" x="497" y="276">FromGear:=2,
ToGear:=1</label></transition><transition><source ref="id38"/><target ref="id47"/><label kind="synchronisation" x="666" y="333">ReqNewGear!</label><label kind="assignment" x="686" y="357">FromGear:=2,
ToGear:=3</label></transition><transition><source ref="id39"/><target ref="id48"/><label kind="synchronisation" x="487" y="449">ReqNewGear!</label><label kind="assignment" x="509" y="468">FromGear:=3,
ToGear:=2</label></transition><transition><source ref="id39"/><target ref="id49"/><label kind="synchronisation" x="669" y="528">ReqNewGear!</label><label kind="assignment" x="698" y="558">FromGear:=3,
ToGear:=4</label></transition><transition><source ref="id40"/><target ref="id50"/><label kind="synchronisation" x="518" y="654">ReqNewGear!</label><label kind="assignment" x="521" y="680">FromGear:=4,
ToGear:=3</label></transition><transition><source ref="id40"/><target ref="id51"/><label kind="synchronisation" x="682" y="755">ReqNewGear!</label><label kind="assignment" x="692" y="789">FromGear:=4,
ToGear:=5</label></transition><transition><source ref="id41"/><target ref="id52"/><label kind="synchronisation" x="496" y="890">ReqNewGear!</label><label kind="assignment" x="505" y="908">FromGear:=5,
ToGear:=4</label></transition><transition><source ref="id42"/><target ref="id53"/><label kind="synchronisation" x="251" y="29">ReqNewGear!</label><label kind="assignment" x="224" y="48">FromGear:=0,
ToGear:=1</label></transition><transition><source ref="id42"/><target ref="id54"/><label kind="synchronisation" x="243" y="185">ReqNewGear!</label><label kind="assignment" x="239" y="203">FromGear:=0,
ToGear:=6</label></transition><transition><source ref="id43"/><target ref="id55"/><label kind="synchronisation" x="32" y="272">ReqNewGear!</label><label kind="assignment" x="48" y="304">FromGear:=6,
ToGear:=0</label></transition><transition><source ref="id44"/><target ref="id38"/><label kind="synchronisation" x="675" y="251">NewGear?</label></transition><transition><source ref="id45"/><target ref="id42"/><label kind="synchronisation" x="252" y="141">NewGear?</label></transition><transition><source ref="id46"/><target ref="id37"/><label kind="synchronisation" x="521" y="172">NewGear?</label></transition><transition><source ref="id47"/><target ref="id39"/><label kind="synchronisation" x="682" y="459">NewGear?</label></transition><transition><source ref="id48"/><target ref="id38"/><label kind="synchronisation" x="523" y="346">NewGear?</label></transition><transition><source ref="id49"/><target ref="id40"/><label kind="synchronisation" x="708" y="658">NewGear?</label></transition><transition><source ref="id50"/><target ref="id39"/><label kind="synchronisation" x="534" y="541">NewGear?</label></transition><transition><source ref="id51"/><target ref="id41"/><label kind="synchronisation" x="695" y="904">NewGear?</label></transition><transition><source ref="id52"/><target ref="id40"/><label kind="synchronisation" x="538" y="774">NewGear?</label></transition><transition><source ref="id53"/><target ref="id37"/><label kind="synchronisation" x="495" y="58">NewGear?</label></transition><transition><source ref="id54"/><target ref="id43"/><label kind="synchronisation" x="216" y="312">NewGear?</label></transition><transition><source ref="id55"/><target ref="id42"/><label kind="synchronisation" x="93" y="158">NewGear?</label></transition></template><template><name x="5" y="5">Engine</name><parameter x="10" y="25"/><declaration/><location id="id56" x="192" y="184"><name x="203" y="188">ClutchClose</name><label kind="invariant" x="197" y="209"> ETimer&lt;=900</label></location><location id="id57" x="320" y="184"><name x="333" y="160">ClutchOpen</name><committed/></location><location id="id58" x="520" y="64"><name x="536" y="51">DecTorque</name><label kind="invariant" x="532" y="72"> ETimer&lt;=400</label></location><location id="id59" x="192" y="480"><name x="202" y="488">ErrorSpeed</name></location><location id="id60" x="320" y="400"><name x="288" y="410">FindSpeed</name><label kind="invariant" x="283" y="427"> ETimer&lt;=200</label></location><location id="id61" x="440" y="232"><name x="430" y="202">Initial</name></location><location id="id62" x="104" y="400"><name x="40" y="387">Speed</name><label kind="invariant" x="7" y="408"> ETimer&lt;=500</label></location><location id="id63" x="104" y="64"><name x="33" y="46">Torque</name></location><location id="id64" x="520" y="400"><name x="538" y="401">Zero</name></location><init ref="id61"/><transition><source ref="id56"/><target ref="id59"/><label kind="guard" x="132" y="302">ETimer==900</label></transition><transition><source ref="id56"/><target ref="id63"/><label kind="guard" x="136" y="91">ETimer>=50</label><label kind="synchronisation" x="154" y="109">ReqTorque?</label></transition><transition><source ref="id57"/><target ref="id56"/><label kind="guard" x="223" y="133">ToGear>0</label><label kind="assignment" x="221" y="151">ETimer:=0</label></transition><transition><source ref="id57"/><target ref="id61"/><label kind="guard" x="382" y="182">ToGear==0</label></transition><transition><source ref="id58"/><target ref="id57"/><label kind="guard" x="328" y="105">ETimer==400</label><label kind="assignment" x="327" y="128">UseCase:=1</label><nail x="320" y="100"/></transition><transition><source ref="id58"/><target ref="id64"/><label kind="guard" x="534" y="153">ETimer>=150</label><label kind="synchronisation" x="537" y="277">TorqueZero!</label></transition><transition><source ref="id60"/><target ref="id57"/><label kind="guard" x="246" y="247">ETimer==200</label><label kind="assignment" x="250" y="277">UseCase:=2</label></transition><transition><source ref="id60"/><target ref="id62"/><label kind="guard" x="231" y="353">ETimer>=50</label><label kind="synchronisation" x="235" y="371">SpeedSet!</label><label kind="assignment" x="199" y="403">ETimer:=0</label></transition><transition><source ref="id61"/><target ref="id60"/><label kind="synchronisation" x="366" y="246">ReqSpeed?</label><label kind="assignment" x="364" y="297">ETimer:=0,
UseCase:=0</label></transition><transition><source ref="id62"/><target ref="id59"/><label kind="guard" x="68" y="452">ETimer==500</label></transition><transition><source ref="id62"/><target ref="id63"/><label kind="guard" x="11" y="301">ETimer&lt;500</label><label kind="synchronisation" x="8" y="213">ReqTorque?</label></transition><transition><source ref="id63"/><target ref="id58"/><label kind="synchronisation" x="127" y="35">ReqZeroTorque?</label><label kind="assignment" x="315" y="35">ETimer:=0,UseCase:=0</label></transition><transition><source ref="id64"/><target ref="id60"/><label kind="guard" x="380" y="352">ToGear>0</label><label kind="synchronisation" x="377" y="374">ReqSpeed?</label><label kind="assignment" x="389" y="401">ETimer:=0</label></transition><transition><source ref="id64"/><target ref="id61"/><label kind="guard" x="438" y="276">ToGear==0</label></transition></template><instantiation/><system>system GearControl, Interface, Engine, GearBox, Clutch;</system></nta>
