dOPC Client Toolkit
Close
ua.client.TdOPCUAClient.SessionLess

Connect to an OPC UA without creating a Session.

property SessionLess: boolean;
__property boolean SessionLess;

If you want to use this component to connect e.g. to an OPC UA Discovery server then it is recommended to set property SessionLess to true. Below you will find an example how you can connect to an OPC UA Discovery server. But you can also use our TdOPCServerBrowser component.

To discover OPC UA server you have to install the UA Local Discovery Server from the OPC Foundation 

(https:\\opcfoundation.org) first. 

The direct link is: https://opcfoundation.org/developer-tools/developer-kits-unified-architecture/local-discovery-server-lds/

uses ua.client, ua.datatypes; procedure TFormOPCUATest.ButtonDiscoverTestClick(Sender: TObject); var uaDiscoverClient: TdOPCUAClient; ServiceCall : uaFindServers; // OPC Service Call Server: uaApplicationDescription; DiscoveryUrl : string; begin uaDiscoverClient := TdOPCUAClient.Create(nil); ServiceCall := uaFindServers.Create(uaDiscoverClient); try uaDiscoverClient.Url := 'opc.tcp://localhost:4840'; // default url of discovery server uaDiscoverClient.Proxy := ''; uaDiscoverClient.SessionLess := true; uaDiscoverClient.Active := true; ServiceCall.Run; // Finds the servers known to the discovery server. for Server in ServiceCall.Response.Servers do begin for DiscoveryUrl in Server.DiscoveryUrls do Memo1.Lines.Add(DiscoveryUrl); end; finally uaDiscoverClient.Free; ServiceCall.Free; end; end;
Kassl GmbH Copyright © 2024. All rights reserved.