Mandatory sub-instance declarations|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Mandatory sub-instance declarations
Avatar
Nicola Orlandi
New Member
Members
Forum Posts: 2
Member Since:
03/06/2023
sp_UserOfflineSmall Offline
1
03/06/2023 - 07:28
sp_Permalink sp_Print

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

Avatar
Randy Armstrong
Admin
Forum Posts: 1457
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
03/06/2023 - 09:49
sp_Permalink sp_Print

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.

Avatar
Nicola Orlandi
New Member
Members
Forum Posts: 2
Member Since:
03/06/2023
sp_UserOfflineSmall Offline
3
03/06/2023 - 15:46
sp_Permalink sp_Print

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?

Avatar
Randy Armstrong
Admin
Forum Posts: 1457
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
03/06/2023 - 16:29
sp_Permalink sp_Print

Does the exception mean that Acceleration, which is mandatory, may be missing in MachineSubtype as in the example?

Yes, as long as the Acceleration is declared in the supertype.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 14
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1353
Posts: 4589