Hello.
You might be mixing two things here. The article you linked to has to do with custom data types, which are data types not defined in the OPC UA specs. They are usually structures, but can also be enumerations, arrays, and more. The custom data types do not support inheritance.
The Duration, however, is an OPC UA type datatype defined in the spec. If you do not "know" it, you can use the fact that such types are part of inheritance hierarchy, and yes, Duration is based on Double (here we assume that your code"knows" what Double is, so that it can somehow make sense of that information; some information simply has to be hard-wired somewhere).
The inheritance is expressed in terms of HasSubType references between the nodes that represent datatypes. What you can do is as follows:
- Determine the datatype of the variable you are working it. This can be done by reading the DataType attribute of the variable node.
- Check if the datatype is one of those that you implicitly know. If so, you are done.
- If not, browse the current node for the HasSubType reference, specifying that you want to follow the reference in an inverse direction. This will give you the super-type of the current type (or it will give nothing - that is a failure in trying to find the usable datatype).
- Repeat from Step 2.
We have a UADataTypeIds static class that gives you Node IDs of all the standard OPC UA data types. So, UADataTypeIds.Duration, UADataTypeIds.Double etc. are all there.
I hope this helped somehow.
I would also welcome if you describe your case in broader terms. That is, why do you actually want to obtain this kind of information?
Best regards