FB_RemoveRouteEntry

FB_RemoveRouteEntry 1:

The function block can be used to delete an existing connection to a TwinCAT system from the list of AMS router connections (remote routes).

FB_RemoveRouteEntry 2: Inputs

VAR_INPUT
    sNetID    : T_AmsNetId;
    sName     : String (MAX_ROUTE_NAME_LEN);
    bExecute  : BOOL;
    tTimeout  : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR

Name

Type

Description

sNetID

T_AmsNetID

The network address of the TwinCAT computer on which the AMS router connection is to be deleted can be specified here. For the local computer an empty string may be specified.

sName

STRING

Name of the connection to be deleted. The maximum string length is limited by a constant (default: 31 characters).

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.

FB_RemoveRouteEntry 3: Outputs

VAR_OUTPUT
    bBusy    : BOOL;
    bError   : BOOL;
    nErrID   : 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.

Example:

The connection with the name "TEST" is to be deleted from the list of AMS router connections on the local TwinCAT system. The connection is deleted if a rising edge is detected at the bExecute variable.

PROGRAM P_TEST2
VAR
    fbRemoveRoute  : FB_RemoveRouteEntry;
    bExecute       : BOOL;
    bBusy          : BOOL;
    bError         : BOOL;
    nErrID         : UDINT;
END_VAR

FB_RemoveRouteEntry 4:

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)