How to replicate a c# generic LIST<T> Collection in modeller

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
ctgarvey
Sr. Member
Sr. Member
Posts: 14
Joined: 17 Mar 2013, 13:27

How to replicate a c# generic LIST<T> Collection in modeller

Post by ctgarvey »

Hi Folks,
Ive gone through the help files, red & green books, but cannot figure out how to make an array of objects in the UAmodeller, like c#:

public List<PhaseClass_S88> LegitimatePhaseClasses = new List<PhaseClass_S88>();

I dont want to use subtyping. I want to implement a 'has a' aggregation relationship ir possibly string aggretation 'is composed of' . (Not an 'is a ' subtyping relationship)

A fixed size array of object <T> would be fine.
Arrays seem to be available only for datatypes and not for objecttypes.

Do i need a new nonhierarchical reference type based on HasTypeDefintion? I dont appear to get the option to enter in an array .

Theres a baseobjecttype called foldertype whereby i can change the object reference type to 'Organizes' Again, however, I dont see how this is related to an array.

any advice is appreciated. thanks.

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

Re: How to replicate a c# generic LIST<T> Collection in mode

Post by Support Team »

Hello,

In OPC UA fixed sized arrays of Objects are not defined.

If you want to add an array of Objects for an instance you have to add each Object explicitly.

If you want to define an ObjectType that contains an array of children, you can use the ModellingRule "OptionalPlaceholder" for the instance declaration.

OPC Spec:
The intention of the ModellingRule OptionalPlaceholder is to expose the information that a complex
TypeDefinition expects from instances of the TypeDefinition to add instances with specific
References without defining BrowseNames for the instances. For example, a Device might have a
Folder for DeviceParameters, and the DeviceParameters should be connected with a HasComponent
Reference. However, the names of the DeviceParameters are specific to the instances.

Best regards
Support Team

Post Reply