Skip to content

DataTypes.GetDataTypeId return node ID "i=22" instead of "i=887" for EUInformation #1679

@thomas-wirtz-bauman

Description

@thomas-wirtz-bauman

Type of Issue

  • Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Describe the Issue

The method NodeId GetDataTypeId(Type type) of DataTypes (DataTypes.Helpers.cs) returns the node ID "i=22" (Structure) when the type passed as argument is Opc.Ua.EUInformation. Why does it not return "i=887"?

GetDataTypeId calls TypeInfo.Construct(type) which does:

            ...
            // handle scalar.
            if (dimensions == null)
            {
                BuiltInType builtInType = GetBuiltInType(name);
            ...

builtInType is then null, and then TypeInfo.Construct(type) return the TypeInfo for BuiltInType.ExtensionObject:

                ...
                // check for encodeable object.
                if (typeof(IEncodeable).GetTypeInfo().IsAssignableFrom(systemType.GetTypeInfo()) || name == "IEncodeable")
                {
                    return new TypeInfo(BuiltInType.ExtensionObject, ValueRanks.Scalar);
                }

This leads to the node ID "i=22" due to the later call to NodeId GetDataTypeId(TypeInfo typeInfo).
Is this normal?

Environment:

  • OPC Package Release Version 1.4.367.42

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions