Skip to content

Reference

OpcDataTypeMemberLengthAttribute Members

Declares a field or property of a custom data type, to that the member belongs on that this attribute is applied, with a variable or fixed length of the member within the stream of its custom data type.

Reference

OpcDataTypeMemberLengthAttribute Members ​

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

Inherits members from Attribute.

Constructors ​

OpcDataTypeMemberLengthAttribute ​

2 overloads

OverloadDescription
OpcDataTypeMemberLengthAttribute(long)Initializes a new instance of the OpcDataTypeMemberLengthAttribute class which declares a field or property with a fixed length.
OpcDataTypeMemberLengthAttribute(string)Initializes a new instance of the OpcDataTypeMemberLengthAttribute class which declares a field or property with a variable length controlled by the value of a preceding field or property which can be identified by the name specified.

OpcDataTypeMemberLengthAttribute(long) ​

Initializes a new instance of the OpcDataTypeMemberLengthAttribute class which declares a field or property with a fixed length.

csharp
public OpcDataTypeMemberLengthAttribute(long length)
vbnet
Public Sub New(length As Long)

Parameters

NameTypeDescription
lengthInt64The total number of instances within the stream of the custom data type of the member the attribute belongs to.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe length is less than zero.

OpcDataTypeMemberLengthAttribute(string) ​

Initializes a new instance of the OpcDataTypeMemberLengthAttribute class which declares a field or property with a variable length controlled by the value of a preceding field or property which can be identified by the name specified.

csharp
public OpcDataTypeMemberLengthAttribute(string name)
vbnet
Public Sub New(name As String)

Parameters

NameTypeDescription
nameStringThe Name or Name (if defined) of the preceding member its value is to be used to indicate the variable length of the member the attribute belongs to.

Exceptions

ExceptionCondition
ArgumentExceptionThe name is an empty string.
ArgumentNullExceptionThe name is a null reference (Nothing in Visual Basic).

Properties ​

Length ​

Gets the total number of instances within the stream of the custom data type of the member the attribute belongs to.

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

Property value

Int64

The total number of instances within the stream. The default value is -1. In case there the value of the Length property is equals -1 the length of the field or property is variable and determined using the value of the field referenced by Name.

Name ​

Gets the name of the preceding member its value is to be evaluated to indicate the variable length of the member the attribute belongs to.

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

Property value

String

The Name or Name (if defined) of the preceding member or a null reference (Nothing in Visual Basic) in case there this OpcDataTypeMemberLengthAttribute uses a fixed Length to define the total number of instances within the stream.

Remarks

In case there Name referes to a field that is not present in an encoded value, then the default value for the length is 1. This situation can occur if the the field referenced is an optional field (see OpcDataTypeMemberSwitchAttribute).

The length field shall be a fixed length Base-2 representation of an integer. If the length field is one of the standard signed integer types and the value is a negative integer, then the field is not present in the encoded stream. The field referenced by the Name shall precede the field with the custom data type.

Methods ​

GetLength ​

Retrieves the OpcMemberLength defined by the OpcDataTypeMemberLengthAttribute.

csharp
public OpcMemberLength GetLength()
vbnet
Public Function GetLength() As OpcMemberLength

Returns

OpcMemberLength

A new OpcMemberLength instance which provides the information required to determine the length of the member the attribute belongs to.