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.

Issue writing specific index of an array type

More
08 Feb 2025 18:14 #13382 by support

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

More
06 Feb 2025 15:10 #13376 by Mah
Thanks for a detailed explanation.
We are working on a generic API for Read/Write/Subscribe etc. using OPCLabs and this helps us to add exception based off the server type.
We are considering the smart copy mechanism as per your suggestion with the caveat of override. Looks like the best to avoid this is by updating/reading the Node ID frequently by subscription, so when time comes to write we will have close to recent values.

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

More
06 Feb 2025 14:55 #13374 by support
It is Kepware limitation.
Other OPC servers: Some support it, some not.

You need to understand that for the server to support this, the underlying protocol/hardware must support it first. And many do not. And then the server cannot quite "fill it in" by doing Read-Modify-Write instead, because of the same issue I described - it can overwrite the other elements of the array which should stay unchanged but might have changed between the Read and the Write.

Regards
The following user(s) said Thank You: Mah

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

More
06 Feb 2025 13:55 #13370 by Mah
So does that mean it's a Kepware limitation? Is this also true with other OPC server providers?

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

More
06 Feb 2025 06:23 #13365 by support
Hello,
as the error message says, this functionality is not supported by the server.

You need to do Read-Modify-Write, but there is a risk that the other elements in the array change in between the Read and Write, and you will overwrite them.

Best regards

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

More
06 Feb 2025 03:50 #13364 by Mah
Issue writing specific index of an array type.
- I'm trying to write specific indexes of an array node defined in Kepware.
- Node defined as a float array of length 10
- I get an error while the similar pattern for reading works.
- How do I achieve this? Please provide examples.

 
   UAEndpointDescriptor endpointDescriptor = "opc.tcp://localhost:49320";
 
   // Following code returns an error and fails to write specific index values of a float array type 
   // 
   var writeAttributeArguments = new UAWriteValueArguments(endpointDescriptor, nodeElementCollection[3].NodeId, new float[] { 7.7F, 8.8F, 9.9F })
	{
		IndexRangeList = UAIndexRangeList.OneDimension(2, 4),
	};
	var writeResponses = client.WriteMultipleValues(new UAWriteValueArguments[] { writeAttributeArguments});
   // Write response values
   // Write result : False,
   // ErrorId : Opc.UA.ServiceResult=0x80730000, 
   // ErrorMessage : OPC UA service result - {BadWriteNotSupported}. The server does not support writing the combination of value, status and timestamps provided. A list of parts provided (or not provided) to the Write service follows. 
   // Value: yes, index range: yes, source timestamp: no, server timestamp: no.
 
 
   // Following code for read multiple values work with read of specific indexes of a float array type
   //   
   var attributeArguments = new UAReadArguments(endpointDescriptor, nodeElementCollection[3].NodeId)
	{
		IndexRangeList = UAIndexRangeList.OneDimension(2,4),
	};
	var readResponse = client.ReadMultipleValues(new UAReadArguments[] { attributeArguments}); 
 
 
 

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

Moderators: support
Time to create page: 0.051 seconds