dOPC Client Toolkit
Close
Example
ua.client.TdOPCUAClient.WriteNodeAttribute
Copy Code
program
Project11; {$APPTYPE CONSOLE} {$R *.res}
uses
ua.client
, ua.buildintypes, ua.statuscodes;
var
OPCClient:
TdOPCUAClient
; WriteVal : uaVariant; Ret : uaStatuscode; SetVal : uaInt32;
begin
OPCClient := TdOPCUAClient.Create(
nil
); OPCClient.Url := 'opc.tcp://opcuaserver.com:48010'; OPCClient.Active := true; SetVal := 36; WriteVal := uaVariant.Create(SetVal); Ret := OPCClient.WriteNodeAttribute('ns=2;s=Demo.Static.Scalar.Int32', TuaAttributes.Value, WriteVal);
if
not
Ret.IsGood
then
writeln('Error write node:', Statuscodes.ToString(Ret))
else
writeln('Succesfully written :-)'); WriteVal.Free; Writeln('Press Enter to exit'); Readln; OPCClient.Free;
end
.
Kassl GmbH Copyright © 2024. All rights reserved.