Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

API not returning value for reading UAAttributeId.ArrayDimensions

More
22 Sep 2023 05:23 #12215 by support
Hello.
I do not see any problem in what you have sent. Both servers are behaving correctly, QuickOPC is doing it correctly, and your code is correct too. There is nothing to be fixed.

ArrayDimensions attribute is optional on Variable nodes. One server has it, the other does not, both are entitled to do so.
The other attributes that return error are either optional or node defined for Variable nodes at all.

Reference:

- reference.opcfoundation.org/Core/Part3/v104/docs/5.6
- reference.opcfoundation.org/Core/Part3/v104/docs/5.9

(Note the "O" for Optional with ArrayDimensions)

Regards

Please Log in or Create an account to join the conversation.

More
21 Sep 2023 15:37 #12209 by chandresekaran
re: the server configuration, I use my local Kepware server, now I have tried with your demo server as well with an int array node, it is not returning an exception neither the array dimension value. the value returns empty but no exception which is different in my case. If you want to reproduce the issue, you might need a local kepware server and create one int32 array tag. I have attached both console output files here.
Attachments:

Please Log in or Create an account to join the conversation.

More
21 Sep 2023 14:41 #12208 by support
Hello.

The console output file isn't really attached, please attach it.
Also, please send the KepServerEx configuration so that we can attempt to reproduce the issue.

Regards

Please Log in or Create an account to join the conversation.

More
21 Sep 2023 14:37 #12207 by chandresekaran
Hello,

we still facing difficulties in reading attribute values, it is not just array dimensions, there is a generic error message comes for every attribute read. I understand all attribute id are not applicable for all nodes, particularly we care about only array dimensions and this node is int32 array, so it should return value, even you can validate the value attribute return that confirms.

I hope the below code helps you to understand the issue and the node id we passing is healthy that returns some attribute value but not all. look at the console output file attached.
          [attachment=1672]ConsoleOutput.txt[/attachment]string[] ids = new string[]
         {
            "nsu=KEPServerEX;ns=2;s=Channel2.Device1.ArrayTest",
         };
 
         UAEndpointDescriptor endpointDescriptor = "opc.tcp://127.0.0.1:49320";
         var client = new EasyUAClient();
         foreach(var id in ids)
         {
            Console.WriteLine($" ==================== {id} ===================== ");
            foreach(var attrId in Enum.GetValues(typeof(UAAttributeId)))
            {
               if((UAAttributeId)attrId != UAAttributeId.None)
               {
                  Console.WriteLine($" ------------------------- {attrId} ------------------------- ");
                  try
                  {
                     var a = client.ReadValue(endpointDescriptor, id, (UAAttributeId)attrId);
                     Console.WriteLine($"{attrId}: {a}");
                  }
                  catch (UAException uaException)
                  {
                     Console.WriteLine($"*** Failure: {uaException.GetBaseException().Message}");
                  }
               }
 
            }
            Console.WriteLine($" ======================================================================================== ");
         }
Attachments:

Please Log in or Create an account to join the conversation.

More
21 Sep 2023 06:36 #12188 by support
Hello.

You original report did not say that you are taking the nodes from browsing. And it is now clear that reading works well; the problem is in the browsing. And, there are at least two separate problems.

First, you are using BrowseDataNodes method. This is OK. But it returns nodes that are Objects, and Variables. nodes that are Objects do not have values, and they do not have a data type. This is per UA spec. It makes no sense to attempt to read values or data types from them. Your code should check the node class, and skip that reading for Objects.

Second, there are still Variable nodes that return the exception. I do not know the reason yet.

I would first ask you to fix a suspicious thing in your code: You are passing nodeElement.NodeId.ExpandedText to BrowseDataNodes. This causes the node ID (which is an object) to be formatted to a string, and then converted back. This is completely unnecessary. Change it, and pass simply nodeElement.NodeId (because it has an implicit conversions to UANodeDescriptor).

In addition, have your code to output the nodeElement.NodeId that it is actually passing to BrowseDataNodes .

If that does not help, we will look into other possibilities.

Please Log in or Create an account to join the conversation.

More
20 Sep 2023 19:50 #12186 by chandresekaran
I re-verified this once again, I pass the correct node id, see the attached code, it returns the data type but not the array dimensions.

there are two attachments, one contains the code snippet and other one is output file.
try
{
            var f = client.ReadValue(endpointDescriptor1, nodeElement.NodeId.ExpandedText, UAAttributeId.DataType);
            var a = client.ReadValue(endpointDescriptor1, nodeElement.NodeId.ExpandedText, UAAttributeId.ArrayDimensions);
            File.AppendAllText("Temp.txt",$"{root}{nodeElement.DisplayName} [{nodeElement.NodeClass}] [{nodeElement.TypeDefinition.ExpandedText} = {f} [{a}]]" + "\n");
}
catch(Exception ex)
{
            File.AppendAllText("Temp.txt",$"{root}{nodeElement.DisplayName} [{nodeElement.NodeClass}] [{nodeElement.TypeDefinition.ExpandedText} = Ex {ex.Message}]" + "\n");
}

Channel2.Device1._System._Simulated [Variable] [nsu=http://opcfoundation.org/UA/ ;i=62 = Ex An OPC-UA operation failure with error ID 'Opc.UA.StatusCode=0x80350000' occurred, originating from '' and with depth of 1. The inner exception, of type "OpcLabs.EasyOpc.UA.UAStatusCodeException", contains details about the problem.]
Channel2.Device1.Local_DataTypeGroup [Object] [nsu=http://opcfoundation.org/UA/ ;i=61 = Ex An OPC-UA operation failure with error ID 'Opc.UA.StatusCode=0x80350000' occurred, originating from '' and with depth of 1. The inner exception, of type "OpcLabs.EasyOpc.UA.UAStatusCodeException", contains details about the problem.]
Channel2.Device1.Local_DataTypeGroup.ArrayTest [Variable] [nsu=http://opcfoundation.org/UA/ ;i=62 = Ex An OPC-UA operation failure with error ID 'Opc.UA.StatusCode=0x80350000' occurred, originating from '' and with depth of 1. The inner exception, of type "OpcLabs.EasyOpc.UA.UAStatusCodeException", contains details about the problem.]
Channel2.Device1.Local_DataTypeGroup.DigitalInput [Variable] [nsu=http://opcfoundation.org/UA/ ;i=62 = Ex An OPC-UA operation failure with error ID 'Opc.UA.StatusCode=0x80350000' occurred, originating from '' and with depth of 1. The inner exception, of type "OpcLabs.EasyOpc.UA.UAStatusCodeException", contains details about the problem.]
Channel2.Device1.Local_DataTypeGroup.DigitalIsMutable [Variable] [nsu=http://opcfoundation.org/UA/ ;i=62 = Ex An OPC-UA operation failure with error ID 'Opc.UA.StatusCode=0x80350000' occurred, originating from '' and with depth of 1. The inner exception, of type "OpcLabs.EasyOpc.UA.UAStatusCodeException", contains details about the problem.]
Channel2.Device1.Local_DataTypeGroup.DigitalOutput [Variable] [nsu=http://opcfoundation.org/UA/ ;i=62 = Ex An OPC-UA operation failure with error ID 'Opc.UA.StatusCode=0x80350000' occurred, originating from '' and with depth of 1. The inner exception, of type "OpcLabs.EasyOpc.UA.UAStatusCodeException", contains details about the problem.]
Attachments:

Please Log in or Create an account to join the conversation.

More
29 Aug 2023 05:04 #12042 by support
You need to check whether you have truly specified the correct NodeId. I believe you have not. I am confident we are simply passing (to the server) the node Id you have specified, and returning back the status the server is given to us. If you have information to the contrary, provide a Wireshark trace. Or at least screenshots that show the nodeId passed to the OPC Foundation library, and the one passed to our library.

Regards

Please Log in or Create an account to join the conversation.

More
28 Aug 2023 17:35 #12040 by chandresekaran
When you try to read array size of tags, the API returns only bad status. we are migrating the app from OPC UA Foundation library to OPC Labs, the same server and credentials, we can retrieve the array size using that library. the response here is not bad for every nodes, few results are success but null and remaining are all bad status response, please check the screenshotscreenshot

Code Snippet

List<UAReadArguments> arguments = new List<UAReadArguments>();
foreach (var node in nodes)
{
arguments.Add(new UAReadArguments(_endpoint, node, UAAttributeId.ArrayDimensions));
}
var results = _opcClient.ReadMultipleValues(arguments.ToArray());


Error
{*** Failure Opc.UA.StatusCode=0x80350000: Status is not good: {BadAttributeIdInvalid}. The attribute is not supported for the specified Node. [...]}

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.060 seconds