dOPC Client Toolkit
Close
Example
ua.client.TdOPCUAClient.ReadNodeAttribute
program dOPUACTest;
uses
variants, sysutils,
ua.client
,
ua.datatypes
, ua.buildintypes;
var
OPCClient:
TdOPCUAClient
;
DataValue : uaDatavalue;
begin
OPCClient := TdOPCUAClient.
Create
(nil);
OPCClient.
Url
:= 'opc.tcp://opcuaserver.com:48010';
OPCClient.
Active
:= true;
DataValue :=
OPCClient.ReadNodeAttribute('i=2259', TuaAttributes.Value,uaTimestampsToReturn.Both);
Writeln('Value : ' + VarToStr(DataValue.ValueToVariant));
Writeln('Source Time : ' + TimeToStr(DataValue.SourceTimestamp));
Writeln('Server Time : ' + TimeToStr(DataValue.ServerTimestamp));
Writeln('Quality : ' + DataValue.StatusCode.ToQualityString);
DataValue.Free;
Writeln('Press Enter to exit');
Readln;
OPCClient.Free;
end.
Kassl GmbH Copyright © 2024. All rights reserved.