usesua.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 objectfunction GetOPCUAClient(DaClient: TdOPCDAClient): TdOPCUAClient;
var
Connection: TObject;
beginif DaClient.OPCConnection <> nilthenbegin
Connection := DaClient.OPCConnection.GetObject; // ticky: get underlying connection objectif (Connection <> nil) and (Connection is TdOPCUAConnection) then
result := TdOPCUAConnection(Connection).uaClient
elseraise Exception.Create('connection is not a opc ua server connection');
endelseraise Exception.Create('first connect to opc ua server');
end;