Ok, I have a simple test environment. From C#, using OPC UA, I can read DINTs, write DINTs, read Structs, but when I try to write a struct I get BadNotWritable.
I am using Communication Manager, OPC UA Server, and IEC Symbol Publishing. I have a struct defined with one single DINT in it. The instance of the struct is in GVL. The struct is marked read/write in IEC Symbol Publishing.
Ok, for the sake of completeness in case anyone else has this problem. I can tell you that what finally worked for me was to change the line:
// create an ExtensionObject to wrap the value to be writtenExtensionObjectextensionObject=newExtensionObject(newExpandedNodeId("GVL_StructA",5),structAData);
to:
// create an ExtensionObject to wrap the value to be writtenExtensionObjectextensionObject=newExtensionObject(newExpandedNodeId("GVL_StructA|defaultbinary",5),structAData);
I'm sure there are many other problems that could cause this very generic error, but this was my problem.
π
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I have a simple test environment. From C#, using OPC UA, I can read DINTs, write DINTs, read Structs, but when I try to write a struct I get BadNotWritable.
I am using Communication Manager, OPC UA Server, and IEC Symbol Publishing. I have a struct defined with one single DINT in it. The instance of the struct is in GVL. The struct is marked read/write in IEC Symbol Publishing.
Any ideas? Pointers are welcome.
Ok, for the sake of completeness in case anyone else has this problem. I can tell you that what finally worked for me was to change the line:
to:
I'm sure there are many other problems that could cause this very generic error, but this was my problem.