Skip to content

Reference

OpcStructField Members

Represents a field of a structure defined using OpcStruct.

Reference

OpcStructField Members ​

Type
OpcStructField
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0

Constructors ​

OpcStructField ​

2 overloads

OverloadDescription
OpcStructField(string, OpcNodeId)Initializes a new instance of the OpcStructField class using the unique name and fieldTypeId of the structure field to define.
OpcStructField(string, OpcNodeId, string)Initializes a new instance of the OpcStructField class using the unique name, fieldTypeId and description of the structure field to define.

OpcStructField(string, OpcNodeId) ​

Initializes a new instance of the OpcStructField class using the unique name and fieldTypeId of the structure field to define.

csharp
public OpcStructField(string name, OpcNodeId fieldTypeId)
vbnet
Public Sub New(name As String, fieldTypeId As OpcNodeId)

Parameters

NameTypeDescription
nameStringThe name of the structure field which unique identifies the field in the structure.
fieldTypeIdOpcNodeIdThe identifier of the data type the field uses for its value.

OpcStructField(string, OpcNodeId, string) ​

Initializes a new instance of the OpcStructField class using the unique name, fieldTypeId and description of the structure field to define.

csharp
public OpcStructField(string name, OpcNodeId fieldTypeId, string description)
vbnet
Public Sub New(name As String, fieldTypeId As OpcNodeId, description As String)

Parameters

NameTypeDescription
nameStringThe name of the structure field which unique identifies the field in the structure.
fieldTypeIdOpcNodeIdThe identifier of the data type the field uses for its value.
descriptionStringThe description of the purpose of the structure field.

Properties ​

ArrayRank ​

Gets the number of dimensions of the field if it is an array.

csharp
public int ArrayRank { get; }
vbnet
Public ReadOnly Property ArrayRank As Integer

Property value

Int32

The number of dimensions set using AsArray or AsArray, or -1 if the field is not an array.

Description ​

Gets description of the structure field which defines the purpose of the field.

csharp
public string Description { get; }
vbnet
Public ReadOnly Property Description As String

Property value

String

The description of the purpose of the structure field represented.

FieldTypeId ​

Gets the identifier of the data type of the value of the field.

csharp
public OpcNodeId FieldTypeId { get; }
vbnet
Public ReadOnly Property FieldTypeId As OpcNodeId

Property value

OpcNodeId

The identifier of the data type of the value.

IsArray ​

Gets a value indicating whether the field is an array.

csharp
public bool IsArray { get; }
vbnet
Public ReadOnly Property IsArray As Boolean

Property value

Boolean

The value true if the field has been declared as an array using one of the AsArray methods; otherwise the value false.

IsOptional ​

Gets a value indicating whether the field is optional.

csharp
public bool IsOptional { get; }
vbnet
Public ReadOnly Property IsOptional As Boolean

Property value

Boolean

The value true if the field has been declared as optional using one of the AsOptional methods; otherwise the value false.

Length ​

Gets the length of the field if it is an array.

csharp
public OpcMemberLength Length { get; }
vbnet
Public ReadOnly Property Length As OpcMemberLength

Property value

OpcMemberLength

The length set using one of the AsArray methods, or a null reference (Nothing in Visual Basic) if the field is not an array.

Name ​

Gets the name of the structure field which unique identifies the field in the structure.

csharp
public string Name { get; }
vbnet
Public ReadOnly Property Name As String

Property value

String

The unique name of the structure field.

Switch ​

Gets the switch which controls the existence of the field if it is optional.

csharp
public OpcMemberSwitch Switch { get; }
vbnet
Public ReadOnly Property Switch As OpcMemberSwitch

Property value

OpcMemberSwitch

The switch set using AsOptional, or a null reference (Nothing in Visual Basic) if none has been set.

Methods ​

AsArray ​

5 overloads

OverloadDescription
AsArray()Declares the field as a one-dimensional array with a variable length.
AsArray(long)Declares the field as a one-dimensional array with the length specified.
AsArray(string)Declares the field as a one-dimensional array whose length is the value of the field specified.
AsArray(int, long)Declares the field as an array with the rank and the length specified.
AsArray(int, string)Declares the field as an array with the rank specified whose length is the value of the field specified.

AsArray() ​

Declares the field as a one-dimensional array with a variable length.

csharp
public OpcStructField AsArray()
vbnet
Public Function AsArray() As OpcStructField

Returns

OpcStructField

This field.

Remarks

A new value of the field starts as an empty array.

AsArray(long) ​

Declares the field as a one-dimensional array with the length specified.

csharp
public OpcStructField AsArray(long length)
vbnet
Public Function AsArray(length As Long) As OpcStructField

Parameters

NameTypeDescription
lengthInt64The number of elements of the array, or 0 for an array with a variable length.

Returns

OpcStructField

This field.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe length is less than zero.

Remarks

A new value of a field with the length 0 starts as an empty array.

AsArray(string) ​

Declares the field as a one-dimensional array whose length is the value of the field specified.

csharp
public OpcStructField AsArray(string lengthField)
vbnet
Public Function AsArray(lengthField As String) As OpcStructField

Parameters

NameTypeDescription
lengthFieldStringThe name of the field whose value is the length of the array; it is to precede this field.

Returns

OpcStructField

This field.

Exceptions

ExceptionCondition
ArgumentExceptionThe lengthField is equals Empty.
ArgumentNullExceptionThe lengthField is a null reference (Nothing in Visual Basic).

AsArray(int, long) ​

Declares the field as an array with the rank and the length specified.

csharp
public OpcStructField AsArray(int rank, long length)
vbnet
Public Function AsArray(rank As Integer, length As Long) As OpcStructField

Parameters

NameTypeDescription
rankInt32The number of dimensions of the array, from 1 to 32.
lengthInt64The number of elements of the array, or 0 for an array with a variable length.

Returns

OpcStructField

This field.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe rank is less than 1 or greater than 32, or the length is less than zero.

Remarks

A new value of a field with the length 0 starts as an empty array.

AsArray(int, string) ​

Declares the field as an array with the rank specified whose length is the value of the field specified.

csharp
public OpcStructField AsArray(int rank, string lengthField)
vbnet
Public Function AsArray(
    rank As Integer,
    lengthField As String) As OpcStructField

Parameters

NameTypeDescription
rankInt32The number of dimensions of the array, from 1 to 32.
lengthFieldStringThe name of the field whose value is the length of the array; it is to precede this field.

Returns

OpcStructField

This field.

Exceptions

ExceptionCondition
ArgumentExceptionThe lengthField is equals Empty.
ArgumentNullExceptionThe lengthField is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionThe rank is less than 1 or greater than 32.

AsOptional ​

2 overloads

OverloadDescription
AsOptional()Declares the field as optional.
AsOptional(OpcMemberSwitch)Declares the field as optional whose existence is controlled by the switch specified.

AsOptional() ​

Declares the field as optional.

csharp
public OpcStructField AsOptional()
vbnet
Public Function AsOptional() As OpcStructField

Returns

OpcStructField

This field.

AsOptional(OpcMemberSwitch) ​

Declares the field as optional whose existence is controlled by the switch specified.

csharp
public OpcStructField AsOptional(OpcMemberSwitch memberSwitch)
vbnet
Public Function AsOptional(memberSwitch As OpcMemberSwitch) As OpcStructField

Parameters

NameTypeDescription
memberSwitchOpcMemberSwitchThe switch which controls the existence of the field.

Returns

OpcStructField

This field.

Exceptions

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