GetRemotePCInfo

GetRemotePCInfo 1:

The function block GetRemotePCInfo can be used to read information about configured remote PCs in the TwinCAT router. After successful execution the structure "RemotePCInfo" contains the NetIDs and names of the remote PCs as strings in the order in which they were stored in the TwinCAT router. The function block allows router information relating to either a local or to a remote TwinCAT system to be read.

GetRemotePCInfo 2: Inputs

VAR_INPUT
    NETID  : T_AmsNetId;
    START  : BOOL;
    TMOUT  : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR

Name

Type

Description

NETID

T_AmsNetID

The network address of the TwinCAT computer whose router information is to be read via configured remote PCs can be specified here. To determine the remote PCs of the local TwinCAT system, an empty string can be specified.

START

BOOL

The function block is enabled by a positive edge at this input.

TMOUT

TIME

Time-out period that may not be exceeded when executing the ADS command.

GetRemotePCInfo 3: Outputs

VAR_OUTPUT
    BUSY         : BOOL;
    ERR          : BOOL;
    ERRID        : UDINT;
    RemotePCInfo : REMOTEPCINFOSTRUCT;
END_VAR

Name

Type

Description

BUSY

BOOL

When the function block is enabled, this output is set and remains set until a feedback is received.

ERR

BOOL

If an error should occur during the transfer of the command, then this output is set once the BUSY output was reset.

ERRID

ADS error number

Returns the error code, if the ERR output is set.

RemotePCInfo

REMOTEPCINFOSTRUCT

Structure containing information about the configured remote PCs.

Example:

PROGRAM MAIN
VAR
    GetRemotePCInfo1     : GetRemotePCInfo;
    RemotePCInfo         : REMOTEPCINFOSTRUCT;
    bBusy                : BOOL;
    bError               : BOOL;
    iErrorId             : UDINT;
    bStart               : BOOL;
END_VAR
GetRemotePCInfo 4:

Online View:

NetIDs and names of the configured remote PCs.

GetRemotePCInfo 5:

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_Utilities (System)