OpcData Members

Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll, Opc.UaFx.Advanced.dll
The OpcData type exposes the following members.

OpcData()

Initializes a new instance of the OpcData class.

C#

protected OpcData()

OpcData(IOpcDataStore)

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

C#

protected OpcData(IOpcDataStore dataStore)


Parameters

dataStore IOpcDataStore

The IOpcDataStore of the object data to represent.


Exceptions

ArgumentNullException

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

TypeResolve

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.

C#

public static event OpcTypeResolveEventHandler TypeResolve

DataStore

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

C#

protected IOpcDataStore DataStore { get; }


Property Value

IOpcDataStore

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

Decode<T>(OpcContext, byte[])

Converts the buffer specified to the T defined.

C#

public static T Decode<T>(OpcContext context, byte[] buffer) where T : new()


Parameters

context OpcContext

The OpcContext to use to decode the buffer.

buffer Byte[]

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

ArgumentNullException

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

OpcException

The decoding has failed. For more details exception data.

Decode<T>(OpcContext, Stream)

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

C#

public static T Decode<T>(OpcContext context, Stream stream) where T : new()


Parameters

context OpcContext

The OpcContext to use to decode the stream data.

stream Stream

A 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

ArgumentNullException

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

OpcException

The decoding has failed. For more details exception data.

DeepCopy()

C#

protected virtual object DeepCopy()


Returns

Object

GetDataStore()

C#

protected virtual IOpcDataStore GetDataStore()


Returns

IOpcDataStore

GetType(OpcNodeId)

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

C#

public static Type GetType(OpcNodeId typeId)


Parameters

typeId OpcNodeId

The 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

ArgumentNullException

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

GetTypeInfo(OpcEncoding)

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

C#

public static OpcDataTypeInfo GetTypeInfo(OpcEncoding encoding)


Parameters

encoding OpcEncoding

The 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

ArgumentNullException

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

GetTypeInfo(OpcNodeId)

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

C#

public static OpcDataTypeInfo GetTypeInfo(OpcNodeId typeId)


Parameters

typeId OpcNodeId

The 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

ArgumentNullException

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

GetTypeInfo(Type)

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

C#

public static OpcDataTypeInfo GetTypeInfo(Type underlyingType)


Parameters

underlyingType Type

The 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

ArgumentNullException

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

GetTypeInfo<T>()

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

C#

public static OpcDataTypeInfo GetTypeInfo<T>()


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.

New(OpcDataTypeInfo)

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

C#

public static OpcDataObject New(OpcDataTypeInfo dataType)


Parameters

dataType OpcDataTypeInfo

The 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

ArgumentException

The dataType is not a structured data type (see IsStruct).

ArgumentNullException

The dataType is a null reference (Nothing in Visual Basic).

NewArray(OpcDataTypeInfo, int)

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

C#

public static OpcDataObject[] NewArray(OpcDataTypeInfo dataType, int length)


Parameters

dataType OpcDataTypeInfo

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

length Int32

An 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

ArgumentException

The dataType is not a structured data type (see IsStruct).

ArgumentNullException

The dataType is a null reference (Nothing in Visual Basic).

RegisterType(Type)

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.

C#

public static void RegisterType(Type dataType)


Parameters

dataType Type

The 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

ArgumentException

The 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.

ArgumentNullException

The dataType is a null reference (Nothing in Visual Basic).

RegisterType(Type, OpcNodeId)

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.

C#

public static void RegisterType(Type dataType, OpcNodeId dataTypeId)


Parameters

dataType Type

The 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.

dataTypeId OpcNodeId

The identifier of the type definition for which the dataType is to be used to create a data object instance.



Exceptions

ArgumentException

The 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.

ArgumentNullException

The 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(Type, OpcNodeId, params OpcEncoding[])

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.

C#

public static void RegisterType(Type dataType, OpcNodeId dataTypeId, params OpcEncoding[] dataTypeEncodings)


Parameters

dataType Type

The 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.

dataTypeId OpcNodeId

The identifier of the type definition for which the dataType is to be used to create a data object instance.

dataTypeEncodings 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

ArgumentException

The 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.

ArgumentNullException

The dataType, dataTypeId or dataTypeEncodings or one of its items is a null reference (Nothing in Visual Basic).

RegisterType<T>()

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.

C#

public static void RegisterType<T>()



Exceptions

ArgumentException

The 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<T>(OpcNodeId)

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.

C#

public static void RegisterType<T>(OpcNodeId dataTypeId)


Parameters

dataTypeId OpcNodeId

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



Exceptions

ArgumentException

The 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.

ArgumentNullException

The 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[])

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.

C#

public static void RegisterType<T>(OpcNodeId dataTypeId, params OpcEncoding[] dataTypeEncodings)


Parameters

dataTypeId OpcNodeId

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

dataTypeEncodings 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

ArgumentException

The 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.

ArgumentNullException

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

RegisterTypeMapper(IOpcDataTypeMapper)

Registers the mapper as a custom mapper for data types.

C#

public static void RegisterTypeMapper(IOpcDataTypeMapper mapper)


Parameters

mapper IOpcDataTypeMapper

The IOpcDataTypeMapper to register.



Exceptions

ArgumentException

The mapper does not inherit from OpcDataTypeMapper nor defines any OpcDataTypeMapperAttribute to indicate which types are mapped to each other.

ArgumentNullException

The mapper is a null reference (Nothing in Visual Basic).

RegisterTypeMapper<T>()

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

C#

public static void RegisterTypeMapper<T>() where T : IOpcDataTypeMapper, new()



Exceptions

ArgumentException

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

RegisterTypes(Assembly)

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

C#

public static void RegisterTypes(Assembly assembly)


Parameters

assembly Assembly

The Assembly its types are inspected for types which using the OpcDataTypeAttribute.



Exceptions

ArgumentException

A 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.

ArgumentNullException

The 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>)

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.

C#

public static void RegisterTypes(IEnumerable<Type> dataTypes)


Parameters

dataTypes IEnumerable<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

ArgumentException

A 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.

ArgumentNullException

The 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[])

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.

C#

public static void RegisterTypes(Type dataType, params Type[] dataTypes)


Parameters

dataType Type

The 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.

dataTypes 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

ArgumentException

A 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.

ArgumentNullException

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

ShallowCopy()

C#

protected virtual object ShallowCopy()


Returns

Object

ToExtension(object)

C#

public static ExtensionObject ToExtension(object instance)


Parameters

instance Object



Returns

ExtensionObject

TryGetTypeMapper(Type, out IOpcDataTypeMapper)

Determines the IOpcDataTypeMapper associated with the type specified by sourceType.

C#

public static bool TryGetTypeMapper(Type sourceType, out IOpcDataTypeMapper mapper)


Parameters

sourceType Type

The Type its mapper is to be determined.

mapper IOpcDataTypeMapper

The 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

ArgumentNullException

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

TryGetTypeMapper(Type, out IOpcDataTypeMapper, out Type)

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

C#

public static bool TryGetTypeMapper(Type sourceType, out IOpcDataTypeMapper mapper, out Type targetType)


Parameters

sourceType Type

The Type its mapper is to be determined.

mapper IOpcDataTypeMapper

The 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.

targetType Type

The 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

ArgumentNullException

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

TryGetTypeMapper<TSource>(out IOpcDataTypeMapper)

Determines the IOpcDataTypeMapper associated with the type specified by TSource.

C#

public static bool TryGetTypeMapper<TSource>(out IOpcDataTypeMapper mapper)


Parameters

mapper IOpcDataTypeMapper

The 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.

UnregisterType<T>()

Unregisters the previously registered (see RegisterType´´1) 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.

C#

public static void UnregisterType<T>()

UnregisterType<T>(OpcNodeId)

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

C#

public static void UnregisterType<T>(OpcNodeId dataTypeId)


Parameters

dataTypeId OpcNodeId

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



Exceptions

ArgumentNullException

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

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

Unregisters the previously registered (see RegisterType´´1(OpcNodeId, OpcEncoding)) 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.

C#

public static void UnregisterType<T>(OpcNodeId dataTypeId, params OpcEncoding[] dataTypeEncodings)


Parameters

dataTypeId OpcNodeId

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

dataTypeEncodings 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

ArgumentNullException

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

UnregisterTypeMapper(IOpcDataTypeMapper)

Unregisters the mapper as a custom mapper for data types.

C#

public static void UnregisterTypeMapper(IOpcDataTypeMapper mapper)


Parameters

mapper IOpcDataTypeMapper

The IOpcDataTypeMapper to unregister.



Exceptions

ArgumentException

The mapper does not inherit from OpcDataTypeMapper nor defines any OpcDataTypeMapperAttribute to indicate which types are mapped to each other.

ArgumentNullException

The mapper is a null reference (Nothing in Visual Basic).

UnregisterTypeMapper<T>()

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

C#

public static void UnregisterTypeMapper<T>() where T : IOpcDataTypeMapper, new()



Exceptions

ArgumentException

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

UnregisterTypes(Assembly)

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

C#

public static void UnregisterTypes(Assembly assembly)


Parameters

assembly Assembly

The Assembly its types are inspected for types using the OpcDataTypeAttribute.



Exceptions

ArgumentNullException

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

UnregisterTypes(IEnumerable<Type>)

Unregisters the previously registered (see RegisterTypes(IEnumerable)) dataTypes specified.

C#

public static void UnregisterTypes(IEnumerable<Type> dataTypes)


Parameters

dataTypes IEnumerable<Type>

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



Exceptions

ArgumentNullException

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

UnregisterTypes(Type, params Type[])

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

C#

public static void UnregisterTypes(Type dataType, params Type[] dataTypes)


Parameters

dataType Type

The Type instance to unregister for the data definitions equals to the data type identifiers defined using the OpcDataTypeAttribute.

dataTypes Type[]




Exceptions

ArgumentNullException

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