dOPC Client Toolkit
Close
Example
ua.client.uaCopyExtensionObject
Copy Code
program
dOPUACTest;
uses
sysutils,
ua.client
,
ua.datatypes
, ua.buildintypes;
var
OPCClient:
TdOPCUAClient
; DataValue : uaDataValue; ServerStatus :
uaServerStatusDataType
;
begin
OPCClient := TdOPCUAClient.Create(
nil
); OPCClient.Url := 'opc.tcp://opcuaserver.com:48010'; OPCClient.Active := true; DataValue := OPCClient.ReadNodeAttribute('ns=0;i=2256',TuaAttributes.Value);
if
DataValue.Value.IsExtensionObject
then
begin
ServerStatus := uaServerStatusDataType.Create; uaCopyExtensionObject(ServerStatus,DataValue); Writeln('State : '+ ServerStatus.State.ToString); Writeln('Start time : '+ ServerStatus.StartTime.ToString); Writeln('Server Uri : '+ ServerStatus.BuildInfo.ProductUri); Writeln('Manufacturer name: '+ ServerStatus.BuildInfo.ManufacturerName); Writeln('Product name : '+ ServerStatus.BuildInfo.ProductName); Writeln('Software version : '+ ServerStatus.BuildInfo.SoftwareVersion); ServerStatus.Free;
end
else
Writeln('node is not a extension Object'); Writeln(''); Writeln('Press Enter to exit'); Readln; DataValue.Free; OPCClient.Free;
end
.
Kassl GmbH Copyright © 2024. All rights reserved.