Page 1 of 1

How to create an object with a children of type object-array

Posted: 23 Jan 2023, 15:20
by jramirez-jh
I'm trying to create an object type to define a machine, that machine have N inputs/output signals that I want to populate dynamically when the OPC-UA Server is starting.

I've already tried creating the signal definition as another object-type and also as a variable-type, but the object-type child can't be defined as an array, and in the other hand the child as variable-type can be marked as an array but the generated C# code creates the child as a single property, not as an array/list.

Could you please guide me on what is the proper way of doing this in the UAModeler?

Image

Re: How to create an object with a children of type object-array

Posted: 23 Jan 2023, 17:13
by Support Team
Hello,

Arrays of Objects or Variables can be modelled with ModellingRule of the instance declaration node.
The ModellingRule OptionPlaceholder represents a 0..n relationship, the ModellingRule MandatoryPlaceholder represents a 1..n relationship. This means that you define that an instances has some children with the same TypeDefinition than the instance declaration.
The nodes for the array elements need to be created at the instance explicitly.

Re: How to create an object with a children of type object-array

Posted: 23 Jan 2023, 19:15
by jramirez-jh
Thanks for the answer but unfortunatelly I'm not completely understanding the configuration. Is it possible you can provide me an Uamodeler example file?