Question regarding StructureDefinition Structure [structureType]|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
Question regarding StructureDefinition Structure [structureType]
Avatar
Shubhi Gogna Shubhi Gogna
Member
Members
Forum Posts: 27
Member Since:
04/01/2014
sp_UserOfflineSmall Offline
1
01/05/2022 - 00:35
sp_Permalink sp_Print

Hi Randy,

I have following scenario for Structures and I wanted to understand what structureType should I consider in these scenarios.

- Base Structure with Optional Fields and Child Structure with no fields. 

As per my understanding, in this case, Base Structure Type is considered as StructureWithOptionalFields_1(Structure with optional fields). Should we also consider, Child Structure as StructureWithOptionalFields_1 as it does not have its own fields and all are derived from Base Structure.

In the same case, is it ever possible to have Base Structure as StructureWithOptionalFields_1 while Child Structure as Structure_0(A Structure without optional fields)??

On similar lines, another scenario is - Base Structure as Union_2. Should we always consider Child Structure as Union or can it be  StructureWithOptionalFields_1 or Structure_0.

 

I also wanted to understand, how to specify enum values in nodeSetFiles. It has been observed in several Companion Specs that Enum is specified as <enumname>name_0</enumname>.

Here in name_0, ‘name’ is the field name and ‘0’ is the value of that field. Is this correct as per the specification? Or, should it only contain 0 here.

 

Regards,

Shubhi Gogna

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
01/05/2022 - 01:31
sp_Permalink sp_Print

If a BaseType has optional fields then all subtypes have optional fields that they inherit from the BaseType even if the subtype has no new optional fields. The UA Binary encoding requires that a single bitmask is used for all optional fields in all subtypes.

Subtypes of unions are not permitted as per Part 3:

https://reference.opcfoundatio.....art3/8.41/

All union DataTypes shall inherit directly from this DataType.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
3
01/05/2022 - 01:35
sp_Permalink sp_Print sp_EditHistory

The _n conversion was adopted to allow XML encodings to preserve the number associated with the value because the XML schema has no place to specify a numeric value. It was NOT supposed to be specified in the NodeSet because the NodeSet has another field to specify the numeric Value. So CS that do this are not right (i think it was a bug in the tool they used to create the NodeSet).

The only place the name_x convention should appear in schema files is in the XML schema associated with a NodeSet.

Avatar
Shubhi Gogna Shubhi Gogna
Member
Members
Forum Posts: 27
Member Since:
04/01/2014
sp_UserOfflineSmall Offline
4
01/06/2022 - 06:55
sp_Permalink sp_Print

Thanks for your quick reply.

Sure, I will raise query to tool team. We have observed this in UAModeler from Unified Automation.

Regards,

Shubhi Gogna

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
5
01/06/2022 - 07:52
sp_Permalink sp_Print

Keep in mind that the enum handling is a convention rather than a requirement of the specification.

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