| <?xml version="1.0" encoding="UTF-8" ?> |
| <!DOCTYPE FBType SYSTEM "http://www.holobloc.com/xml/LibraryElement.dtd"> |
| <FBType Comment="Function block for controling the operation of a pedestrian trafic light with one red and one green light" Name="PedLightCtl_Discrete"> |
| <Identification Standard="61499-2"/> |
| <VersionInfo Author="4DIAC-IDE" Date="2014-07-11" Organization="4DIAC-Consortium" Version="0.0"/> |
| <InterfaceList> |
| <EventInputs> |
| <Event Name="OutOfService" Type="Event"/> |
| <Event Name="Stop" Type="Event"/> |
| <Event Name="Allow" Type="Event"/> |
| </EventInputs> |
| <EventOutputs> |
| <Event Name="Stopped" Type="Event"/> |
| <Event Name="Allowed" Type="Event"/> |
| <Event Comment="" Name="UpdateLights" Type="Event"> |
| <With Var="green"/> |
| <With Var="red"/> |
| </Event> |
| </EventOutputs> |
| <InputVars/> |
| <OutputVars> |
| <VarDeclaration Name="red" Type="BOOL"/> |
| <VarDeclaration Comment="" InitialValue="" Name="green" Type="BOOL"/> |
| </OutputVars> |
| </InterfaceList> |
| <BasicFB> |
| <ECC> |
| <ECState Name="OutOfService" x="1615.0" y="1235.0"> |
| <ECAction Algorithm="AllOff" Output="UpdateLights"/> |
| </ECState> |
| <ECState Name="Block" x="1140.0" y="2375.0"> |
| <ECAction Algorithm="Stop" Output="UpdateLights"/> |
| <ECAction Output="Stopped"/> |
| </ECState> |
| <ECState Name="State" x="2470.0" y="2375.0"> |
| <ECAction Algorithm="Go" Output="UpdateLights"/> |
| <ECAction Output="Allowed"/> |
| </ECState> |
| <ECTransition Comment="" Condition="Stop" Destination="Block" Source="OutOfService" x="965.0" y="1815.0"/> |
| <ECTransition Comment="" Condition="OutOfService" Destination="OutOfService" Source="Block" x="1560.0" y="1895.0"/> |
| <ECTransition Comment="" Condition="Allow" Destination="State" Source="Block" x="1960.0" y="2185.0"/> |
| <ECTransition Comment="" Condition="Stop" Destination="Block" Source="State" x="1750.0" y="2895.0"/> |
| <ECTransition Comment="" Condition="OutOfService" Destination="OutOfService" Source="State" x="2205.0" y="1890.0"/> |
| <ECTransition Comment="" Condition="Allow" Destination="State" Source="OutOfService" x="2625.0" y="1830.0"/> |
| </ECC> |
| <Algorithm Comment="" Name="AllOff"> |
| <ST Text="red := FALSE; green := FALSE;"/> |
| </Algorithm> |
| <Algorithm Comment="Put lights in stop mode (i.e., red := true, green := false)" Name="Stop"> |
| <ST Text="red := TRUE; green := FALSE;"/> |
| </Algorithm> |
| <Algorithm Comment="Put lights in Walk mode (i.e., red := false, green := true)" Name="Go"> |
| <ST Text="red := FALSE; green := TRUE;"/> |
| </Algorithm> |
| </BasicFB> |
| </FBType> |