executeCommand
Short summary
Executes the action associated with this command.
- Return type: CNM_ReturnTypes.SingleExecutionState
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| execute | BOOL | control bit to start or abort the command | input |
Code
Declaration
METHOD executeCommand : CNM_ReturnTypes.SingleExecutionState
VAR_INPUT
(*control bit to start or abort the command*)
execute : BOOL;
END_VAR
Implementation
THIS^.timer(IN := execute AND (THIS^.waitTime <> T#0S), PT := THIS^.waitTime);
IF(THIS^.timer.Q OR_ELSE THIS^.waitTime = T#0S)THEN
executeCommand := CNM_ReturnTypes.SingleExecutionState.SUCCESS;
ELSE
executeCommand := CNM_ReturnTypes.SingleExecutionState.BUSY;
END_IF