Skip to content

Compiling IJT Nodeset to C# not working properly, because of casting issues on a variable #196

@lrhess

Description

@lrhess

What i've done: Compiled https://github.com/OPCFoundation/UA-Nodeset/tree/latest/IJT/Base with the ModelCompiler.

Used this command

compile -version v105	-d2 /data/UA-Nodeset/IJT/Base/Opc.Ua.Ijt.Base.NodeSet2.xml,Opc.Ua.IJT.Base,ijt ^
					-d2 /data/UA-Nodeset/Schema/Opc.Ua.NodeSet2.xml,Opc.Ua,Opc.Ua ^
					-d2 /data/UA-Nodeset/DI/Opc.Ua.Di.NodeSet2.xml,Opc.Ua.Di,di ^
					-d2 /data/UA-Nodeset/AMB/Opc.Ua.AMB.NodeSet2.xml,Opc.Ua.Amb,amb ^
					-d2 /data/UA-Nodeset/Machinery/Opc.Ua.Machinery.NodeSet2.xml,Opc.Ua.Machinery,machinery ^
					-d2 /data/UA-Nodeset/Machinery/Result/Opc.Ua.Machinery.Result.NodeSet2.xml,Opc.Ua.Machinery.Result,result ^
					-c 	/data/UA-Nodeset/IJT/Base/Opc.Ua.Ijt.Base.NodeIds.csv ^
					-o2 /data/IJT/Base/ ^

This produces
image

Base type of Result Meta Data:
image

Issue:
As I know it's not possible to cast Typed Classes like BaseVariableState<T> between different Types from one to another. Doesnt matter if T is a derived type of the target T. The Whole type is always different.

Example would be:

BaseVariableState<Parent> parent = new();

//This is not allowed in C#
BaseVariableState<DerivedFromParent> castedType = (BaseVariableState<DerivedFromParent>)parent 

Am I doing something wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions