dOPC Client Toolkit
Close
Example
function uaReadAttribute(uaClient: TdOPCUAClient; NodeId: string; Attribute: integer ): variant; var S: uaRead; ReadNode: uaReadValueId; DataValue: uaDataValue; begin S := uaRead.Create(uaClient); try S.Request.NodesToRead_Setlength(1); ReadNode := uaReadValueId.Create; ReadNode.NodeId := uaStrToNodeId(NodeId); ReadNode.AttributeId := Attribute; // we want to read a special attribute S.Request.NodesToRead[0] := ReadNode; S.Run; DataValue := S.Response.Results[0]; uaClient.CheckStatusCode(DataValue.StatusCode); // if status code is not ok raise an exception result := DataValue.Value.ToVariant; finally S.Free; end; end;
Kassl GmbH Copyright © 2024. All rights reserved.