View Issue Details

IDProjectCategoryView StatusLast Update
000925910000-005: Information ModelSpecpublic2023-12-05 20:49
ReporterBjarneBostrom Assigned ToJim Luth  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version1.05.02 
Summary0009259: Custom OptionSet-Structure types within UABinaryFileDataType, no way to know encoding id
Description

https://reference.opcfoundation.org/Core/Part5/v105/docs/12.36 UABinaryFileDataType that inherits the DataTypeSchemaHeader for the custom type definitions, https://reference.opcfoundation.org/Core/Part5/v105/docs/12.31 DataTypeSchemaHeader
"
enumDataTypes
EnumDescription[]
Description of Enumeration or OptionSet DataTypes used in the data that follows the DataTypeSchemaHeader.
DataType NodeIds for Enumeration or OptionSet DataTypes used in the data refer to entries in this array.
The EnumDescription DataType is defined in 12.34. "

Then, https://reference.opcfoundation.org/Core/Part5/v105/docs/12.34 for the EnumDescription
"
builtInType
Byte
The builtInType indicates if the DataType is an Enumeration or an OptionSet. If the builtInType is Int32, the DataType is an Enumeration. If the builtInType is one of the UInteger DataTypes or ExtensionObject, the DataType is an OptionSet. "

The ExtensionObject case i.e. where the EnumDescription defines a custom OptionSet-Structure type is problematic. There is no way that I can see (let me know if I missed) to know the encoding id, which is used when they are encoded in binary as ExtensionObject.

For the Structures with StructureDefinitions I assume the DefaultEncodingId is here used for the binary encoding id, but there is nothing like that in the EnumDefinition. When these are Read normally from the address space there are the HasEncoding Nodes, but no similar concept exists for these types in UABinaryFileDataType. Enumerations always use Int32, UInteger-based OptionSets use the base type, but Structure-OptionSets behave as Structures thus the encoding NodeId is needed for decoding/encoding the ExtensionObject.

Alternatively it could be ruled that no such custom OptionSet-Structure types are allowed within UABinaryFileDataType.

Or a custom spec-defined "fileHeader KeyValuePair[] The file-specific header. " KeyValuePair of something like "OptionSetStructureBinaryMappings" structure could be created.

Or do something weird and e.g. also include them within StructureDescriptions (so they would just "redefine" the 2 ByteString fields of 'OptionSet') and the only purpose would be to pass the DefaultEncodingId this way. NOTE! It is possible that this is what was intended in the first place, but if that was the case, this should be clarified.

P.S.
Note this is just an observation made while working on making support for UABinaryFileDataType, i.e. not an actual problem (at least not yet) for me.

TagsNo tags attached.
Commit Version
Fix Due Date

Activities

Jim Luth

2023-12-05 20:49

administrator   ~0020495

We believe some of this is clarified in 1.05.03 and the rest is not an issue.

Issue History

Date Modified Username Field Change
2023-11-13 12:39 BjarneBostrom New Issue
2023-12-05 20:49 Jim Luth Assigned To => Jim Luth
2023-12-05 20:49 Jim Luth Status new => closed
2023-12-05 20:49 Jim Luth Resolution open => no change required
2023-12-05 20:49 Jim Luth Note Added: 0020495