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.
How to replicate a c# generic LIST<T> Collection in modeller
Moderator: uamodeler
-
- Sr. Member
- Posts: 14
- Joined: 17 Mar 2013, 13:27
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: How to replicate a c# generic LIST<T> Collection in mode
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
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