blob: 4d25a82e0a0047231c40e7b8899d13a989a79bca [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE FBType SYSTEM "http://www.holobloc.com/xml/LibraryElement.dtd">
<FBType Comment="Event-Driven Up-Down Counter" Name="E_CTUD">
<Identification Classification="Event-driven blocks" Description="Copyright (c) 2017 fortiss GmbH&#13;&#10; &#13;&#10;This program and the accompanying materials are made&#13;&#10;available under the terms of the Eclipse Public License 2.0&#13;&#10;which is available at https://www.eclipse.org/legal/epl-2.0/&#13;&#10;&#13;&#10;SPDX-License-Identifier: EPL-2.0" Function="Up-Down-counter" Standard="61499-1-A.x"/>
<VersionInfo Author="Alois Zoitl" Date="2017-09-22" Organization="fortiss GmbH" Remarks="initial API and implementation and/or initial documentation" Version="1.0"/>
<CompilerInfo/>
<InterfaceList>
<EventInputs>
<Event Comment="Count Up" Name="CU" Type="Event">
<With Var="PV"/>
</Event>
<Event Comment="Cound Down" Name="CD" Type="Event"/>
<Event Comment="Reset" Name="R" Type="Event"/>
<Event Comment="Load" Name="LD" Type="Event">
<With Var="PV"/>
</Event>
</EventInputs>
<EventOutputs>
<Event Comment="Count Output Event" Name="CO" Type="Event">
<With Var="QU"/>
<With Var="CV"/>
<With Var="QD"/>
</Event>
<Event Comment="Reset Output Event" Name="RO" Type="Event">
<With Var="QU"/>
<With Var="CV"/>
<With Var="QD"/>
</Event>
<Event Comment="" Name="LDO" Type="Event">
<With Var="QU"/>
<With Var="QD"/>
<With Var="CV"/>
</Event>
</EventOutputs>
<InputVars>
<VarDeclaration Comment="Preset Value" Name="PV" Type="UINT"/>
</InputVars>
<OutputVars>
<VarDeclaration Comment="CV &gt;=PV" Name="QU" Type="BOOL"/>
<VarDeclaration Comment="CV &lt;= 0" Name="QD" Type="BOOL"/>
<VarDeclaration Comment="" Name="CV" Type="UINT"/>
</OutputVars>
</InterfaceList>
<BasicFB>
<ECC>
<ECState Comment="" Name="START" x="1330.0" y="950.0"/>
<ECState Comment="" Name="CU" x="190.0" y="570.0">
<ECAction Algorithm="CountUp"/>
<ECAction Algorithm="UpdateQUQD" Output="CO"/>
</ECState>
<ECState Comment="" Name="R" x="190.0" y="1330.0">
<ECAction Algorithm="Reset"/>
<ECAction Algorithm="UpdateQUQD" Output="RO"/>
</ECState>
<ECState Comment="" Name="CD" x="1710.0" y="570.0">
<ECAction Algorithm="CountDown"/>
<ECAction Algorithm="UpdateQUQD" Output="CO"/>
</ECState>
<ECState Comment="" Name="LD" x="1805.0" y="1330.0">
<ECAction Algorithm="Load"/>
<ECAction Algorithm="UpdateQUQD" Output="LDO"/>
</ECState>
<ECTransition Comment="" Condition="CU[(CV&lt;65535)]" Destination="CU" Source="START" x="275.0" y="880.0"/>
<ECTransition Comment="" Condition="1" Destination="START" Source="CU" x="570.0" y="860.0"/>
<ECTransition Comment="" Condition="R" Destination="R" Source="START" x="710.0" y="1125.0"/>
<ECTransition Comment="" Condition="1" Destination="START" Source="R" x="745.0" y="1240.0"/>
<ECTransition Comment="" Condition="CD[(CV&gt;=1)]" Destination="CD" Source="START" x="1460.0" y="705.0"/>
<ECTransition Comment="" Condition="1" Destination="START" Source="CD" x="1780.0" y="925.0"/>
<ECTransition Comment="" Condition="LD" Destination="LD" Source="START" x="1825.0" y="1145.0"/>
<ECTransition Comment="" Condition="1" Destination="START" Source="LD" x="1515.0" y="1275.0"/>
</ECC>
<Algorithm Comment="Count Up" Name="CountUp">
<ST Text="CV := CV + 1;&#10;&#10;"/>
</Algorithm>
<Algorithm Comment="Reset" Name="Reset">
<ST Text="CV := 0;&#10;"/>
</Algorithm>
<Algorithm Comment="ALG" Name="Load">
<ST Text="CV := PV;"/>
</Algorithm>
<Algorithm Comment="ALG" Name="UpdateQUQD">
<ST Text="QU := (CV &gt;= PV);&#13;&#10;QD := (CV &lt;= 0);"/>
</Algorithm>
<Algorithm Comment="ALG" Name="CountDown">
<ST Text="CV := CV - 1;"/>
</Algorithm>
</BasicFB>
</FBType>