dOPC Client Toolkit

Gets the Namespace Index for the given Namespace Uri.

function GetNamespaceIndex(NameSpaceUri: string): integer;
__fastcall int GetNamespaceIndex(AnsiString NameSpaceUri);

Gets the NamespaceIndex for the given NamespaceUri. This method reads the NameSpaceArray (2255) variable from the OPC UA server. If the variable not exists or the NamespaceURI not exists in the array the function returns -1 otherwise the NamespaceIndex.

procedure TTestForm.Button1Click(Sender: TObject); var UAClient : TdOPCUAClient; begin UAClient := TdOPCUAClient.Create(nil); UAClient.Url := 'opc.tcp://'; UAClient.Active := true; if UAClient.GetNamespaceIndex('') <> 0 then Memo1.Lines.Add('ERROR: Namespace must exists on an OPC UA server'); UAClient.Free; Memo1.Lines.Add('ready :-)'); end;
Kassl GmbH Copyright © 2024. All rights reserved.