FB_GetAdaptersInfo
This function block can be used to read adapter information for a TwinCAT PC. The maximum number of adapter information that can be read is currently limited to MAX_LOCAL_ADAPTERS + 1 (default = 6).
Inputs
VAR_INPUT
sNetID : T_AmsNetID;
bExecute : BOOL;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
Name | Type | Description |
---|---|---|
sNetID | T_AmsNetID | A string with the network address of the TwinCAT computer whose adapter information is to be read can be specified here. For the local computer an empty string may be specified. |
bExecute | BOOL | The function block is enabled by a positive edge at this input. |
tTimeout | TIME | States the length of the timeout that may not be exceeded by execution of the ADS command. |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrID : UDINT;
arrAdapters : ARRAY[0..MAX_LOCAL_ADAPTERS] OF ST_IpAdapterInfo;
nCount : UDINT;
nGet : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
bBusy | BOOL | When the function block is enabled, this output is set and remains set until a feedback is received. |
bError | BOOL | If an error occurs during the transmission of the command, this output is set after the bBusy output is reset. |
nErrID | UDINT | Returns the ADS error number when the bError output is set. |
arrAdapters | ARRAY OF ST_IpAdapterInfo | Array variable containing the last read adapter information. Each array element returns information for an adapter. |
nCount | UDINT | Maximum number of local adapters that were found. |
nGet | UDINT | Number of valid entries in the arrAdapters output variable. |
Requirements
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) |