Add default instance call (FB) for the error handling

In the action ERROR() the necessary default instances are included
an example nin comments is included
Build solution without an error
This commit is contained in:
Federico Rojas
2018-10-30 15:16:57 +01:00
parent 2457083e95
commit 9442e7d1a2
4 changed files with 102 additions and 15 deletions
+49 -9
View File
@@ -1143,6 +1143,46 @@ External Setpoint Generation:
</Comment>
</SubVar>
</Var>
<Var>
<Name>MAIN.fbEL1808.Channel_1_Input</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.fbEL1808.Channel_2_Input</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.fbEL1808.Channel_3_Input</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.fbEL1808.Channel_4_Input</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.fbEL1808.Channel_5_Input</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.fbEL1808.Channel_6_Input</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.fbEL1808.Channel_7_Input</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.fbEL1808.Channel_8_Input</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.fbEL1808.WcState_WcState</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.fbEL1808.InfoData_State</Name>
<Type>UINT</Type>
</Var>
</Vars>
<Vars VarGrpType="2">
<Name>PlcTask Outputs</Name>
@@ -1171,15 +1211,6 @@ bHomeSensor8 AT %I*: BOOL;
</Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.bOutput5</Name>
<Comment>
<![CDATA[bOutput2 AT %Q*: BOOL:= TRUE;
bOutput3 AT %Q*: BOOL:= TRUE;
bOutput4 AT %Q*: BOOL:= TRUE;]]>
</Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>MAIN.M1Link.Axis.PlcToNc</Name>
<Type GUID="{63A84524-72E3-41C8-BEAB-4CCE44690A13}" Namespace="MC">PLCTONC_AXIS_REF</Type>
@@ -1196,6 +1227,15 @@ bOutput4 AT %Q*: BOOL:= TRUE;]]>
<Name>MAIN.M2.MasterAxis.PlcToNc</Name>
<Type GUID="{63A84524-72E3-41C8-BEAB-4CCE44690A13}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>MAIN.bOutput5</Name>
<Comment>
<![CDATA[bOutput2 AT %Q*: BOOL:= TRUE;
bOutput3 AT %Q*: BOOL:= TRUE;
bOutput4 AT %Q*: BOOL:= TRUE;]]>
</Comment>
<Type>BOOL</Type>
</Var>
</Vars>
<TaskPouOids>
<TaskPouOid Prio="20" OTCID="#x08502041"/>
+48 -5
View File
@@ -70,12 +70,12 @@ VAR
(******Error Handling********)
fbErrorList: FB_ErrorList;
// fbEL3214: EL3214;
//fbEL1808: EL1808;
//fbEL3214: EL3214;
fbEL1808: EL1808;
//fbEL2819: EL2819;
//fbEL9410: EL9410;
(*******New and specific related variables*********)
(*******New and specific application variables*********)
END_VAR
@@ -1787,12 +1787,45 @@ ERROR();]]></ST>
</Action>
<Action Name="ERROR" Id="{35f2cf38-f81e-4aa3-9534-be5fb417817d}">
<Implementation>
<ST><![CDATA[]]></ST>
<ST><![CDATA[//
(****FB containting the log of the errors****)
//
fbErrorList(
En:= TRUE,
bReset:= ,
lErrorID:= ,
bACK:= ,
EnO=> ,
nNoError=> ,
nNoOverflow=> ,
pErrorSystem=> );
(*call all the necessary instance (input assistance F2 or right click) according to the terminals that you have in your hardware and
add "TRUE" in the input En, the corresponding number of termianl to the iTerminal_ID and
the variable "fbErrorList.pErrorSystem" to the input ErrorSystem in each FB E. g. :
fbEL1808(
En:= TRUE,
iTerminal_ID:= 1,
ErrorSystem:= fbErrorList.pErrorSystem,
EnO=> ,
bDi_1=> ,
bDi_2=> ,
bDi_3=> ,
bDi_4=> ,
bDi_5=> ,
bDi_6=> ,
bDi_7=> ,
bDi_8=> ,
bError=> ); *)
//
]]></ST>
</Implementation>
</Action>
<Action Name="PROG" Id="{5d03ebbb-2a47-4890-ad6d-e82daf72dc51}">
<Implementation>
<ST><![CDATA[]]></ST>
<ST><![CDATA[//
(* Program any sequence, safety or feature (if necessary) application specific in thsi section*)
//]]></ST>
</Implementation>
</Action>
<LineIds Name="MAIN">
@@ -1800,10 +1833,20 @@ ERROR();]]></ST>
<LineId Id="81" Count="1" />
</LineIds>
<LineIds Name="MAIN.ERROR">
<LineId Id="31" Count="0" />
<LineId Id="10" Count="1" />
<LineId Id="2" Count="7" />
<LineId Id="1" Count="0" />
<LineId Id="12" Count="1" />
<LineId Id="29" Count="1" />
<LineId Id="16" Count="12" />
<LineId Id="14" Count="0" />
<LineId Id="32" Count="1" />
</LineIds>
<LineIds Name="MAIN.PROG">
<LineId Id="2" Count="0" />
<LineId Id="1" Count="0" />
<LineId Id="3" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
@@ -242,6 +242,10 @@
<SystemLibrary>true</SystemLibrary>
<ResolverGuid>2717eb6a-dd07-4c66-8d8d-cacebd7b18ae</ResolverGuid>
</PlaceholderReference>
<PlaceholderReference Include="Tc2_EtherCAT">
<DefaultResolution>Tc2_EtherCAT, * (Beckhoff Automation GmbH)</DefaultResolution>
<Namespace>Tc2_EtherCAT</Namespace>
</PlaceholderReference>
<PlaceholderReference Include="Tc2_MC2">
<DefaultResolution>Tc2_MC2, * (Beckhoff Automation GmbH)</DefaultResolution>
<Namespace>Tc2_MC2</Namespace>