dOPC Client Toolkit
Close
dOPCComn.TdOPCClient.OPCConnection

Returns the underlying communication object.

function OPCConnection: IdOPCConnection;
__fastcall IdOPCConnection OPCConnection();

With the help of this function you can get access to the underlying communication object. 

Below you will find an example how you can get the TdOPCUAClient object of a OPC UA connection:

uses ua.datatypes, // for OPC UA datatypes of the UA service calls dOPCUA, ua.client; // use this units if you want to work with the OPC UA core client (TdOPCUAClient) of the dOPCDAClient // ticky: get underlying connection TdOPCUAClient object of the TdOPCDAClient client object function GetOPCUAClient(DaClient: TdOPCDAClient): TdOPCUAClient; var Connection: TObject; begin if DaClient.OPCConnection <> nil then begin Connection := DaClient.OPCConnection.GetObject; // ticky: get underlying connection object if (Connection <> nil) and (Connection is TdOPCUAConnection) then result := TdOPCUAConnection(Connection).uaClient else raise Exception.Create('connection is not a opc ua server connection'); end else raise Exception.Create('first connect to opc ua server'); end;
Kassl GmbH Copyright © 2019. All rights reserved.