blob: 239ed12934bfd3694f60b724d19e8c00ae27edf7 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE FBType SYSTEM "http://www.holobloc.com/xml/LibraryElement.dtd">
<FBType Comment="Event-Driven Down Counter" Name="E_CTD">
<Identification Classification="Event-driven blocks" Function="Down-counter" Standard="61499-1-A.x"/>
<VersionInfo Author="AZ" Date="2012-12-20" Organization="4DIAC-Consortium" Version="1.0"/>
<CompilerInfo/>
<InterfaceList>
<EventInputs>
<Event Comment="Count Down" Name="CD" Type="Event"/>
<Event Comment="Load counter value" Name="LD" Type="Event">
<With Var="PV"/>
</Event>
</EventInputs>
<EventOutputs>
<Event Comment="Count Down Output Event" Name="CDO" Type="Event">
<With Var="Q"/>
<With Var="CV"/>
</Event>
<Event Comment="Reset Output Event" Name="LDO" Type="Event">
<With Var="Q"/>
<With Var="CV"/>
</Event>
</EventOutputs>
<InputVars>
<VarDeclaration Comment="Preset Value" Name="PV" Type="UINT"/>
</InputVars>
<OutputVars>
<VarDeclaration Comment="CV &lt;= 0" Name="Q" Type="BOOL"/>
<VarDeclaration Name="CV" Type="UINT"/>
</OutputVars>
</InterfaceList>
<BasicFB>
<ECC>
<ECState Comment="" Name="START" x="240.0" y="90.0"/>
<ECState Comment="" Name="CU" x="865.0" y="90.0">
<ECAction Algorithm="CD" Output="CDO"/>
</ECState>
<ECState Comment="" Name="LD" x="450.0" y="610.0">
<ECAction Algorithm="LD" Output="LDO"/>
</ECState>
<ECTransition Comment="" Condition="CD&amp;(CV &gt;= 1)" Destination="CU" Source="START" x="1035.0" y="460.0"/>
<ECTransition Comment="" Condition="1" Destination="START" Source="CU" x="630.0" y="90.0"/>
<ECTransition Comment="" Condition="LD" Destination="LD" Source="START" x="395.0" y="510.0"/>
<ECTransition Comment="" Condition="1" Destination="START" Source="LD" x="240.0" y="610.0"/>
</ECC>
<Algorithm Comment="Count Down" Name="CD">
<ST Text="CV := CV - 1;&#10;Q := (CV &lt;= 0);&#10;&#10;"/>
</Algorithm>
<Algorithm Comment="Load" Name="LD">
<ST Text="CV := PV;&#10;Q:= (CV &lt;= 0);&#10;"/>
</Algorithm>
</BasicFB>
</FBType>