FB_GetAdaptersInfo

FB_GetAdaptersInfo 1:

The function block retrieves adapter information for the local or remote TwinCAT computer. The max. number of read adapter information is limited to MAX_LOCAL_ADAPTERS + 1 (default = 6).

 VAR_INPUT

VAR_INPUT
    sNetID   : T_AmsNetId;
    bExecute : BOOL;
    tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR

sNetID: It is possible here to provide the network address of the TwinCAT computer on which the local adapter info should be read. The string can also be empty for the local computer.

bExecute: The function block is activated by a positive edge at this input.

tTimeout: States the length of the timeout that may not be exceeded by execution of the command.

VAR_OUTPUT

VAR_OUTPUT
    bBusy       : BOOL;
    bError      : BOOL;
    nErrID      : UDINT;
    arrAdapters : ARRAY[0..MAX_LOCAL_ADAPTERS] OF ST_IpAdapterInfo;
    nCount      : UDINT;
    nGet        : UDINT;
END_VAR

bBusy: When the function block is activated this output is set. It remains set until and acknowledgement is received.

bError: If an error should occur during the execution of the command, then this output is set, after the bBusy output has been reset. 

nErrID: When the bError output is set, this variable supplies the ADS error code.

arrAdapters: Array variable with adapter information.

nCount: Max. number of found adapters.

nGet: Number of read adapter info entries.

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v2.10.0 Build > 1307

PC or CX (x86)
CX (ARM)

TcUtilities.Lib