dOPC Client Toolkit
Close
ua.client.TdOPCUAClient.ReadNodeAttributes

Reads one or more Attributes of one or more Nodes.

function ReadNodeAttributes(NodeIds: TArray<string>; Attributes: TArray<integer>; TimestampsToReturn: integer = uaTimestampsToReturn.Neither): TArray<uaDataValue>;
__fastcall TArray<uaDataValue> ReadNodeAttributes(TArray<string> NodeIds, TArray<integer> Attributes, int TimestampsToReturn = uaTimestampsToReturn.Neither);

This method can be used to read one or more Attributes of one or more Nodes. It returns an array of uaDataValues. 

 

Parameter
Description
NodeIds
String array of nodes.
Attributes
Defines which attributes we want to read. For further information look also at: TuaAttributes
TimestampsToReturn
Defines which timestamps you want to return (look also at: uaTimestampsToReturn) Default is Neither, which means the method returns no timestamps.
Result
An array of uaDataValues
program dOPUACTest; uses variants, ua.client, ua.buildintypes; var OPCClient: TdOPCUAClient; Results: TArray<uaDataValue>; begin OPCClient := TdOPCUAClient.Create(nil); OPCClient.Url := 'opc.tcp://opcuaserver.com:48010'; OPCClient.Active := true; Results := OPCClient.ReadNodeAttributes(['i=2259', 'i=2263'],[TuaAttributes.DisplayName, TuaAttributes.Value]); Writeln(Results[0].ValueToVariant+' has value: '+VarToStr(Results[1].ValueToVariant)); Writeln(Results[2].ValueToVariant+' has value: '+VarToStr(Results[3].ValueToVariant)); Writeln('Press Enter to exit'); Readln; OPCClient.Free; end.
Kassl GmbH Copyright © 2024. All rights reserved.