OPC Data Client contains definitions of certain OPC-UA node types that can be used with the modelling. Currently, these are the only node types supported, and the list cannot be extended. Future OPC Data Client versions will support the creation of use of custom node types with OPC-UA modelling.
The .NET classes for various OPC-UA node types use an inheritance scheme that follows the inheritance hierarchy in OPC-UA information model. The UABaseVariable is the root of this hierarchy; in itself, it derives from UAMappedNode, which means that it contains meta-information about itself, such as the EndpointDescriptor or NodeDescriptor, and also parameters that define details of operations that performed on the node – such as ReadParameters, or SubscriptionParameters and MonitoringParameters.
Each UABaseVariable contains properties that describe the state of the node either individually (Value, StatusCode, timestamps, …), or in a summary way (AttributeData). There are also properties that give information about errors encountered during the operations (Exception, ErrorId, ErrorMessage).
You can hook to AttributeDataChanged and ExceptionChanged events to get your code invoked whenever the relevant data of the OPC-UA variable changes.
The hierarchy of basic OPC-UA node type classes, and their most important members, are shown on the following diagram.
For use in Data Access, OPC-UA defines additional variable types, and they are reflected in OPC Data Client .NET node types as well. When working with OPC-UA Data Access modelling, you will most likely use at least one of the following classes: UAAnalogItemNode (for analog variables), UATwoStateDiscreteNode (for digital – Boolean variables), or UAMultiStateDiscreteNode (for enumeration-type variables).
The hierarchy of OPC-UA Data Access node type classes, and their most important members, are shown on the following diagram.
The classes contain members that correspond to OPC-UA properties defined for these kind of variables. For example, the Definition, ValuePrecision, EngineeringUnits, EURange etc. properties all contain information that further describes the variable. In addition, for discrete variables, the classes provide transformation between the “raw” values of the variable, and their string representation. The CurrentState property contains the current value of the variable, expressed as a string.