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.
- Forum
- Discussions
- QuickOPC-UA in COM
- Reading, Writing, Subscriptions
- API not returning value for reading UAAttributeId.ArrayDimensions
API not returning value for reading UAAttributeId.ArrayDimensions
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.
- chandresekaran
- Topic Author
- Offline
- Premium Member
- Posts: 11
- Thank you received: 0
Please Log in or Create an account to join the conversation.
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.
- chandresekaran
- Topic Author
- Offline
- Premium Member
- Posts: 11
- Thank you received: 0
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.
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.
- chandresekaran
- Topic Author
- Offline
- Premium Member
- Posts: 11
- Thank you received: 0
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.]
Please Log in or Create an account to join the conversation.
Regards
Please Log in or Create an account to join the conversation.
- chandresekaran
- Topic Author
- Offline
- Premium Member
- Posts: 11
- Thank you received: 0
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.
- Forum
- Discussions
- QuickOPC-UA in COM
- Reading, Writing, Subscriptions
- API not returning value for reading UAAttributeId.ArrayDimensions