Skip to content

Reference

OpcDataObject Members

Provides a generic and dynamically accessible representation of structured data types.

Reference

OpcDataObject Members ​

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

Inherits members from OpcData.

Constructors ​

OpcDataObject ​

Initializes a new instance of the OpcDataObject class using the type information of the dataType specified.

csharp
public OpcDataObject(OpcDataTypeInfo dataType)
vbnet
Public Sub New(dataType As OpcDataTypeInfo)

Parameters

NameTypeDescription
dataTypeOpcDataTypeInfoThe OpcDataTypeInfo of the structured data type to represent.

Exceptions

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

Methods ​

GetField ​

Searches for the field with the specified name.

csharp
public OpcDataField GetField(string name)
vbnet
Public Function GetField(name As String) As OpcDataField

Parameters

NameTypeDescription
nameStringThe string containing the name of the data field to get.

Returns

OpcDataField

An instance of the OpcDataField representing the field with the specified name, if found; otherwise a null reference (Nothing in Visual Basic).

Remarks

The name specified is compared using Ordinal.

GetFields ​

Returns all the fields of the current OpcDataObject.

csharp
public OpcDataField[] GetFields()
vbnet
Public Function GetFields() As OpcDataField()

Returns

OpcDataField[]

An array of OpcDataField objects representing all the fields defined for the current OpcDataObject or an empty array of type OpcDataField if no fields are defined for the current OpcDataObject.

GetTypeInfo ​

Gets the OpcDataTypeInfo of the current structured data type instance represented.

csharp
public OpcDataTypeInfo GetTypeInfo()
vbnet
Public Function GetTypeInfo() As OpcDataTypeInfo

Returns

OpcDataTypeInfo

The OpcDataTypeInfo of the current structured data type instance.

HasField ​

Determines whether the current OpcDataObject provides a OpcDataField with the Name equals to the name specified.

csharp
public bool HasField(string name)
vbnet
Public Function HasField(name As String) As Boolean

Parameters

NameTypeDescription
nameStringThe string containing the name of the data field to test.

Returns

Boolean

The value true if there exists a OpcDataField with the name specified; otherwise the value false.

Remarks

The name specified is compared using Ordinal.

TryGetField ​

Searches for the field associated with the name specified.

csharp
public bool TryGetField(string name, out OpcDataField field)
vbnet
Public Function TryGetField(name As String, field As OpcDataField) As Boolean

Parameters

NameTypeDescription
nameStringThe string containing the name of the data field to get.
fieldout OpcDataFieldThe OpcDataField representing the field with the specified name, if found; otherwise a null reference (Nothing in Visual Basic).

Returns

Boolean

The value true if there exists a OpcDataField with the name specified (and field is set to that field); otherwise the value false.

Remarks

The name specified is compared using Ordinal.

Indexers ​

Item ​

2 overloads

OverloadDescription
this[int]since v2.18Gets the field at the index specified.
this[string]Gets the field associated with the specified name.

this[int] ​

since v2.18

Gets the field at the index specified.

csharp
public OpcDataField this[int index] { get; }
vbnet
Public ReadOnly Default Property this[](index As Integer) As OpcDataField

Parameters

NameTypeDescription
indexInt32The zero-based index which identifies the data field to get.

Property value

OpcDataField

An instance of the OpcDataField representing the field at the specified index, if existent; otherwise a null reference (Nothing in Visual Basic).

this[string] ​

Gets the field associated with the specified name.

csharp
public OpcDataField this[string name] { get; }
vbnet
Public ReadOnly Default Property this[](name As String) As OpcDataField

Parameters

NameTypeDescription
nameStringThe name of the data field to get.

Property value

OpcDataField

An instance of the OpcDataField representing the field with the specified name, if existent; otherwise a null reference (Nothing in Visual Basic).