getObjectAt
Short summary
This method returns the object at the given index. Returned objects can be modified, but not replaced! To replace an object use replaceObjectAt. Example: A list of: 1 2 3 after list.getObjectAt(1) will return: object=>2 and return SingleExecutionResult.SUCCESS Example 2: A list of: 1 2 3 after list.getObjectAt(3) will return: object=>NULL and return SingleExecutionResult.ERROR
Return: SingleExecutionResult.SUCCESS: index was valid
SingleExecutionResult.ERROR: index was not valid, returned object is undefined
- Return type: CNM_ReturnTypes.SingleExecutionResult
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| index | UDINT | the index to access the object from | input |
| object | CNM_AbstractObject.IObject | the object at the given index | output |
Code
Declaration
METHOD getObjectAt :CNM_ReturnTypes.SingleExecutionResult
VAR_INPUT
(*the index to access the object from*)
index :UDINT;
END_VAR
VAR_OUTPUT
(*the object at the given index*)
object :CNM_AbstractObject.IObject;
END_VAR