Files
infineon_plc/PLC/LibraryCandidates/PackML/POUs/FB_PackMLGeneric.TcPOU

755 lines
24 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<POU Name="FB_PackMLGeneric" Id="{f562a10e-01bc-407d-9fc0-2837d13c10b1}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_PackMLGeneric
VAR_INPUT
stCommand : ST_PMLc;
stPackMLHMIInterface : REFERENCE TO ST_HMI_PackML;
END_VAR
VAR_OUTPUT
// Unit status
stStatus : ST_PMLs;
// Admin data
stAdmin : ST_PMLa;
END_VAR
VAR
// State machine handler
_fbStateMachine : FB_PackMLStateMachine;
// State machine config
_stSMConfig : ST_PackMLStateMachineConfig;
// Internal unit command
_eCmd : E_PackMLCmd;
// Internal unit mode
_eMode : E_PackMLUnitMode;
// Last state
_eLastState : E_PackMLState;
// Current recipe
_stRecipe : ST_PackMLRecipe;
// Trigger for new command
_rtChangeCmdRequest : R_TRIG;
// Trigger for new mode
_rtChangeModeRequest : R_TRIG;
// Trigger change recipe
_rtChangeRecipeRequest : R_TRIG;
// Internal PackMLs buffer
_stStatus : ST_PMLs;
// State state machine variable
_iSSM : INT := 0;
// Internal manual mode release flag when changed to manual mode
_xReleaseManualMode : BOOL;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[A_HandleHMIInput();
// Handle command change request
_rtChangeCmdRequest(CLK:= stCommand.xCmdChangeRequest);
IF _rtChangeCmdRequest.Q THEN
_eCmd := stCommand.eCntrlCmd;
END_IF
// Handle mode change request
_rtChangeModeRequest(CLK := stCommand.xUnitModeChangeRequest);
IF _rtChangeModeRequest.Q THEN
_eMode := stCommand.eUnitMode;
END_IF
// Handle recipe change rewuest
_rtChangeRecipeRequest(CLK := stCommand.xRecipeChangeRequest);
IF _rtChangeRecipeRequest.Q THEN
_stRecipe := stCommand.astRecipe[stCommand.diSelectedRecipe];
END_IF
// Call PackML state machine handler
_fbStateMachine(
eMode:= _eMode,
eCmd:= _eCmd,
stConfig := _stSMConfig,
eState=> _stStatus.eStateCurrent,
eCurrentMode => _stStatus.eUnitModeCurrent,
xError=> );
// Reset state state machine
IF _eLastState <> _stStatus.eStateCurrent THEN
_iSSM := 0;
_eLastState := _stStatus.eStateCurrent;
END_IF
// Set release manual mode flag when we are in manual mode
_xReleaseManualMode := (_stStatus.eUnitModeCurrent = E_PackMLUnitMode.MANUAL);
// Call state method according to current state
CASE _stStatus.eStateCurrent OF
E_PackMLState.CLEARING:
M_Clearing();
E_PackMLState.STOPPED:
M_Stopped();
E_PackMLState.STARTING:
M_Starting();
E_PackMLState.IDLE:
M_Idle();
E_PackMLState.SUSPENDED:
M_Suspended();
E_PackMLState.EXECUTE:
M_Execute();
E_PackMLState.STOPPING:
M_Stopping();
E_PackMLState.ABORTING:
M_Aborting();
E_PackMLState.ABORTED:
M_Aborted();
E_PackMLState.HOLDING:
M_Holding();
E_PackMLState.HELD:
M_Held();
E_PackMLState.UNHOLDING:
M_Unholding();
E_PackMLState.SUSPENDING:
M_Suspending();
E_PackMLState.UNSUSPENDING:
M_Unsuspending();
E_PackMLState.RESETTING:
M_Resetting();
E_PackMLState.COMPLETING:
M_Completing();
E_PackMLState.COMPLETED:
M_Completed();
ELSE
;
END_CASE
A_HandleHMIOutput();
// Copy ouput buffers
stStatus := _stStatus;]]></ST>
</Implementation>
<Folder Name="Commands" Id="{11740802-7551-418d-83f3-5b2d5c93c299}" />
<Folder Name="Properties" Id="{71c1b935-7017-4f1f-b047-e556465667b8}" />
<Folder Name="States" Id="{2cf25144-1e5c-4db8-ba57-9d98461c53ce}" />
<Action Name="A_HandleHMIInput" Id="{723844ed-d531-4820-b577-cf5a7662c8f5}">
<Implementation>
<ST><![CDATA[// Check for valid hmi interface reference
IF (NOT __ISVALIDREF(stPackMLHMIInterface)) THEN
RETURN;
END_IF
// Handle manual mode button
IF stPackMLHMIInterface.stBtnManualMode.xRequest THEN
stPackMLHMIInterface.stBtnManualMode.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnManualMode.xRelease THEN
M_ChangeToManual();
END_IF
END_IF
// Handle production mode button
IF stPackMLHMIInterface.stBtnProdMode.xRequest THEN
stPackMLHMIInterface.stBtnProdMode.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnProdMode.xRelease THEN
M_ChangeToProd();
END_IF
END_IF
// Handle clear button
IF stPackMLHMIInterface.stBtnClear.xRequest THEN
stPackMLHMIInterface.stBtnClear.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnClear.xRelease THEN
M_CmdClear();
END_IF
END_IF
// Handle reset button
IF stPackMLHMIInterface.stBtnReset.xRequest THEN
stPackMLHMIInterface.stBtnReset.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnReset.xRelease THEN
M_CmdReset();
END_IF
END_IF
// Handle start button
IF stPackMLHMIInterface.stBtnStart.xRequest THEN
stPackMLHMIInterface.stBtnStart.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnStart.xRelease THEN
M_CmdStart();
END_IF
END_IF
// Handle abort button
IF stPackMLHMIInterface.stBtnAbort.xRequest THEN
stPackMLHMIInterface.stBtnAbort.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnAbort.xRelease THEN
M_CmdAbort();
END_IF
END_IF
// Handle hold button
IF stPackMLHMIInterface.stBtnHold.xRequest THEN
stPackMLHMIInterface.stBtnHold.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnHold.xRelease THEN
M_CmdHold();
END_IF
END_IF
// Handle stop button
IF stPackMLHMIInterface.stBtnStop.xRequest THEN
stPackMLHMIInterface.stBtnStop.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnStop.xRelease THEN
M_CmdStop();
END_IF
END_IF
// Handle suspend button
IF stPackMLHMIInterface.stBtnSuspend.xRequest THEN
stPackMLHMIInterface.stBtnSuspend.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnSuspend.xRelease THEN
M_CmdSuspend();
END_IF
END_IF
// Handle unhold button
IF stPackMLHMIInterface.stBtnUnhold.xRequest THEN
stPackMLHMIInterface.stBtnUnhold.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnUnhold.xRelease THEN
M_CmdUnhold();
END_IF
END_IF
// Handle unsuspend button
IF stPackMLHMIInterface.stBtnUnsuspend.xRequest THEN
stPackMLHMIInterface.stBtnUnsuspend.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnUnsuspend.xRelease THEN
M_CmdUnsuspend();
END_IF
END_IF
// Handle complete button
IF stPackMLHMIInterface.stBtnComplete.xRequest THEN
stPackMLHMIInterface.stBtnComplete.xRequest := FALSE;
IF stPackMLHMIInterface.stBtnComplete.xRelease THEN
M_CmdComplete();
END_IF
END_IF]]></ST>
</Implementation>
</Action>
<Action Name="A_HandleHMIOutput" Id="{73c47dbe-0382-4e83-8c9e-e4744dd66394}">
<Implementation>
<ST><![CDATA[// Check for valid hmi interface reference
IF (NOT __ISVALIDREF(stPackMLHMIInterface)) THEN
RETURN;
END_IF
// Handle manual mode button
stPackMLHMIInterface.stBtnManualMode.xRelease := (_stStatus.eStateCurrent = E_PackMLState.STOPPED) OR (_stStatus.eStateCurrent = E_PackMLState.ABORTED);
IF _stStatus.eUnitModeCurrent = E_PackMLUnitMode.MANUAL THEN
stPackMLHMIInterface.stBtnManualMode.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnManualMode.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle production mode button
stPackMLHMIInterface.stBtnProdMode.xRelease := (_stStatus.eStateCurrent = E_PackMLState.STOPPED) OR (_stStatus.eStateCurrent = E_PackMLState.ABORTED);
IF _stStatus.eUnitModeCurrent = E_PackMLUnitMode.PRODUCTION THEN
stPackMLHMIInterface.stBtnProdMode.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnProdMode.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle clear button
stPackMLHMIInterface.stBtnClear.xRelease := (_stStatus.eStateCurrent = E_PackMLState.ABORTED);
IF _stStatus.eStateCurrent = E_PackMLState.CLEARING THEN
stPackMLHMIInterface.stBtnClear.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnClear.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle reset button
stPackMLHMIInterface.stBtnReset.xRelease := (_stStatus.eStateCurrent = E_PackMLState.STOPPED) OR (_stStatus.eStateCurrent = E_PackMLState.COMPLETED);
IF _stStatus.eStateCurrent = E_PackMLState.RESETTING THEN
stPackMLHMIInterface.stBtnReset.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnReset.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle start button
stPackMLHMIInterface.stBtnStart.xRelease := (_stStatus.eStateCurrent = E_PackMLState.IDLE);
IF _stStatus.eStateCurrent = E_PackMLState.STARTING THEN
stPackMLHMIInterface.stBtnStart.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnStart.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle abort button
stPackMLHMIInterface.stBtnAbort.xRelease := (_stStatus.eStateCurrent <> E_PackMLState.ABORTED) AND (_stStatus.eStateCurrent <> E_PackMLState.ABORTING);
IF _stStatus.eStateCurrent = E_PackMLState.ABORTING THEN
stPackMLHMIInterface.stBtnAbort.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnAbort.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle hold button
stPackMLHMIInterface.stBtnHold.xRelease := (_stStatus.eStateCurrent = E_PackMLState.EXECUTE) OR (_stStatus.eStateCurrent = E_PackMLState.SUSPENDED);
IF _stStatus.eStateCurrent = E_PackMLState.HOLDING THEN
stPackMLHMIInterface.stBtnHold.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnHold.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle stop button
stPackMLHMIInterface.stBtnStop.xRelease := (_stStatus.eStateCurrent <> E_PackMLState.ABORTED)
AND (_stStatus.eStateCurrent <> E_PackMLState.ABORTING)
AND (_stStatus.eStateCurrent <> E_PackMLState.CLEARING)
AND (_stStatus.eStateCurrent <> E_PackMLState.STOPPING)
AND (_stStatus.eStateCurrent <> E_PackMLState.STOPPED);
IF _stStatus.eStateCurrent = E_PackMLState.STOPPING THEN
stPackMLHMIInterface.stBtnStop.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnStop.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle suspend button
stPackMLHMIInterface.stBtnSuspend.xRelease := (_stStatus.eStateCurrent = E_PackMLState.EXECUTE);
IF _stStatus.eStateCurrent = E_PackMLState.SUSPENDING THEN
stPackMLHMIInterface.stBtnSuspend.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnSuspend.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle unhold button
stPackMLHMIInterface.stBtnUnhold.xRelease := (_stStatus.eStateCurrent = E_PackMLState.HELD);
IF _stStatus.eStateCurrent = E_PackMLState.UNHOLDING THEN
stPackMLHMIInterface.stBtnUnhold.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnUnhold.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle unsuspend button
stPackMLHMIInterface.stBtnUnsuspend.xRelease := (_stStatus.eStateCurrent = E_PackMLState.SUSPENDED);
IF _stStatus.eStateCurrent = E_PackMLState.UNSUSPENDING THEN
stPackMLHMIInterface.stBtnUnsuspend.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnUnsuspend.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Handle complete button
stPackMLHMIInterface.stBtnComplete.xRelease := (_stStatus.eStateCurrent = E_PackMLState.EXECUTE) OR (_stStatus.eStateCurrent = E_PackMLState.HELD) OR (_stStatus.eStateCurrent = E_PackMLState.SUSPENDED);
IF _stStatus.eStateCurrent = E_PackMLState.UNSUSPENDING THEN
stPackMLHMIInterface.stBtnComplete.eFeedback := E_HMI_BUTTON_FEEDBACK.ACTIVE;
ELSE
stPackMLHMIInterface.stBtnComplete.eFeedback := E_HMI_BUTTON_FEEDBACK.NONE;
END_IF
// Copy mode and state
stPackMLHMIInterface.eCurrentMode := _eMode;
stPackMLHMIInterface.eCurrentState := _stStatus.eStateCurrent;]]></ST>
</Implementation>
</Action>
<Method Name="M_Aborted" Id="{db1a684f-e4e1-4d89-a3aa-9b9dfde0508c}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Aborted
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
</Method>
<Method Name="M_Aborting" Id="{928ad614-a3a7-4c6c-b1bc-55ae54e4c95f}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Aborting
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_ChangeToManual" Id="{c8cc7ed4-1875-4691-b0ed-83c905e5b965}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_ChangeToManual : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF (_stStatus.eStateCurrent = E_PackMLState.STOPPED) OR (_stStatus.eStateCurrent = E_PackMLState.ABORTED) THEN
_eMode := E_PackMLUnitMode.MANUAL;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_ChangeToProd" Id="{84f37ed0-0634-44e0-9515-b7938cb81a06}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_ChangeToProd : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF (_stStatus.eStateCurrent = E_PackMLState.STOPPED) OR (_stStatus.eStateCurrent = E_PackMLState.ABORTED) THEN
_eMode := E_PackMLUnitMode.PRODUCTION;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_Clearing" Id="{1716cf1b-94c6-4995-8b3f-c7ebcf5727d3}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Clearing
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdAbort" Id="{a8ac7d94-0639-4bcc-b083-994135ce6951}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdAbort : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF (_stStatus.eStateCurrent <> E_PackMLState.ABORTED) AND (_stStatus.eStateCurrent <> E_PackMLState.ABORTING) THEN
_eCmd := E_PackMLCmd.ABORT;
M_CmdAbort := TRUE;
ELSE
M_CmdAbort := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdClear" Id="{1ae1174f-acb8-4f8a-bc73-ec233f6637b2}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdClear : BOOL
]]></Declaration>
<Implementation>
<ST><![CDATA[IF _stStatus.eStateCurrent = E_PackMLState.ABORTED THEN
_eCmd := E_PackMLCmd.CLEAR;
M_CmdClear := TRUE;
ELSE
M_CmdClear := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdComplete" Id="{16a08ace-9746-4725-a582-2dedce5a799a}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdComplete : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF _stStatus.eStateCurrent = E_PackMLState.EXECUTE THEN
_eCmd := E_PackMLCmd.COMPLETE;
M_CmdComplete := TRUE;
ELSE
M_CmdComplete := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdHold" Id="{63908543-c84a-46a6-803b-0cd0a69ee040}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdHold : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF (_stStatus.eStateCurrent = E_PackMLState.EXECUTE) OR (_stStatus.eStateCurrent = E_PackMLState.SUSPENDED) THEN
_eCmd := E_PackMLCmd.HOLD;
M_CmdHold := TRUE;
ELSE
M_CmdHold := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdReset" Id="{9acdfbad-6477-4a07-aac5-b9a102467964}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdReset : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF (_stStatus.eStateCurrent = E_PackMLState.STOPPED) OR (_stStatus.eStateCurrent = E_PackMLState.COMPLETED) THEN
_eCmd := E_PackMLCmd.RESET;
M_CmdReset := TRUE;
ELSE
M_CmdReset := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdStart" Id="{86eb6432-588a-4480-b09e-72e5733dc716}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdStart : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF _stStatus.eStateCurrent = E_PackMLState.IDLE THEN
_eCmd := E_PackMLCmd.START;
M_CmdStart := TRUE;
ELSE
M_CmdStart := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdStop" Id="{8beef0bf-5aa2-4644-ae54-6acbcdaacef4}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdStop : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF (_stStatus.eStateCurrent <> E_PackMLState.ABORTED)
AND (_stStatus.eStateCurrent <> E_PackMLState.ABORTING)
AND (_stStatus.eStateCurrent <> E_PackMLState.CLEARING)
AND (_stStatus.eStateCurrent <> E_PackMLState.STOPPING)
AND (_stStatus.eStateCurrent <> E_PackMLState.STOPPED)
THEN
_eCmd := E_PackMLCmd.STOP;
M_CmdStop := TRUE;
ELSE
M_CmdStop := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdSuspend" Id="{a69941cd-31ee-44b4-9c8b-a7c774e40447}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdSuspend : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF _stStatus.eStateCurrent = E_PackMLState.EXECUTE THEN
_eCmd := E_PackMLCmd.SUSPEND;
M_CmdSuspend := TRUE;
ELSE
M_CmdSuspend := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdUnhold" Id="{6af8dbfd-0422-459a-b99f-09e9246d2621}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdUnhold : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF (_stStatus.eStateCurrent = E_PackMLState.HELD) THEN
_eCmd := E_PackMLCmd.UNSUSPEND;
M_CmdUnhold := TRUE;
ELSE
M_CmdUnhold := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_CmdUnsuspend" Id="{ff6f4f4b-4bc6-47f7-a257-a2bcea2d6ae3}" FolderPath="Commands\">
<Declaration><![CDATA[METHOD M_CmdUnsuspend : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF (_stStatus.eStateCurrent = E_PackMLState.SUSPENDED) THEN
_eCmd := E_PackMLCmd.UNSUSPEND;
M_CmdUnsuspend := TRUE;
ELSE
M_CmdUnsuspend := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_Completed" Id="{33df5dea-d83b-48e1-8898-d7c8e1f031bd}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Completed : BOOL
]]></Declaration>
<Implementation>
<ST><![CDATA[IF _stStatus.eStateCurrent = E_PackMLState.EXECUTE THEN
_eCmd := E_PackMLCmd.COMPLETE;
M_Completed := TRUE;
ELSE
M_Completed := FALSE;
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="M_Completing" Id="{341608cb-1218-481f-929c-cb79602c11ab}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Completing
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_Execute" Id="{2a469169-0eb2-43c9-be21-48909285ee44}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Execute
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_Held" Id="{05b040b0-b1b9-4afd-81d0-88fc1f1a7f9b}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Held
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
</Method>
<Method Name="M_Holding" Id="{519b03b3-2409-4b45-818f-535b3e16b22e}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Holding
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_Idle" Id="{aa784f5c-7adf-4c9f-a414-65b10afd2772}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Idle
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
</Method>
<Method Name="M_Resetting" Id="{4050ed6f-edbe-4c3e-ac42-919a37a47ea9}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Resetting
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_Starting" Id="{0059e7f6-5f2a-40e4-9d9b-652f221495a9}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Starting
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_StateComplete" Id="{0cf3625e-8009-4108-a9f4-d98c991f9930}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_StateComplete
]]></Declaration>
<Implementation>
<ST><![CDATA[// Reset state state machine
_iSSM := 0;
// Call state change in PackML state manager
_fbStateMachine.M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_Stopped" Id="{9f8a09cf-f3be-4d60-b5e4-cd9572fae88c}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Stopped
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
</Method>
<Method Name="M_Stopping" Id="{193565ef-cf20-428c-b726-e7c1b61375c5}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Stopping
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_Suspended" Id="{222c3ad7-f7d5-4773-8e98-863345472053}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Suspended
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
</Method>
<Method Name="M_Suspending" Id="{0f5d52e2-2a54-4ea9-a0c4-7f08229c4f21}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Suspending
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_Unholding" Id="{662dd054-329b-4e57-ba77-486f92af795a}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Unholding
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Method Name="M_Unsuspending" Id="{80fb11c4-916a-4f8f-9cf9-b9a2d51524a1}" FolderPath="States\">
<Declaration><![CDATA[METHOD PROTECTED M_Unsuspending
]]></Declaration>
<Implementation>
<ST><![CDATA[M_StateComplete();]]></ST>
</Implementation>
</Method>
<Property Name="P_IsAborting" Id="{2b0946af-b14d-4d2e-990d-b07d1895ea11}" FolderPath="Properties\">
<Declaration><![CDATA[PROPERTY PUBLIC P_IsAborting : BOOL]]></Declaration>
<Get Name="Get" Id="{70c3f60f-0f05-4a00-a64d-b39e6fe8aed2}">
<Declaration><![CDATA[VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF _stStatus.eStateCurrent = E_PackMLState.ABORTING THEN
P_IsAborting := TRUE;
ELSE
P_IsAborting := FALSE;
END_IF]]></ST>
</Implementation>
</Get>
</Property>
<Property Name="P_IsClearing" Id="{944646f8-7122-4c20-a9f8-47665b03c3a6}" FolderPath="Properties\">
<Declaration><![CDATA[PROPERTY PUBLIC P_IsClearing : BOOL]]></Declaration>
<Get Name="Get" Id="{a9daac25-4395-40d2-b9b1-1febd61f0c04}">
<Declaration><![CDATA[VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF _stStatus.eStateCurrent = E_PackMLState.CLEARING THEN
P_IsClearing := TRUE;
ELSE
P_IsClearing := FALSE;
END_IF]]></ST>
</Implementation>
</Get>
</Property>
<Property Name="P_IsResetting" Id="{87063e57-8128-494e-93a1-c43385c51aa1}" FolderPath="Properties\">
<Declaration><![CDATA[PROPERTY PUBLIC P_IsResetting : BOOL]]></Declaration>
<Get Name="Get" Id="{0dce300e-62cf-49c8-a396-770e6fb91489}">
<Declaration><![CDATA[VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF _stStatus.eStateCurrent = E_PackMLState.RESETTING THEN
P_IsResetting := TRUE;
ELSE
P_IsResetting := FALSE;
END_IF]]></ST>
</Implementation>
</Get>
</Property>
<Property Name="P_IsStopping" Id="{46829e26-3c3f-4a9e-ad8b-51b2c66f4c40}" FolderPath="Properties\">
<Declaration><![CDATA[PROPERTY PUBLIC P_IsStopping : BOOL]]></Declaration>
<Get Name="Get" Id="{36bdb17b-1165-46ad-8819-9201a1893683}">
<Declaration><![CDATA[VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF _stStatus.eStateCurrent = E_PackMLState.STOPPING THEN
P_IsStopping := TRUE;
ELSE
P_IsStopping := FALSE;
END_IF]]></ST>
</Implementation>
</Get>
</Property>
</POU>
</TcPlcObject>