Skip to main content

getStateFromStep

Parameters

NameTypeCommentKind
stepDINT-input

Code

Declaration

METHOD PROTECTED getStateFromStep : CNM_ReturnTypes.SingleExecutionState
VAR_INPUT
step :DINT;
END_VAR

Implementation

CASE step OF
STEP_ABORT:
getStateFromStep := CNM_ReturnTypes.SingleExecutionState.ABORTED;
STEP_ERROR:
getStateFromStep := CNM_ReturnTypes.SingleExecutionState.ERROR;
STEP_PAUSE:
getStateFromStep := CNM_ReturnTypes.SingleExecutionState.PAUSED;
STEP_SUCCESS:
getStateFromStep := CNM_ReturnTypes.SingleExecutionState.SUCCESS;
STEP_IDLE:
;
STEP_INIT:
getStateFromStep := CNM_ReturnTypes.SingleExecutionState.BUSY;
ELSE
//sequence is running
getStateFromStep := CNM_ReturnTypes.SingleExecutionState.BUSY;
END_CASE