handle
Short summary
This method throws an alarm and waits for it to be confirmed. When the alarm was confirmed the cyclemanager will proceed to next configured step. If the current step is the result of an evaulated error state and the input 'resumeWithLastStep' is set to true, the cyclemanager will proceed to the last step. ..warning: The 'resumeWithLastStep' flag will be ignored if the last step was successful.
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| alarm | CNM_MessageInterfaces.IAlarm | the alarm event that should be thrown | input |
| resumeWithLastStep | BOOL | if this flag is set AND we got to the current step because of an ERROR state, then the cyclemanager will automatically will go back to the last step | input |
Code
Declaration
METHOD handle
VAR_INPUT
(* the alarm event that should be thrown *)
alarm :CNM_MessageInterfaces.IAlarm;
(* if this flag is set AND we got to the current step because of an ERROR state, then the cyclemanager will automatically will go back to the last step *)
resumeWithLastStep :BOOL := TRUE;
END_VAR
Implementation
IF(NOT THIS^.executeStep)THEN
alarm.throw();
ELSIF(NOT alarm.isPending)THEN
IF(resumeWithLastStep AND_THEN THIS^.gotHereByError)THEN
THIS^.acknowledge();
ELSE
THIS^.evaluate(state := CNM_ReturnTypes.SingleExecutionState.SUCCESS);
END_IF
END_IF