executeCommand
Short summary
This method performs the given command and evaluates the return value. The command will be called with execute := FALSE in the first cylce and with execute := TRUE in all following
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| command | CNM_CommandInterfaces.ICommand | command to execute | input |
| errorStep | DINT | step to proceed with in case of error | input |
Code
Declaration
METHOD executeCommand
VAR_INPUT
(* command to execute *)
command :CNM_CommandInterfaces.ICommand;
(* step to proceed with in case of error *)
errorStep :DINT := CNM_ReturnTypes.DefaultSteps.STEP.ERROR;
END_VAR
Implementation
THIS^.registeredCommand := TRUE;
IF(THIS^.isObjectNull(command))THEN
THIS^.evaluate(CNM_ReturnTypes.SingleExecutionState.ERROR, errorStep);
ELSE
THIS^.evaluate(command.executeCommand(THIS^.executeStep), errorStep);
END_IF