Skip to main content

handleStepChange

Short summary

This method handles the step change, call early in handling.

Parameters

NameTypeCommentKind
stepBOOLmust be TRUE if stepping is enabled to proceed steps automaticallyinput
stopRequestBOOLused for StopRequest evaluation if configuredinput

Code

Declaration

METHOD PROTECTED handleStepChange
VAR_INPUT
(* must be TRUE if stepping is enabled to proceed steps automatically *)
step :BOOL := TRUE;
(*used for StopRequest evaluation if configured*)
stopRequest :BOOL := FALSE;
END_VAR

Implementation

IF THIS^.wasError THEN
THIS^.step.next := THIS^.currentErrorStep;
THIS^.initializeNewStep(TRUE);

ELSIF THIS^.wasTimeoutError THEN
THIS^.step.next := THIS^.currentTimeoutStep;
THIS^.initializeNewStep(TRUE);

ELSIF stopRequest AND (
(THIS^.wasSuccess AND NOT THIS^.wasNotSuccess AND (THIS^.executeStep OR NOT THIS^.isAnyActionRegistered)
AND THIS^.currentStopRequestMode = CNM_CycleManagerInterfaces.StepStopRequestMode.AFTER_SUCCESSFUL_STEP)
OR (THIS^.wasNotSuccess AND (THIS^.executeStep OR NOT THIS^.isAnyActionRegistered)
AND THIS^.currentStopRequestMode = CNM_CycleManagerInterfaces.StepStopRequestMode.ON_BUSY)
OR (THIS^.currentStopRequestMode = CNM_CycleManagerInterfaces.StepStopRequestMode.IMMEDIATE)
) THEN
THIS^.step.next := STEP_SUCCESS;
THIS^.initializeNewStep();

ELSIF THIS^.wasSuccess
AND NOT THIS^.wasNotSuccess
AND (THIS^.executeStep OR NOT THIS^.isAnyActionRegistered)
AND (NOT THIS^.currentSteppingEnabled OR step)
THEN
THIS^.initializeNewStep();
END_IF