Skip to main content

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

NameTypeCommentKind
commandCNM_CommandInterfaces.ICommandcommand to executeinput
errorStepDINTstep to proceed with in case of errorinput

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