Writing an Vector object

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Moderator: Support Team

Post Reply
sasidhar grandhe
Full Member
Full Member
Posts: 5
Joined: 09 Dec 2019, 12:24

Writing an Vector object

Post 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)

sasidhar grandhe
Full Member
Full Member
Posts: 5
Joined: 09 Dec 2019, 12:24

Re: Writing an Vector object

Post 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.

sasidhar grandhe
Full Member
Full Member
Posts: 5
Joined: 09 Dec 2019, 12:24

Re: Writing an Vector object

Post 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?

Post Reply