Example: Configure Derived Data Types
OPC UA supports the inheritance of data types. To be able to use derived structures, you may need to perform additional configuration steps:
If the server defines, for example, the data type VehicleType, it might also define the derived types ElectricVehicleType and DieselVehicleType. Using a type query, it could then ensure that, in the model on the server, instances of electric vehicles can only be refuelled at an electric socket and diesel vehicles only at diesel pumps.
On the other hand, one service parking space could be used by both types. For an object that represents a service parking space, it therefore makes sense to allow a reference being serviced to a VehicleType, without requiring a specialization to ElectricVehicleType or DieselVehicleType. At runtime, when a vehicle is being serviced in the model, the actual type of the current instance can be queried.
If, in such a scenario, you use VehicleType to model the data types for which you require support and then, when browsing the server via the instance search, choose the data types by selecting the variables, only VehicleType is stored as the data type to be supported. If an instance of ElectricVehicleType is then stored there at runtime, the actual type is not recognized automatically.
To make this possible, you need to explicitly select the derived types that you want to use after selecting the data type VehicleType. To do this, browse the type hierarchy on the Types tab and select the types you want. This means that all the types that you want to use need to be known at design time.