Page 1 of 1

Represent System.Collections.ArrayList in OPC-UA Server

Posted: 16 Jul 2013, 09:26
by Christian
Hello,

I am trying to build an OPC-UA server that provides data of an underlying system. The underlying system has a function “GetData” which writes all data it gets from the underlying system in a System.Collections.ArrayList. This ArrayList is built dynamically during runtime. Therefore the dimensions are not known when building my OPC-UA server. The ArrayList is built new for every call of GetData, therefore it may be different for every call of GetData.
The return value of the underling system is that ArrayList which I want to represent in the OPC-UA server to access it with an OPC-UA client.

Is it possible to represent this dynamically built ArrayList in an OPC-UA Server and how do I accomplish that either by using UaModeler or by writing the code by hand?

Please let me know if you need further information to answer my question.

I am working with UA Bundle SDK .NET version 2.1.2.227 and UaModeler version 1.2.1

Thank you and best regards,
Christian

PS. Searching the forum wasn’t very helpful because of “…they are too common words”

Re: Represent System.Collections.ArrayList in OPC-UA Server

Posted: 16 Jul 2013, 12:21
by Support Team
Hi Christian,

Arrays of dynamic length are handled very similar to scalar values in OPC UA. You can add arrays to Variants.
See http://doc.unifiedautomation.com/uasdkd ... ess03.html for an example for the Read and Write method.

In your case the array length in unknown, so the ArrayDimensions attribute of the node containing the value should be set to 0 and the ValueRank should be set to 1.

Best Regards
Support Team

Re: Represent System.Collections.ArrayList in OPC-UA Server

Posted: 19 Aug 2013, 13:47
by Christian
Hello Support-Team,

I tried to apply the example of the Tutorial to my usecase. Unfortunately I was not able to accomplish successfully push of the data from the underlying system.

In my usecase, I have an underlying system for which I want to implement “ExternalPush”. According to “Data Access, Handle Types and the IIOManager“ I have to override the Write method of the BaseNodeManager.

I want the underlying system to be able to push new data, triggered by an event, to the OPC-Server. In the OPC-Server I created several objects based on an ObjectType I defined in UaModeler. This ObjectType has a complex VariableType with several variables of different DataTypes. To write the data I have to address either the complete list of variables (given the data of the underlying system is in the same order) or each variable separately.

I am not able to figure out what the parameters of the Write method of BaseNodeManager stand for, respectively how I set and get them. The documentation is very sparse and the description of the parameters (for example: “indexRange – The index range”) doesn’t help me very much.
Where are those parameters set originally? How do I determine which parametervalues are needed to address the correct ValueAttributes of my complex VariableType?

What is meant with the indexRange? The index of the attibutes of a complex variabletype? The index of the nodes in a subtree? …
What is context referring to? How do I determine in which context I am currently operating on?
How do I identify the correct NodeAttibuteHandle to address the target correctly. ...

It’s very hard for me to transfer your example from the tutorial to my usecase.

Thanks again,
Christian