RemoveDevice

TwinCAT
Devices Multi-vendor devices Open Protocol devices

ns=2;s=DEPRAG Smart/Devices/General/OpenProtocol/RemoveDevice

Removes a device from the OpenProtocolDevices list.

Parameters:

    Id
    An Int32 value specifying the device to be removed from the list of devices registered with the DEPRAG Smart OPC UA Server.

Returns:

    RemoveDevice
    A variable of type OpcMethodReturnValueInt32. The Result property contains the command-specific return values.
      Result
      An Int32 value that returns the Id of the device that has been removed from the list of devices registered with the DEPRAG Smart OPC UA Server.

Examples:

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

Beckhoff parameter:

    bOpenProtocolRemoveDevice
    A boolean variable that can be used to trigger the execution of the RemoveDevice command.
    OutputDataOpenProtocolRemoveDevice
    An instance of the "ST_Int32OutputData" structure into which the return value of the RemoveDevice method is written.
    hrOpenProtocolRemoveDevice
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    fbOpenProtocol
    An instance of the "FB_OpenProtocol" function block supplied with the DEPRAG Smart library.
    nDeviceId
    A DINT value specifying the device to be removed from the list of devices registered with the DEPRAG Smart OPC UA Server.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
       bOpenProtocolRemoveDevice   : BOOL;
       OutputDataOpenProtocolRemoveDevice  : ST_Int32OutputData;
       hrOpenProtocolRemoveDevice   : HRESULT;

       fbOpenProtocol   : FB_OpenProtocol;
END_VAR

hrOpenProtocolRemoveDevice := fbOpenProtocol.RemoveDevice(
       bExecute    := bOpenProtocolRemoveDevice,
       ConnectionHandle := depragSmartConnection.ConnectionHandle,
       nDeviceId   := 0,
       OutputData   => OutputDataOpenProtocolRemoveDevice);
IF hrOpenProtocolRemoveDevice <> S_FALSE THEN 
       bOpenProtocolRemoveDevice := 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".