dOPC Client Toolkit
Close
dOPCDA.TdOPCDAClient.OPCConnection

returns the interface of the underlying connection

function OPCConnection: IdOPCDAConnection;
__fastcall IdOPCDAConnection OPCConnection();

Depending on the connection type (UA, COM or XML) you get the interface for underlying connection. You get only a right value back if you are connected to the server. 

 

The example below shows you how to get the underlying OPC UA connection TdOPCUAClient 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 © 2024. All rights reserved.