RemoveClient

TwinCAT
Network TCP/IP client

ns=2;s=DEPRAG Smart/Network/TCP/IP/RemoveClient

The command terminates the connection of a concrete TCP/IP client and removes it from the ActiveClients list.

Parameters:

    Id
    Unique index with which the TCP/IP client can be retrieved from the "ActiveClients" list.

Returns:

    RemoveClient
    A variable of type OpcMethodReturnValueInt32. The Result property contains the command-specific return values.
      Result
      Unique index with which the TCP/IP client can be retrieved from the "ActiveClients" list.

Examples:

In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:

Beckhoff parameter:

    bTcpIpRemoveClient
    A boolean variable that can be used to trigger the execution of the RemoveClient command.
    OutputDataTcpIpRemoveClient
    An instance of the ST_Int32OutputData structure into which the return value of the RemoveClient method is written.
    hrTcpIpRemoveClient
    This can be used to monitor the execution of the command. Error codes have the type HRESULT.
    fbTcpIp
    An instance of the "FB_TcpIp" function block supplied with the DEPRAG Smart library.
    nDeviceId
    A DINT variable representing the ID of the client to be removed.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
    bTcpIpRemoveClient   : BOOL;
    OutputDataTcpIpRemoveClient : ST_Int32OutputData;
    hrTcpIpRemoveClient   : HRESULT;

    fbTcpIp  : FB_TcpIp;
END_VAR

hrTcpIpRemoveClient := fbTcpIp.RemoveClient(
        bExecute   := bTcpIpRemoveClient, 
        ConnectionHandle := depragSmartConnection.ConnectionHandle, 
        nDeviceId   := 0, 
        OutputData   => OutputDataTcpIpRemoveClient);
IF hrTcpIpRemoveClient <> S_FALSE THEN 
    bTcpIpRemoveClient := FALSE;
END_IF
                                                    

For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".