Skip to content

Reference

OpcData Members

Defines an abstract base class of data objects used and provided in the ecosystem of a specific OPC UA Server.

Reference

OpcData Members ​

Type
OpcData
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Constructors ​

OpcData ​

protected · 2 overloads

OverloadDescription
OpcData()protected · since v2.32Initializes a new instance of the OpcData class.
OpcData(IOpcDataStore)protectedInitializes a new instance of the OpcData class using the dataStore specified.

OpcData() ​

protected · since v2.32

Initializes a new instance of the OpcData class.

csharp
protected OpcData()
vbnet
Protected Sub New()

OpcData(IOpcDataStore) ​

protected

Initializes a new instance of the OpcData class using the dataStore specified.

csharp
protected OpcData(IOpcDataStore dataStore)
vbnet
Protected Sub New(dataStore As IOpcDataStore)

Parameters

NameTypeDescription
dataStoreIOpcDataStoreThe IOpcDataStore of the object data to represent.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe dataStore is a null reference (Nothing in Visual Basic).

Properties ​

DataStore ​

protected

Gets the IOpcDataStore which contains the data of this OpcData instance.

csharp
protected IOpcDataStore DataStore { get; }
vbnet
Protected ReadOnly Property DataStore As IOpcDataStore

Property value

IOpcDataStore

An instance implementing the IOpcDataStore interface containing the object data represented by this OpcData instance.

Methods ​

Decode ​

static · 3 overloads

OverloadDescription
Decode<T>(OpcContext, byte[])static · since v2.40Converts the buffer specified to the T defined.
Decode<T>(OpcContext, Stream)static · since v2.40Converts the data in the stream specified to the T defined.
Decode<T>(OpcContext, OpcRawObject)static · since v2.58Converts the value specified to the T defined.

Exceptions (all overloads)

ExceptionCondition
OpcExceptionThe decoding has failed. For more details exception data.

Decode<T>(OpcContext, byte[]) ​

static · since v2.40

Converts the buffer specified to the T defined.

csharp
public static T Decode<T>(OpcContext context, byte[] buffer) where T : new()
vbnet
Public Shared Function Decode(Of T As New)(
    context As OpcContext,
    buffer As Byte()) As T

Type parameters

NameDescription
TThe type to decode with a default constructor.

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to decode the buffer.
bufferByte[]An array of byte values to decode.

Returns

T

A new instance of the type defined by T and decoded with the information in the buffer.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe context or buffer is a null reference (Nothing in Visual Basic).

Decode<T>(OpcContext, Stream) ​

static · since v2.40

Converts the data in the stream specified to the T defined.

csharp
public static T Decode<T>(OpcContext context, Stream stream) where T : new()
vbnet
Public Shared Function Decode(Of T As New)(
    context As OpcContext,
    stream As Stream) As T

Type parameters

NameDescription
TThe type to decode with a default constructor.

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to decode the stream data.
streamStreamA Stream its data is to be decoded.

Returns

T

A new instance of the type defined by T and decoded with the information in the stream.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe context or stream is a null reference (Nothing in Visual Basic).

Decode<T>(OpcContext, OpcRawObject) ​

static · since v2.58

Converts the value specified to the T defined.

csharp
public static T Decode<T>(
    OpcContext context,
    OpcRawObject value)
    where T : new()
vbnet
Public Shared Function Decode(Of T As New)(
    context As OpcContext,
    value As OpcRawObject) As T

Type parameters

NameDescription
TThe type to decode with a default constructor.

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to decode the value.
valueOpcRawObjectThe OpcRawObject to decode, either binary or XML encoded.

Returns

T

A new instance of the type defined by T and decoded with the information in the RawData of the value.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe context or value is a null reference (Nothing in Visual Basic).

DeepCopy ​

protected · virtual

Creates a copy of the current OpcData, which the SDK uses whenever it copies an encodable value of it.

csharp
protected virtual object DeepCopy()
vbnet
Protected Overridable Function DeepCopy() As Object

Returns

Object

A new object which is a copy of the current OpcData.

Remarks

The default implementation creates a shallow copy (see MemberwiseClone()). Override it to copy referenced objects too.

Encode ​

static · 2 overloads · since v2.58

OverloadDescription
Encode(OpcContext, object)static · since v2.58Encodes the value specified using its Binary encoding.
Encode(OpcContext, object, OpcEncodingType)static · since v2.58Encodes the value specified using its encoding of the encodingType specified.

Exceptions (all overloads)

ExceptionCondition
ArgumentNullExceptionThe context or value is a null reference (Nothing in Visual Basic).
OpcExceptionThe encoding has failed.

Encode(OpcContext, object) ​

static · since v2.58

Encodes the value specified using its Binary encoding.

csharp
public static OpcRawObject Encode(OpcContext context, object value)
vbnet
Public Shared Function Encode(
    context As OpcContext,
    value As Object) As OpcRawObject

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to encode the value.
valueObjectThe value of a structured data type to encode.

Returns

OpcRawObject

A new instance of the OpcRawObject class with the encoded value.

Exceptions

ExceptionCondition
ArgumentExceptionThe value is not the value of a structured data type or its data type does not state a binary encoding.

Encode(OpcContext, object, OpcEncodingType) ​

static · since v2.58

Encodes the value specified using its encoding of the encodingType specified.

csharp
public static OpcRawObject Encode(
    OpcContext context,
    object value,
    OpcEncodingType encodingType)
vbnet
Public Shared Function Encode(
    context As OpcContext,
    value As Object,
    encodingType As OpcEncodingType) As OpcRawObject

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to encode the value.
valueObjectThe value of a structured data type to encode.
encodingTypeOpcEncodingTypeOne of the members defined by the OpcEncodingType enumeration which states the encoding to use.

Returns

OpcRawObject

A new instance of the OpcRawObject class with the encoded value.

Exceptions

ExceptionCondition
ArgumentExceptionThe value is not the value of a structured data type or its data type does not state an encoding of the encodingType.

GetDataStore ​

protected · virtual · since v2.32

Retrieves the IOpcDataStore which contains the data of this OpcData instance.

csharp
protected virtual IOpcDataStore GetDataStore()
vbnet
Protected Overridable Function GetDataStore() As IOpcDataStore

Returns

IOpcDataStore

The IOpcDataStore which contains the data of this OpcData instance. The default implementation returns the data store passed to the constructor.

Remarks

The DataStore property calls this method once, on its first access, if no data store was passed to the constructor. Override it to provide the data store on demand.

GetType ​

static

Retrieves the Type which implementes the data type which is identified by the typeId specified.

csharp
public static Type GetType(OpcNodeId typeId)
vbnet
Public Shared Function [GetType](typeId As OpcNodeId) As Type

Parameters

NameTypeDescription
typeIdOpcNodeIdThe OpcNodeId which identifies the Type to retrieve.

Returns

Type

The Type which is known under the typeId specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known Type which is associated with the typeId specified.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe typeId is a null reference (Nothing in Visual Basic).

GetTypeInfo ​

static · 4 overloads

OverloadDescription
GetTypeInfo<T>()staticRetrieves the OpcDataTypeInfo which declares the data type implemented by the T specified.
GetTypeInfo(OpcEncoding)staticRetrieves the OpcDataTypeInfo which declares the data type which is identified by the encoding specified.
GetTypeInfo(OpcNodeId)staticRetrieves the OpcDataTypeInfo which declares the data type which is identified by the typeId specified.
GetTypeInfo(Type)staticRetrieves the OpcDataTypeInfo which declares the data type implemented by the underlyingType specified.

GetTypeInfo<T>() ​

static

Retrieves the OpcDataTypeInfo which declares the data type implemented by the T specified.

csharp
public static OpcDataTypeInfo GetTypeInfo<T>()
vbnet
Public Shared Function GetTypeInfo(Of T)() As OpcDataTypeInfo

Type parameters

NameDescription
TThe Type which implements the OpcDataTypeInfo to retrieve.

Returns

OpcDataTypeInfo

The OpcDataTypeInfo which declares the T specified or a null reference (Nothing in Visual Basic) if there isn't a OpcDataTypeInfo associated with the T specified.

GetTypeInfo(OpcEncoding) ​

static

Retrieves the OpcDataTypeInfo which declares the data type which is identified by the encoding specified.

csharp
public static OpcDataTypeInfo GetTypeInfo(OpcEncoding encoding)
vbnet
Public Shared Function GetTypeInfo(encoding As OpcEncoding) As OpcDataTypeInfo

Parameters

NameTypeDescription
encodingOpcEncodingThe OpcEncoding which identifies the OpcDataTypeInfo to retrieve.

Returns

OpcDataTypeInfo

The OpcDataTypeInfo which is known under the encoding specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known OpcDataTypeInfo which is associated with the encoding specified.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe encoding is a null reference (Nothing in Visual Basic).

GetTypeInfo(OpcNodeId) ​

static

Retrieves the OpcDataTypeInfo which declares the data type which is identified by the typeId specified.

csharp
public static OpcDataTypeInfo GetTypeInfo(OpcNodeId typeId)
vbnet
Public Shared Function GetTypeInfo(typeId As OpcNodeId) As OpcDataTypeInfo

Parameters

NameTypeDescription
typeIdOpcNodeIdThe OpcNodeId which identifies the OpcDataTypeInfo to retrieve.

Returns

OpcDataTypeInfo

The OpcDataTypeInfo which is known under the typeId specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known OpcDataTypeInfo which is associated with the typeId specified.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe typeId is a null reference (Nothing in Visual Basic).

GetTypeInfo(Type) ​

static

Retrieves the OpcDataTypeInfo which declares the data type implemented by the underlyingType specified.

csharp
public static OpcDataTypeInfo GetTypeInfo(Type underlyingType)
vbnet
Public Shared Function GetTypeInfo(underlyingType As Type) As OpcDataTypeInfo

Parameters

NameTypeDescription
underlyingTypeTypeThe Type which implements the OpcDataTypeInfo to retrieve.

Returns

OpcDataTypeInfo

The OpcDataTypeInfo which declares the underlyingType specified or a null reference (Nothing in Visual Basic) if there isn't a OpcDataTypeInfo associated with the underlyingType specified.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe underlyingType is a null reference (Nothing in Visual Basic).

New ​

static

Creates a new instance of the OpcDataObject class using the dataType specified.

csharp
public static OpcDataObject New(OpcDataTypeInfo dataType)
vbnet
Public Shared Function [New](dataType As OpcDataTypeInfo) As OpcDataObject

Parameters

NameTypeDescription
dataTypeOpcDataTypeInfoThe OpcDataTypeInfo which declares the type of data type instance the new OpcDataObject shall represent.

Returns

OpcDataObject

An instance of the OpcDataObject which can be used to dynamically access data type instance information.

Exceptions

ExceptionCondition
ArgumentExceptionThe dataType is not a structured data type (see IsStruct).
ArgumentNullExceptionThe dataType is a null reference (Nothing in Visual Basic).

NewArray ​

static

Creates a one-dimensional array of OpcDataObject objects using the dataType and length with zero-based indexing.

csharp
public static OpcDataObject[] NewArray(OpcDataTypeInfo dataType, int length)
vbnet
Public Shared Function NewArray(
    dataType As OpcDataTypeInfo,
    length As Integer) As OpcDataObject()

Parameters

NameTypeDescription
dataTypeOpcDataTypeInfoThe OpcDataTypeInfo which declares the type of data type instance the new OpcDataObject shall represent.
lengthInt32An size of the array to create.

Returns

OpcDataObject[]

A new one-dimensional array of OpcDataObject instances which can be used to dynamically access array-based data type information

Exceptions

ExceptionCondition
ArgumentExceptionThe dataType is not a structured data type (see IsStruct).
ArgumentNullExceptionThe dataType is a null reference (Nothing in Visual Basic).

RegisterType ​

static · 6 overloads

OverloadDescription
RegisterType<T>()staticRegisters the type defined by T as the data object type to create in case there a data instance is to be created for the type definition identified by the OpcDataTypeAttribute defined on the T specified.
RegisterType(Type)static · since v2.14Registers the dataType specified as the data object type to create in case there a data instance is to be created for the type definition identified by the OpcDataTypeAttribute defined on the dataType specified.
RegisterType<T>(OpcNodeId)staticRegisters the type defined by T as the data object type to create in case there a data instance is to be created for the type definition identified by the dataTypeId specified.
RegisterType(Type, OpcNodeId)static · since v2.14Registers the dataType specified as the data object type to create in case there a data instance is to be created for the type definition identified by the dataTypeId specified.
RegisterType<T>(OpcNodeId, params OpcEncoding[])staticRegisters the type defined by T as the data object type to create in case there a data instance is to be created for the type definition identified by the dataTypeId or by one of the dataTypeEncodings specified.
RegisterType(Type, OpcNodeId, params OpcEncoding[])static · since v2.14Registers the dataType specified as the data object type to create in case there a data instance is to be created for the type definition identified by the dataTypeId or by one of the dataTypeEncodings specified.

RegisterType<T>() ​

static

Registers the type defined by T as the data object type to create in case there a data instance is to be created for the type definition identified by the OpcDataTypeAttribute defined on the T specified.

csharp
public static void RegisterType<T>()
vbnet
Public Shared Sub RegisterType(Of T)()

Type parameters

NameDescription
TThe type to use in case there a data object for the data definition equals to the data type identifier defined using the OpcDataTypeAttribute is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface and then needs to be a subclass of the OpcData class.

Exceptions

ExceptionCondition
ArgumentExceptionThe type T does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface or any data type specific attribute offers invalid information about the data type to associate with the Type.

RegisterType(Type) ​

static · since v2.14

Registers the dataType specified as the data object type to create in case there a data instance is to be created for the type definition identified by the OpcDataTypeAttribute defined on the dataType specified.

csharp
public static void RegisterType(Type dataType)
vbnet
Public Shared Sub RegisterType(dataType As Type)

Parameters

NameTypeDescription
dataTypeTypeThe Type to use in case there a data object for the data type definition equals to the data type identifier defined using the OpcDataTypeAttribute is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface and then needs to be a subclass of the OpcData class.

Exceptions

ExceptionCondition
ArgumentExceptionThe dataType does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface or any data type specific attribute offers invalid information about the data type to associate with the Type.
ArgumentNullExceptionThe dataType is a null reference (Nothing in Visual Basic).

RegisterType<T>(OpcNodeId) ​

static

Registers the type defined by T as the data object type to create in case there a data instance is to be created for the type definition identified by the dataTypeId specified.

csharp
public static void RegisterType<T>(OpcNodeId dataTypeId)
vbnet
Public Shared Sub RegisterType(Of T)(dataTypeId As OpcNodeId)

Type parameters

NameDescription
TThe type to use in case there a data object for the data definition equals to dataTypeId is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface and then needs to be a subclass of the OpcData class.

Parameters

NameTypeDescription
dataTypeIdOpcNodeIdThe identifier of the type definition for which the T is to be used to create a data object instance.

Exceptions

ExceptionCondition
ArgumentExceptionThe type T does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface or any data type specific attribute offers invalid information about the data type to associate with the Type.
ArgumentNullExceptionThe dataTypeId is a null reference (Nothing in Visual Basic).

Remarks

It is not possible to register the same or a different data type for the dataTypeId specified as long there is already a data type registered for the type definition specified by dataTypeId.

RegisterType(Type, OpcNodeId) ​

static · since v2.14

Registers the dataType specified as the data object type to create in case there a data instance is to be created for the type definition identified by the dataTypeId specified.

csharp
public static void RegisterType(Type dataType, OpcNodeId dataTypeId)
vbnet
Public Shared Sub RegisterType(dataType As Type, dataTypeId As OpcNodeId)

Parameters

NameTypeDescription
dataTypeTypeThe Type to use in case there a data object for the data type definition equals to dataTypeId is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface and then needs to be a subclass of the OpcData class.
dataTypeIdOpcNodeIdThe identifier of the type definition for which the dataType is to be used to create a data object instance.

Exceptions

ExceptionCondition
ArgumentExceptionThe dataType does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface or any data type specific attribute offers invalid information about the data type to associate with the Type.
ArgumentNullExceptionThe dataType or dataTypeId is a null reference (Nothing in Visual Basic).

Remarks

It is not possible to register the same or a different data type for the dataTypeId specified as long there is already a data type registered for the type definition specified by dataTypeId.

RegisterType<T>(OpcNodeId, params OpcEncoding[]) ​

static

Registers the type defined by T as the data object type to create in case there a data instance is to be created for the type definition identified by the dataTypeId or by one of the dataTypeEncodings specified.

csharp
public static void RegisterType<T>(
    OpcNodeId dataTypeId,
    params OpcEncoding[] dataTypeEncodings)
vbnet
Public Shared Sub RegisterType(Of T)(
    dataTypeId As OpcNodeId,
    ParamArray dataTypeEncodings As OpcEncoding())

Type parameters

NameDescription
TThe type to use in case there a data object for the data definition equals to dataTypeId or equals to one of the dataTypeEncodings specified is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface and then needs to be a subclass of the OpcData class.

Parameters

NameTypeDescription
dataTypeIdOpcNodeIdThe identifier of the type definition for which the T is to be used to create a data object instance.
dataTypeEncodingsparams OpcEncoding[]An array of OpcEncoding instances identifying the different encodings supported by the T specified. Using OpcEncoding instances enables the possibility to define OpcEncodingType specific identifiers to use to identify the according encoding information required to encode or decode the data object information.

Exceptions

ExceptionCondition
ArgumentExceptionThe type T does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface or any data type specific attribute offers invalid information about the data type to associate with the Type.
ArgumentNullExceptionThe dataTypeId or dataTypeEncodings or one of its items is a null reference (Nothing in Visual Basic).

RegisterType(Type, OpcNodeId, params OpcEncoding[]) ​

static · since v2.14

Registers the dataType specified as the data object type to create in case there a data instance is to be created for the type definition identified by the dataTypeId or by one of the dataTypeEncodings specified.

csharp
public static void RegisterType(
    Type dataType,
    OpcNodeId dataTypeId,
    params OpcEncoding[] dataTypeEncodings)
vbnet
Public Shared Sub RegisterType(
    dataType As Type,
    dataTypeId As OpcNodeId,
    ParamArray dataTypeEncodings As OpcEncoding())

Parameters

NameTypeDescription
dataTypeTypeThe Type to use in case there a data object for the data type definition equals to the data type identifier defined using the OpcDataTypeAttribute is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface and then needs to be a subclass of the OpcData class.
dataTypeIdOpcNodeIdThe identifier of the type definition for which the dataType is to be used to create a data object instance.
dataTypeEncodingsparams OpcEncoding[]An array of OpcEncoding instances identifying the different encodings supported by the dataType specified. Using OpcEncoding instances enables the possibility to define OpcEncodingType specific identifiers to use to identify the according encoding information required to encode or decode the data object information.

Exceptions

ExceptionCondition
ArgumentExceptionThe type dataType does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface or any data type specific attribute offers invalid information about the data type to associate with the Type.
ArgumentNullExceptionThe dataType, dataTypeId or dataTypeEncodings or one of its items is a null reference (Nothing in Visual Basic).

RegisterTypeMapper ​

static · 2 overloads · since v2.27

OverloadDescription
RegisterTypeMapper<T>()static · since v2.27Registers the T implementing the IOpcDataTypeMapper interface as a custom mapper for data types.
RegisterTypeMapper(IOpcDataTypeMapper)static · since v2.27Registers the mapper as a custom mapper for data types.

RegisterTypeMapper<T>() ​

static · since v2.27

Registers the T implementing the IOpcDataTypeMapper interface as a custom mapper for data types.

csharp
public static void RegisterTypeMapper<T>() where T : IOpcDataTypeMapper, new()
vbnet
Public Shared Sub RegisterTypeMapper(Of T As {IOpcDataTypeMapper, New})()

Type parameters

NameDescription
TThe type implementing the IOpcDataTypeMapper interface and providing a default constructor.

Exceptions

ExceptionCondition
ArgumentExceptionThe T does not inherit from OpcDataTypeMapper nor defines any OpcDataTypeMapperAttribute to indicate which types are mapped to each other.

RegisterTypeMapper(IOpcDataTypeMapper) ​

static · since v2.27

Registers the mapper as a custom mapper for data types.

csharp
public static void RegisterTypeMapper(IOpcDataTypeMapper mapper)
vbnet
Public Shared Sub RegisterTypeMapper(mapper As IOpcDataTypeMapper)

Parameters

NameTypeDescription
mapperIOpcDataTypeMapperThe IOpcDataTypeMapper to register.

Exceptions

ExceptionCondition
ArgumentExceptionThe mapper does not inherit from OpcDataTypeMapper nor defines any OpcDataTypeMapperAttribute to indicate which types are mapped to each other.
ArgumentNullExceptionThe mapper is a null reference (Nothing in Visual Basic).

RegisterTypes ​

static · 3 overloads

OverloadDescription
RegisterTypes(Assembly)staticRegisters all non-abstract types in the assembly specified which defines the OpcDataTypeAttribute.
RegisterTypes(IEnumerable<Type>)staticRegisters the dataTypes specified as the data object type to create in case there a data instance is to be created for the type definitions identified by the OpcEventTypeAttribute used on one of the dataTypes specified.
RegisterTypes(Type, params Type[])staticRegisters the dataType and the further specified dataTypes as the data object type to create in case there a data instance is to be created for the type definition identified by the OpcDataTypeAttribute used on the dataType or on one of the dataTypes specified.

Exceptions (all overloads)

ExceptionCondition
ArgumentExceptionA Type does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface or any data type specific attribute offers invalid information about the data type to associate with the Type.

RegisterTypes(Assembly) ​

static

Registers all non-abstract types in the assembly specified which defines the OpcDataTypeAttribute.

csharp
public static void RegisterTypes(Assembly assembly)
vbnet
Public Shared Sub RegisterTypes(assembly As Assembly)

Parameters

NameTypeDescription
assemblyAssemblyThe Assembly its types are inspected for types which using the OpcDataTypeAttribute.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe assembly is a null reference (Nothing in Visual Basic).

Remarks

The Type instances to register need to define the OpcDataTypeAttribute and either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the IOpcDataStore interface and then needs to be a subclass of the OpcData class.

RegisterTypes(IEnumerable<Type>) ​

static

Registers the dataTypes specified as the data object type to create in case there a data instance is to be created for the type definitions identified by the OpcEventTypeAttribute used on one of the dataTypes specified.

csharp
public static void RegisterTypes(IEnumerable<Type> dataTypes)
vbnet
Public Shared Sub RegisterTypes(dataTypes As IEnumerable(Of Type))

Parameters

NameTypeDescription
dataTypesIEnumerable<Type>A sequence of Type instances representing the types to use in case there a data object for the data definition equals to the data type identifier defined using the OpcDataTypeAttribute is to be created.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe dataTypes is a null reference (Nothing in Visual Basic).

Remarks

Any null reference (Nothing in Visual Basic) in dataTypes is ignored.

RegisterTypes(Type, params Type[]) ​

static

Registers the dataType and the further specified dataTypes as the data object type to create in case there a data instance is to be created for the type definition identified by the OpcDataTypeAttribute used on the dataType or on one of the dataTypes specified.

csharp
public static void RegisterTypes(Type dataType, params Type[] dataTypes)
vbnet
Public Shared Sub RegisterTypes(
    dataType As Type,
    ParamArray dataTypes As Type())

Parameters

NameTypeDescription
dataTypeTypeThe Type instance to use in case there a data object for the data definition equals to the data type identifier defined using the OpcDataTypeAttribute is to be created.
dataTypesparams Type[]An array of additional Type instances to use in case there a data object for the data definitions equals to the data type identifier defined using the OpcDataTypeAttribute is to be created.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe dataType or dataTypes is a null reference (Nothing in Visual Basic).

ShallowCopy ​

protected · virtual

Creates a shallow copy of the current OpcData.

csharp
protected virtual object ShallowCopy()
vbnet
Protected Overridable Function ShallowCopy() As Object

Returns

Object

A new object which is a shallow copy of the current OpcData.

ToExtension ​

static · since v2.40

Wraps the instance into an ExtensionObject, so that it can be encoded as the instance of its data type.

csharp
public static ExtensionObject ToExtension(object instance)
vbnet
Public Shared Function ToExtension(instance As Object) As ExtensionObject

Parameters

NameTypeDescription
instanceObjectThe instance of a data type to wrap.

Returns

ExtensionObject

A new ExtensionObject whose body holds the instance wrapped for the encoding (see To), or the instance itself if it already is an ExtensionObject.

TryGetTypeMapper ​

static · 3 overloads · since v2.27

OverloadDescription
TryGetTypeMapper<TSource>(out IOpcDataTypeMapper)static · since v2.27Determines the IOpcDataTypeMapper associated with the type specified by TSource.
TryGetTypeMapper(Type, out IOpcDataTypeMapper)static · since v2.27Determines the IOpcDataTypeMapper associated with the type specified by sourceType.
TryGetTypeMapper(Type, out IOpcDataTypeMapper, out Type)static · since v2.27Determines the IOpcDataTypeMapper associated with the type specified by sourceType and the resulting targetType.

TryGetTypeMapper<TSource>(out IOpcDataTypeMapper) ​

static · since v2.27

Determines the IOpcDataTypeMapper associated with the type specified by TSource.

csharp
public static bool TryGetTypeMapper<TSource>(out IOpcDataTypeMapper mapper)
vbnet
Public Shared Function TryGetTypeMapper(Of TSource)(
    mapper As IOpcDataTypeMapper) As Boolean

Type parameters

NameDescription
TSourceThe Type its mapper is to be determined.

Parameters

NameTypeDescription
mapperout IOpcDataTypeMapperThe IOpcDataTypeMapper which is responsible for object's of the type specified by TSource or a null reference (Nothing in Visual Basic) if there does not exist a mapper for the type specified by TSource.

Returns

Boolean

The value true if a mapper exists for the type specified by the TSource type; otherwise the value false.

TryGetTypeMapper(Type, out IOpcDataTypeMapper) ​

static · since v2.27

Determines the IOpcDataTypeMapper associated with the type specified by sourceType.

csharp
public static bool TryGetTypeMapper(
    Type sourceType,
    out IOpcDataTypeMapper mapper)
vbnet
Public Shared Function TryGetTypeMapper(
    sourceType As Type,
    mapper As IOpcDataTypeMapper) As Boolean

Parameters

NameTypeDescription
sourceTypeTypeThe Type its mapper is to be determined.
mapperout IOpcDataTypeMapperThe IOpcDataTypeMapper which is responsible for object's of the type specified by sourceType or a null reference (Nothing in Visual Basic) if there does not exist a mapper for the type specified by sourceType.

Returns

Boolean

The value true if a mapper exists for the type specified by sourceType; otherwise the value false.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe sourceType is a null reference (Nothing in Visual Basic).

TryGetTypeMapper(Type, out IOpcDataTypeMapper, out Type) ​

static · since v2.27

Determines the IOpcDataTypeMapper associated with the type specified by sourceType and the resulting targetType.

csharp
public static bool TryGetTypeMapper(
    Type sourceType,
    out IOpcDataTypeMapper mapper,
    out Type targetType)
vbnet
Public Shared Function TryGetTypeMapper(
    sourceType As Type,
    mapper As IOpcDataTypeMapper,
    targetType As Type) As Boolean

Parameters

NameTypeDescription
sourceTypeTypeThe Type its mapper is to be determined.
mapperout IOpcDataTypeMapperThe IOpcDataTypeMapper which is responsible for object's of the type specified by sourceType or a null reference (Nothing in Visual Basic) if there does not exist a mapper for the type specified by sourceType.
targetTypeout TypeThe Type the sourceType is mapped to by the associated mapper or a null reference (Nothing in Visual Basic) if there does not exist a mapper for the type specified by sourceType.

Returns

Boolean

The value true if a mapper exists for the type specified by sourceType; otherwise the value false.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe sourceType is a null reference (Nothing in Visual Basic).

UnregisterType ​

static · 3 overloads

OverloadDescription
UnregisterType<T>()staticUnregisters the previously registered (see RegisterType) type defined by T as the object type to not longer create for the type definition identified by the OpcDataTypeAttribute defined on the T specified.
UnregisterType<T>(OpcNodeId)staticUnregisters the previously registered (see RegisterType) type defined by T as the object type to not longer create for the type definition identified by the dataTypeId specified.
UnregisterType<T>(OpcNodeId, params OpcEncoding[])staticUnregisters the previously registered (see RegisterType) type defined by T as the object type to not longer create for the type definition identified by the dataTypeId or by one of the dataTypeEncodings specified.

UnregisterType<T>() ​

static

Unregisters the previously registered (see RegisterType) type defined by T as the object type to not longer create for the type definition identified by the OpcDataTypeAttribute defined on the T specified.

csharp
public static void UnregisterType<T>()
vbnet
Public Shared Sub UnregisterType(Of T)()

Type parameters

NameDescription
TThe data type to unregister for the data definition equals to data type identifier defined using the OpcDataTypeAttribute.

UnregisterType<T>(OpcNodeId) ​

static

Unregisters the previously registered (see RegisterType) type defined by T as the object type to not longer create for the type definition identified by the dataTypeId specified.

csharp
public static void UnregisterType<T>(OpcNodeId dataTypeId)
vbnet
Public Shared Sub UnregisterType(Of T)(dataTypeId As OpcNodeId)

Type parameters

NameDescription
TThe data type to unregister for the data definition equals to dataTypeId.

Parameters

NameTypeDescription
dataTypeIdOpcNodeIdThe identifier of the type definition for which the T is to be unregistered.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe dataTypeId is a null reference (Nothing in Visual Basic).

UnregisterType<T>(OpcNodeId, params OpcEncoding[]) ​

static

Unregisters the previously registered (see RegisterType) type defined by T as the object type to not longer create for the type definition identified by the dataTypeId or by one of the dataTypeEncodings specified.

csharp
public static void UnregisterType<T>(
    OpcNodeId dataTypeId,
    params OpcEncoding[] dataTypeEncodings)
vbnet
Public Shared Sub UnregisterType(Of T)(
    dataTypeId As OpcNodeId,
    ParamArray dataTypeEncodings As OpcEncoding())

Type parameters

NameDescription
TThe data type to unregister for the data definition equals to dataTypeId or one of the dataTypeEncodings.

Parameters

NameTypeDescription
dataTypeIdOpcNodeIdThe identifier of the type definition for which the T is to be unregistered.
dataTypeEncodingsparams OpcEncoding[]An array of OpcEncoding instances identifying the different encodings supported by the T specified for which the T is to be unregistered as well.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe dataTypeId or dataTypeEncodings or one of its items is a null reference (Nothing in Visual Basic).

UnregisterTypeMapper ​

static · 2 overloads · since v2.27

OverloadDescription
UnregisterTypeMapper<T>()static · since v2.27Unregisters the T implementing the IOpcDataTypeMapper interface as a custom mapper for data types.
UnregisterTypeMapper(IOpcDataTypeMapper)static · since v2.27Unregisters the mapper as a custom mapper for data types.

UnregisterTypeMapper<T>() ​

static · since v2.27

Unregisters the T implementing the IOpcDataTypeMapper interface as a custom mapper for data types.

csharp
public static void UnregisterTypeMapper<T>() where T : IOpcDataTypeMapper, new()
vbnet
Public Shared Sub UnregisterTypeMapper(Of T As {IOpcDataTypeMapper, New})()

Type parameters

NameDescription
TThe type implementing the IOpcDataTypeMapper interface.

Exceptions

ExceptionCondition
ArgumentExceptionThe T does not inherit from OpcDataTypeMapper nor defines any OpcDataTypeMapperAttribute to indicate which types are mapped to each other.

UnregisterTypeMapper(IOpcDataTypeMapper) ​

static · since v2.27

Unregisters the mapper as a custom mapper for data types.

csharp
public static void UnregisterTypeMapper(IOpcDataTypeMapper mapper)
vbnet
Public Shared Sub UnregisterTypeMapper(mapper As IOpcDataTypeMapper)

Parameters

NameTypeDescription
mapperIOpcDataTypeMapperThe IOpcDataTypeMapper to unregister.

Exceptions

ExceptionCondition
ArgumentExceptionThe mapper does not inherit from OpcDataTypeMapper nor defines any OpcDataTypeMapperAttribute to indicate which types are mapped to each other.
ArgumentNullExceptionThe mapper is a null reference (Nothing in Visual Basic).

UnregisterTypes ​

static · 3 overloads

OverloadDescription
UnregisterTypes(Assembly)staticUnregisters all previously registered types (see RegisterTypes) in the assembly specified.
UnregisterTypes(IEnumerable<Type>)staticUnregisters the previously registered (see RegisterTypes) dataTypes specified.
UnregisterTypes(Type, params Type[])staticUnregisters the previously registered dataType and the further specified dataTypes (see RegisterTypes).

UnregisterTypes(Assembly) ​

static

Unregisters all previously registered types (see RegisterTypes) in the assembly specified.

csharp
public static void UnregisterTypes(Assembly assembly)
vbnet
Public Shared Sub UnregisterTypes(assembly As Assembly)

Parameters

NameTypeDescription
assemblyAssemblyThe Assembly its types are inspected for types using the OpcDataTypeAttribute.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe assembly is a null reference (Nothing in Visual Basic).

UnregisterTypes(IEnumerable<Type>) ​

static

Unregisters the previously registered (see RegisterTypes) dataTypes specified.

csharp
public static void UnregisterTypes(IEnumerable<Type> dataTypes)
vbnet
Public Shared Sub UnregisterTypes(dataTypes As IEnumerable(Of Type))

Parameters

NameTypeDescription
dataTypesIEnumerable<Type>A sequence of Type instances to unregister for the data definitions equals to the data type identifiers defined using the OpcDataTypeAttribute.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe dataTypes is a null reference (Nothing in Visual Basic).

UnregisterTypes(Type, params Type[]) ​

static

Unregisters the previously registered dataType and the further specified dataTypes (see RegisterTypes).

csharp
public static void UnregisterTypes(Type dataType, params Type[] dataTypes)
vbnet
Public Shared Sub UnregisterTypes(
    dataType As Type,
    ParamArray dataTypes As Type())

Parameters

NameTypeDescription
dataTypeTypeThe Type instance to unregister for the data definitions equals to the data type identifiers defined using the OpcDataTypeAttribute.
dataTypesparams Type[]

Exceptions

ExceptionCondition
ArgumentNullExceptionThe dataType or dataTypes is a null reference (Nothing in Visual Basic).

Events ​

TypeResolve ​

static

Occurs when the resolution of a data type fails. Use this event to manually provide the Type to use for a specific data type definition identifier.

csharp
public static event OpcTypeResolveEventHandler TypeResolve
vbnet
Public Shared Event TypeResolve As OpcTypeResolveEventHandler

Event type

OpcTypeResolveEventHandler