Is there any way to model a collection of objects?

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
opcstudent
Full Member
Full Member
Posts: 6
Joined: 16 Dec 2015, 15:41

Is there any way to model a collection of objects?

Post by opcstudent »

Hi,

I would like to know if it is possible to model an object type (Type1) that has a collection of another object type (Type2)?
My goal is that each instance of Type1 could have a different and variable number of instance of Type2 during runtime (like ArrayList in Java).

I read about ArrayDimensions attribute but it does not seem the right choice.

best regards

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: Is there any way to model a collection of objects?

Post by Support Team »

Hi,

The ArrayDimensions and ValueRank attributes are related to arrays of simple or structure DataTypes provided through the Value attribute of a Variable. If you have an array of data structures, you can provide a Variable with the DataType of this data structure. If you set ValueRank to 1, you can provide an array of this structure through this one Variable.

But an array of Objects is a list of nodes and ArrayDimensions does not apply since it is just relevant for the Value of a single Variable.
If you want to indicate that an ObjectType (Type1) has a collection of another ObjectType (Type2), you can use the ModelingRule OptionalPlaceholder (or MandatoryPlaceholder) to indicate this. This ModelingRule indicates that a list of Type2 instances can be expected on instances of Type 1.

Best Regards,
Unified Automation Support Team

Post Reply