Is the object type definition mandatory to define on object?|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
Is the object type definition mandatory to define on object?
Avatar
Indupriya C
Member
Members
Forum Posts: 3
Member Since:
01/11/2017
sp_UserOfflineSmall Offline
1
06/18/2019 - 04:24
sp_Permalink sp_Print

To create an object in the server, is it mandatory that object type definition having the variable types and other details are present?

Or is it ok to create object instance based on BaseObjectType?

In some cases a client processing the address space , may encounter objects which does not have the exact object type definitions. Some clients may depend on the type definitions to create the corresponding the types in the client system. If the type definition for an object is not present can the client safely say that this is an invalid configuration?

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
06/18/2019 - 07:41
sp_Permalink sp_Print sp_EditHistory

If a Type Node is referenced by an instance in the Server address space then the Type Node shall be in the Server address space.

However, Object instances that use BaseObjectType as their TypeDefinition are permitted and clients cannot assume that every component of an Object instance is specified by the TypeDefinition even when the TypeDefinition is a subtype of BaseObjectType.

i.e.

Lets say: ObjectTypeY -> { ChildA, ChildB }

then ObjectZ ->  {ChildA, ChildB, ChildC } is a valid instance of ObjectTypeY.

Avatar
Indupriya C
Member
Members
Forum Posts: 3
Member Since:
01/11/2017
sp_UserOfflineSmall Offline
3
06/18/2019 - 19:45
sp_Permalink sp_Print

In that case does ObjectZ has a linkage to ObjectTypeY? How can the client find that ObjectZ is of type ObjectTypeY?

If an object instance need not have a type definition then what is the use of the type definitions?

Looks like client has to depend on the object instance instead of types. Am I correct?

Consider the case when ObjectA has definition --> { Child1, Child2} . But the type definition of ObjectA is BaseObjectType. Is this a valid scenario?

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
06/18/2019 - 22:25
sp_Permalink sp_Print

If ObjectZ is a instance of ObjectTypeY then it will have a HasTypeDefinition reference to ObjectTypeY.

If ObjectZ has a HasTypeDefinition to BaseObjectType then it is not an instance of ObjectTypeY.

It is valid for ObjectZ to have a HasTypeDefinition to BaseObjectType, however, it is not recommended when there is a known structure that could be represented with an ObjectType if one was defined.

Avatar
Indupriya C
Member
Members
Forum Posts: 3
Member Since:
01/11/2017
sp_UserOfflineSmall Offline
5
06/19/2019 - 20:13
sp_Permalink sp_Print

In the above example you have given,

Lets say: ObjectTypeY -> { ChildA, ChildB }

then ObjectZ ->  {ChildA, ChildB, ChildC } is a valid instance of ObjectTypeY

ObjectZ is a valid type of ObjectTypeY even if it has an additional child which is not in ObjectTypeY .

Even if it is not recommended for objects to derive from BaseObjectType , it is allowed and the object can have child elements.

This makes it difficult for a client which depends on an object type to design the structure of an object in the client system.

Why OPC UA gives this flexibility to create object which is different from its object type?

Now object type only gives an idea on the final object instance and there is no rule as such which says object instance must have the same format as its type considering mandatory and optional parameters.

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
6
06/19/2019 - 22:13
sp_Permalink sp_Print

UA allows the flexibility because there are lot of places where it is needed.

For example, a Folder Object containing a set of Temperature sensors where the number and name of the Sensors are not known when the type model was being developed.

The flexibility should pose no problem for Clients because Clients programmed against ObjectTypeY should not care that addition instances are present. The Client can ignore extra nodes that it does not understand.

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