Hi Support,
VS 2019/QuickOPC 5.61.241
I'm using the code below to write a struct value
static void Main(string[] args){
UAEndpointDescriptor endpointDescriptor = "opc.tcp://localhost:48030/";
UANodeDescriptor nodeDescriptor = "ns=2;i=6009";
using(var client = new EasyUAClient()){
try{
var attributeData = client.Read(endpointDescriptor, nodeDescriptor);
if(attributeData?.Value is UAGenericObject uaGenericObject){
var fieldData = (((StructuredData)uaGenericObject.GenericData)?.FieldData);
if(fieldData == null){
return;
}
var batchCode = ((PrimitiveData)fieldData["BatchCode"]).Value;
var bundleCode = ((PrimitiveData)fieldData["BundleCode"]).Value;
var boardCount = ((PrimitiveData)fieldData["BoardCount"]).Value;
var boardLength = ((PrimitiveData)fieldData["BoardLength"]).Value;
var boardWidth = ((PrimitiveData)fieldData["BoardWidth"]).Value;
var boardThickness = ((PrimitiveData)fieldData["BoardThickness"]).Value;
//((PrimitiveData)fieldData["BoardCount"]).Value = 123;
//client.Write(endpointDescriptor, nodeDescriptor, attributeData);
client.WriteValue(endpointDescriptor, nodeDescriptor, attributeData);
}
}
catch(UAException uaException){
Console.WriteLine("*** Failure: {0}", uaException.GetBaseException().Message);
}
}
}
This causes the exception below
Exception:
An OPC-UA operation failure with error ID 'Opc.UA.ServiceResult=0x80730000' occurred, originating from 'OpcLabs.EasyOpcUA' and with depth of 1. The inner OPC-UA service exception with service result 'BadWriteNotSupported' contains details about the problem.
InnerException:
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 operation follows. Value: yes, index range: no, source timestamp: yes, server timestamp: yes.
+ When writing, be aware that writing the server timestamp (in this call, 17/08/2021 18:38:28) is not supported by some servers, including the OPC Foundation sample server.
+ The node descriptor used was: NodeId="ns=2;i=6009".
+ The client method called (or event/callback invoked) was 'WriteMultiple'.
I am able to update the values with UaExpert.
I'm using a test server which I attached.
Can you help me any further?
Best regards,
Goos van Beek.