FB_GetAdaptersInfo 1:

This function block can be used to read adapter information for a TwinCAT PC. The maximum number of adapter data that can be read is currently limited to MAX_LOCAL_ADAPTERS + 1 (default = 6).


    sNetID   : T_AmsNetId;
    bExecute : BOOL;

sNetID: This parameter can be used to specify the AmsNetID of the TwinCAT computer whose adapter information is to be read. For the local PC an empty string may be specified (type: T_AmsNetID).

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

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


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

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

bError: In the event of an error during the command transfer, this output is set once the bBusy output has been reset.

nErrID: Supplies the ADS error number when the bError output is set.

arrAdapters: Array variable containing the last read adapter information. Each array element provides information for one adapter (type: ST_IpAdapterInfo).

nCount: Maximum number of local adapters that were found.

nGet: Number of valid entries in the arrAdapters output variable.


Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (WES7/Win7/Win10: TC RT x86/x64, WEC6/7: TC RT x86, WEC7: TC CE7 ARMV7, TC/BSD: TC RT x64)

Tc2_Utilities (System)