RemoveClient

TwinCAT
Network REST Client

ns=2;s=DEPRAG Smart/Network/HTTP/REST/RemoveClient

The command terminates the connection of a concrete REST client and removes it from the list of active clients.

Parameters:

    Id
    Unique index that can be used to retrieve the REST client from the "ActiveClients" list.

Returns:

    RemoveClient
    A variable of type OpcMethodReturnValueInt32. The Result property contains the command-specific return values.
      Result
      Unique index that can be used to retrieve the REST client 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:

    bHttpRemoveClient
    A boolean variable that can be used to trigger the execution of the RemoveClient command.
    OutputDataHttpRemoveClient
    An instance of the ST_Int32OutputData structure into which the return value of the RemoveClient method is written.
    hrHttpRemoveClient
    This can be used to monitor the execution of the command. Error codes have the type HRESULT.
    fbHttpRest
    An instance of the "FB_HttpRest" function block supplied with the DEPRAG Smart library.
    ClientId
    A DINT variable specifying the client to be removed.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
    bHttpRemoveClient   : BOOL;
    OutputDataHttpRemoveClient : ST_Int32OutputData;
    hrHttpRemoveClient   : HRESULT;

    fbHttpRest   : FB_HttpRest;
END_VAR

hrHttpRemoveClient := fbHttpRest.RemoveClient(
         bExecute   := bHttpRemoveClient, 
         ConnectionHandle  := depragSmartConnection.ConnectionHandle,
         ClientId    := 1, 
         OutputData   => OutputDataHttpRemoveClient);
IF hrHttpRemoveClient <> S_FALSE THEN 
    bHttpRemoveClient := 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".