F_VN_GetContainerExp

F_VN_GetContainerExp 1:

Gets a pointer to the current element converted into an ITcVnContainer interface and increment its reference counter (only possible for container types). Additionally, an offset to increment or decrement the iterator afterwards can be provided. (expert function)

Syntax

Definition:

FUNCTION F_VN_GetContainerExp : HRESULT
VAR_INPUT
    ipIterator  : ITcVnForwardIterator;
    ipContainer : Reference To ITcVnContainer;
    nOffset     : DINT;
    hrPrev      : HRESULT;
END_VAR

F_VN_GetContainerExp 2: Inputs

Name

Type

Description

ipIterator

ITcVnForwardIterator

Iterator

ipContainer

Reference To ITcVnContainer

Returns the container interface

nOffset

DINT

Offset to increment (>0) or decrement (<0) the iterator afterwards

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_GetContainerExp 3: Return value

HRESULT

Further information

The function F_VN_GetContainerExp is the expert version of F_VN_GetContainer. It helps you if, at the same time as accessing a container element by means of an iterator, you also wish to increment this iterator. Set the parameter nOffset to the value 1 for a normal, sequential incrementation:

hr := F_VN_GetContainerExp(ipIterator, ipElement, 1, hr);

With the standard function you would need two function calls for this:

hr := F_VN_GetContainer(ipIterator, ipElement, hr);
hr := F_VN_IncrementIterator(ipIterator, hr);

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision