Skip to main content

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

Parameters

NameTypeCommentKind
executeBOOLIndicates if the iteration should be executed or resettedinput
objectCNM_AbstractObject.IObjectThe current Object of the Iterationoutput

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