GetRemotePCInfo

GetRemotePCInfo 1:

The function block "GetRemotePCInfo" permits information about configured remote PCs in the TwinCAT Router to be read. After successful execution, the structure "RemotePCInfo" contains the NetIds and names of the remote PCs as strings, in the same sequence as that in which they are stored in the TwinCAT Router. Internally, an instance of the ADSREAD function block is called. The function block allows router information relating to either a local or to a remote TwinCAT system to be read.

 VAR_INPUT

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

NETID: The AmsNetId of the TwinCAT computer whose router information about configured remote PCs is to be read can be given here. If the remote PCs of the local TwinCAT system are to be found, it is also possible to enter an empty string.

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

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

VAR_OUTPUT

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

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

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

ERRID: Supplies the ADS error number when the ERR output is set.

RemotePCInfo: Structure containing information about the configured remote PCs.

 

Example of a call in FBD:

PROGRAM MAIN
VAR
    GetRemotePCInfo1    : GetRemotePCInfo;
    RemotePCInfo        : REMOTEPCINFOSTRUCT;

    bBusy       : BOOL;
    bError      : BOOL;
    iErrorId        : UDINT;
    bStart      : BOOL;
END_VAR

 

 

GetRemotePCInfo 2:

 

Online View:

The NetIds and names of the configured remote PCs.

GetRemotePCInfo 3:

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v2.7.0

PC or CX (x86)

Standard.Lib; PLCSystem.Lib; TcPLCAds.Lib; PLCHelper.Lib; TcPlcUtilities.Lib

TwinCAT v2.8.0

PC or CX (x86)

TcUtilities.Lib

( Standard.Lib; TcBase.Lib; TcSystem.Lib are included automatically )

TwinCAT v2.10.0 Build >= 1301

CX (ARM)