I have been searching for information about how to face the problem I am about to explain but unfortunately I could not solve it.
I want to create an Object Programm of the ObjectType ProgrammType which contains an array of instances of ObjectType CommandType. The order of these commands objects within the Programm object is relevant.
I am using ModelDesign XML file for creating the information model. Regarding the information modelling of what I want to achieve, I have seen that a possibility could be using in the ProgrammType definition a ModellingRule "OptionalPlaceholder", although to be honest the usage of this ModellingRule is not totally clear to me.
So what I have done so far is adding as children a Object of type "CommandType" with ModellingRule "OptionalPlaceholder" to the ProgrammType definition. Then, in the instantation part, I am creating the Command objects, and finally I reference them with a "HasOrderedComponent" from the Programm object. I am not sure if this approach makes really sense and it is taking advante of the "OptionalPlaceholder" previously defined in the ProgrammType definition or not. In case this was not they right way to do it, plese let me know how it should be done.
From what I have understood, the "HasOrderedComponent" reference implies that the elements are always returned by the server in the same order.
I am generating from a ModelDesign XML file the UANodeSet XML file and then I am creating an Open62541 server with this NodeSet.
So my questions are:
1.) Is it my modelling approach right? Is there better ways of modelling what I describe at the beggining?
2.) When I retrieve from a client based on Open62541 the commands referenced with a "HasOrderedComponent" in the Programm object in the Open62541 server.
- Is it predictible in which order will they appear? Or the returned order will be always the same, but this order cannot be set.
- Will they be return in the order in which they were defined in the ModelDesign file?
- In case I created the nodes from code "manually" written by me. The return order of the commands would be the order in which the references were added within my code?
Thank you very much in advance! By the way, once I manage to succesfully model what I am working on, I could prepare a detailled explanation about how to model in OPC UA that could be used to extend the Open62541 documentation if you think it could be relevant.
Best regards