dOPC Client Toolkit
Close
ua.client.TdOPCUAClient
ua_client_TdOPCUAClient

Component to connect to an OPC UA server.

TdOPCUAClient = class(TComponent);
class TdOPCUAClient : public TComponent;

With the TdOPCUAClient it is possible to connect to any OPC UA Server via the binary protocol (opc.tcp://...). The usage of the our UA component is very easy. All connect and disconnect activities are done in the component. But please note: With this component it is not possible to connect to other OPC server like OPC Classic COM server or OPC XML DA server, this can be done e.g. with our TdOPCDAClient component. 

Here is an example how you can connect to an OPC UA server:

uses ua.client; procedure OPCUAConnect(OPCClient : TdOPCUAClient); begin OPCClient.URL := 'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer'; OPCClient.Active := true; ShowMessage('Connected to server'); end;

The TdOPCUAClient supports all OPC UA Service calls which are in detailed descript in the OPC UA Specification (Part 4: Services) You can download the specification at: https://www.opcfoundation.org 

It is recommended to read the OPC UA Specification Part 4 first

Below you will find an example how you can make an service call with the TdOPCUAClient component. You will find all Pascal implementations of the OPC UA data types and service calls descript in the OPC UA Spec. Part 4 in the unit ua.datatypes. All OPC UA basic build in types are implemented in the unit ua.buildinTypes. 

The example shows you how to call the GetEndpoints service. For further information about this service, look at: OPC UA Specification Part 4 Discovery Service Set "GetEndpoints".

uses // includes all datatypes specified in OPC UA Spec Part 4 (Services) ua.datatypes; procedure CallGetEndpoints(UAClient: TdOPCUAClient; Info: TStrings); var S: uaGetEndpoints; Endpoint: uaEndpointDescription; begin S := uaGetEndpoints.Create(UAClient); try S.Request.EndpointUrl := UAClient.Url; S.Run; for Endpoint in S.Response.Endpoints do Info.Add('+ '+Endpoint.EndpointUrl); finally S.Free; end; end;

You can call all other OPC UA service calls in the same way. 

Here an template how to use:

var ServiceCall: ua<NameOfServiceCall> // NameOfServiceCall = Service descripted in Part 4 begin ServiceCall := ua<NameOfServiceCall>.Create(<TdOPCUAClientObject>) try ServiceCall.Request.<InputParam> := <InputParamValue> ServiceCall.Run; ServiceCall.Response.<OutputParam> finally ServiceCall.Free; end; end;

 

Below you will find all OPC UA Service calls ua<NameOfServiceCall> which are supported by the dOPC Client Toolkit and in detail descript in the OPC UA Specification Part 4 Services.

OPC UA Service call
Description
Finds the servers known to the discovery server.
Returns the Servers known to a Discovery Server
Gets the endpoints used by the server.
Registers a server with the discovery server.
Is implemented by Discovery Servers
Creates a secure channel with a server.
Closes a secure channel.
Creates a new session with the server.
Activates a session with the server.
Closes a session with the server.
Cancels an outstanding request.
Adds one or more nodes to the server address space.
Adds one or more references to the server address space.
Delete one or more nodes from the server address space.
Delete one or more references from the server address space.
Browse the references for one or more nodes from the server address space.
Continues one or more browse operations.
Translates one or more paths in the server address space.
Registers one or more nodes for repeated use within a session.
Unregisters one or more previously registered nodes.
This Service is used to issue a Query request to the Server
look at OPC UA Spec Part 4 Services
Is used to read one or more Attributes or Nodes.
look at OPC UA Spec Part 4 Services
Is used to write values to one or more Attributes or Nodes
look at OPC UA Spec Part 4 Services
Is used to call a list of Methods
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
look at OPC UA Spec Part 4 Services
Kassl GmbH Copyright © 2024. All rights reserved.