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
| Overload | Description |
|---|---|
| Opc | Initializes a new instance of the Opc |
| Opc | Initializes a new instance of the Opcname specified. |
OpcDataTypeMemberLengthAttribute(long)
Initializes a new instance of the OpcDataTypeMemberLengthAttribute class which declares a field or property with a fixed length.
public OpcDataTypeMemberLengthAttribute(long length)Public Sub New(length As Long)Parameters
| Name | Type | Description |
|---|---|---|
length | Int64 | The total number of instances within the stream of the custom data type of the member the attribute belongs to. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The 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.
public OpcDataTypeMemberLengthAttribute(string name)Public Sub New(name As String)Parameters
| Name | Type | Description |
|---|---|---|
name | String | The Name or Name ( |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The name is an empty string. |
| Argument | The name is a null reference ( |
Properties
Length
Gets the total number of instances within the stream of the custom data type of the member the attribute belongs to.
public long Length { get; }Public ReadOnly Property Length As LongProperty value
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.
public string Name { get; }Public ReadOnly Property Name As StringProperty value
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.
public OpcMemberLength GetLength()Public Function GetLength() As OpcMemberLengthReturns
A new OpcMemberLength instance which provides the information required to determine the length of the member the attribute belongs to.

