iterate
Short summary
This method returns the next object in the iteration and returns an execution state. Example: You have a list: 1 2 3 the first iterate call will return CNM_ReturnTypes.BUSY and object = 1 the second iterate call will return CNM_ReturnTypes.BUSY and object = 2 the third iterate call will return CNM_ReturnTypes.BUSY and object = 3 the fourth iterate call will return CNM_ReturnTypes.SUCCESS and object = null;
Return: SUCCESS: if last object from collection was already returned,
ABORTED: execute has a falling edge during iterate,
BUSY: When iterate had rising edge on execute and not all objects had been returned yet,
IDLE: iterate wasn't started yet,
ERROR: error occured during iteration
- Return type: CNM_ReturnTypes.SingleExecutionState
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| execute | BOOL | Indicates if the iteration should be executed or resetted | input |
| object | CNM_AbstractObject.IObject | The current Object of the Iteration | output |
Code
Declaration
METHOD PROTECTED ABSTRACT iterate :CNM_ReturnTypes.SingleExecutionState
VAR_INPUT
(*Indicates if the iteration should be executed or resetted*)
execute :BOOL;
END_VAR
VAR_OUTPUT
(*The current Object of the Iteration*)
object :CNM_AbstractObject.IObject;
END_VAR