03/06/2023
Hello,
we often connect to servers or load NodeSet files, where there are instance declarations without mandatory sub-instance declarations.
I will try to explain with a simple example:
MotorType (ObjectType)
-> Speed (Variable, Mandatory)
-> Acceleration (Variable, Optional)
MachineType (ObjectType)
-> Motor1 (Variable, Mandatory)
In this case, MachineType has a mandatory instance declaration Motor1 of MotorType, but Motor1 lacks Speed, which is mandatory in MotorType.
From the OPC UA specification we understood that Motor1 in MachineType should also have Speed, as follows:
MachineType (ObjectType)
-> Motor1 (Variable, Mandatory)
-> Speed (Variable, Mandatory)
What is the correct definition of MachineType?
Is it allowed to have instance declarations that lack mandatory sub-instance declarations?
Is there a paragraph in the specification that explains this scenario?
Thanks
05/30/2017
If an instance is created then all mandatory children must be present.
The NodeSets are wrong.
The one exception to the rule can show up in the the type tree when a subtype overrides a child defined in the supertype. In this case, the subtype only explicitly declares child nodes that it is changing but all mandatory children must appear in the supertype where the instance is first declared.
03/06/2023
Thank you for your reply!
Just to see if I understood correctly the exception, I give a simple example:
MotorType (ObjectType)
-> Speed (Variable, Number, Mandatory)
-> Acceleration (Variable, Number, Mandatory)
MachineType (ObjectType)
-> Motor1 (MotorType, Mandatory)
-> Speed (Variable, Number, Mandatory)
-> Acceleration (Variable, Number, Mandatory)
MachineSubtype (MachineType)
-> Motor1 (MotorType, Mandatory)
-> Speed (Variable, Float, Mandatory)
MachineSubtype overrides the Speed variable of MachineType by changing the data type from Number to Float.
Does the exception mean that Acceleration, which is mandatory, may be missing in MachineSubtype as in the example?
1 Guest(s)