| <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| <!DOCTYPE FBType SYSTEM "http://www.holobloc.com/xml/LibraryElement.dtd"> |
| <FBType Comment="Event-Driven Down Counter" Name="E_CTD"> |
| <Identification Classification="Event-driven blocks" Description="Copyright (c) 2017 fortiss GmbH 			 2019 Johannes Keppler University Linz This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/ SPDX-License-Identifier: EPL-2.0" Function="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"/> |
| <VersionInfo Author="Alois Zoitl" Date="2019-07-09" Organization="JKU" Remarks="fixed bug in down counting" Version="1.1"/> |
| <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 <= 0" Name="Q" Type="BOOL"/> |
| <VarDeclaration Comment="" Name="CV" Type="UINT"/> |
| </OutputVars> |
| </InterfaceList> |
| <BasicFB> |
| <ECC> |
| <ECState Comment="" Name="START" x="240.0" y="90.0"/> |
| <ECState Comment="" Name="CD" 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[(CV > 0)]" Destination="CD" Source="START" x="1035.0" y="460.0"/> |
| <ECTransition Comment="" Condition="1" Destination="START" Source="CD" 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; Q := (CV = 0); "/> |
| </Algorithm> |
| <Algorithm Comment="Load" Name="LD"> |
| <ST Text="CV := PV; Q:= (CV = 0); "/> |
| </Algorithm> |
| </BasicFB> |
| </FBType> |