Page 1 of 1

Writing an Vector object

Posted: 17 Dec 2019, 14:19
by sasidhar grandhe
We are writing a Vector object as below (We are using the OPC Foundation Java library). However, the value is displayed as 'Unknown Extension Object' in UaExpert. Are we doing something wrong in the writing process?

ExpandedNodeId eNodeId = new ExpandedNodeId(vectorNodeId);
ExtensionObject eObject = new ExtensionObject(eNodeId, ByteString.valueOf(vectorByteArray));
DataValue dataValue = new DataValue(new Variant(eObject),null,null,null);

String numericRange = null;
RequestHeader requestHeader = new RequestHeader();
WriteResponse writeResponse = this.session.getSessionChannel().Write(requestHeader, new WriteValue[] {new WriteValue(vectorNodeId, Attributes.Value, numericRange, dataValue)}); // Attributes.Value = UnsignedInteger.valueOf(13)

Re: Writing an Vector object

Posted: 26 Dec 2019, 09:37
by sasidhar grandhe
I was making a mistake with the Vector NodeId (vectorNodeId) used.
This was resolved after passing the value of vectorNodeId as 'ns=2;i=3002' instead of 'ns=2;s=Demo.Static.Scalar.Vector'.
We need to pass the data type NodeId.

Re: Writing an Vector object

Posted: 01 Jan 2020, 10:49
by sasidhar grandhe
This code worked fine for Vector and WorkOrder objects after using the datatype NodeId. It even worked for Person1 object. But there is one issue seen for Person1 - once we write a value using the above code snippet, and try to check the changes in UaExpert using 'Data Access View', the popup opens on double-click, but is displayed as blank. However when we click on Person1 in the 'Address Space', then the data is shown properly in the 'Attributes' tab. Can it be an issue of UaExpert or are we doing something wrong?