Reference
OpcDataTypeMemberSwitchAttribute Members
Declares a field or property of a custom data type, to that the member belongs on that this attribute is applied, with conditional existence of the member within the stream of its custom data type.
Reference
OpcDataTypeMemberSwitchAttribute Members
- Type
- OpcDataTypeMemberSwitchAttribute
- 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
OpcDataTypeMemberSwitchAttribute
| Overload | Description |
|---|---|
| Opc | Initializes a new instance of the Opc |
| Opc | Initializes a new instance of the Opcbit specified. |
| Opc | Initializes a new instance of the Opcname specified while its value needs to be "not equals" to zero. |
| Opc | Initializes a new instance of the Opcname specified while its value needs to be "equals" to the value specified. |
| Opc | Initializes a new instance of the Opcname specified while its value is compared to the value using the comparison operator specified. |
OpcDataTypeMemberSwitchAttribute()
Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is indicated by a single bit (the next free bit in sequence of all bits in the encoding mask used bits). In case there the bit is set the data of the member is read or written from or to the stream of the data type; otherwise the data member is skipped and the next member is processed.
public OpcDataTypeMemberSwitchAttribute()Public Sub New()OpcDataTypeMemberSwitchAttribute(int)
Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is indicated by the bit specified.
public OpcDataTypeMemberSwitchAttribute(int bit)Public Sub New(bit As Integer)Parameters
| Name | Type | Description |
|---|---|---|
bit | Int32 | The zero based number of the bit which indicates whether the field or property the attribute belongs to exists in the stream of the data type. The bit number specified may not be contiguous and may control multiple fields. In case there the bit is set the data of the member is read or written from or to the stream of the data type; otherwise the data member is skipped and the next member is processed. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The bit is less than zero or greater than 64. |
OpcDataTypeMemberSwitchAttribute(string)
Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is controlled by the value of a preceding field or property which can be identified by the name specified while its value needs to be "not equals" to zero.
public OpcDataTypeMemberSwitchAttribute(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 ( |
OpcDataTypeMemberSwitchAttribute(string, long)
Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is controlled by the value of a preceding field or property which can be identified by the name specified while its value needs to be "equals" to the value specified.
public OpcDataTypeMemberSwitchAttribute(string name, long value)Public Sub New(name As String, value As Long)Parameters
| Name | Type | Description |
|---|---|---|
name | String | The Name or Name (value specified to indicate that the member the attribute belongs to exists and the data of the member is read or written from or to the stream of the data type; otherwise the data member is skipped and the next member is processed. |
value | Int64 | The long-value the value of the member referenced by name needs to be equals to, to indicate that the member the attribute belongs to exists. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The name is an empty string. |
| Argument | The name is a null reference ( |
| Argument | The value is less than MinValue or greater than MaxValue. |
OpcDataTypeMemberSwitchAttribute(string, long, OpcMemberSwitchOperator)
Initializes a new instance of the OpcDataTypeMemberSwitchAttribute class which declares a field or property to be optional while its existence is controlled by the value of a preceding field or property which can be identified by the name specified while its value is compared to the value using the comparison operator specified.
public OpcDataTypeMemberSwitchAttribute(
string name,
long value,
OpcMemberSwitchOperator @operator)Public Sub New(
name As String,
value As Long,
[operator] As OpcMemberSwitchOperator)Parameters
| Name | Type | Description |
|---|---|---|
name | String | The Name or Name (value specified using the comparison operator specified to indicate that the member the attribute belongs to exists and the data of the member is read or written from or to the stream of the data type; otherwise the data member is skipped and the next member is processed. |
value | Int64 | The long-value the value of the member referenced by name needs fulfill using the comparison operator specified, to indicate that the member the attribute belongs to exists. |
operator | Opc | One of the members defined by the Opcname. Only in case there the comparison result is equals true, the member this attribute belongs to exists; otherwise the result is equals false it is skipped when reading or writing the data of its data type. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The name is an empty string. |
| Argument | The name is a null reference ( |
| Argument | The value is less than MinValue or greater than MaxValue. |
Properties
Bit
Gets the number of the bit which indiciates whether the field or property the attribute belongs to exists in the stream of the data type.
public int Bit { get; }Public ReadOnly Property Bit As IntegerProperty value
The zero based number of the bit, which may not be contiguous and may control multiple fields. The default value is -1. In case there the value of the Bit property is equals -1 and the value of the Value property is a null reference (Nothing in Visual Basic) this OpcDataTypeMemberSwitchAttribute refers to a OpcMemberSwitch which is determined by the next free bit in sequence of all bits in the encoding mask used bits.
Name
Gets the name of the preceding member its value is to be evaluated to indicate that the member the attribute belongs exists in the stream of the data type.
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 OpcDataTypeMemberSwitchAttribute refers to a OpcMemberSwitch which is determined by the value of the Bit property.
Operator
Gets a value which identifies the comparison method to use to evaluate the value of member referenced by Name.
public OpcMemberSwitchOperator? Operator { get; }Public ReadOnly Property [Operator] As OpcMemberSwitchOperator?Property value
Nullable<OpcMemberSwitchOperator>
One of the members defined by the OpcMemberSwitchOperator enumeration which defines the comparison operator to evaluate or a null reference (Nothing in Visual Basic) if a default operator is to be used. The default operator used is determined by the value of the Value property. If Value is a null reference (Nothing in Visual Basic) NotEqual is used; otherwise Equals.
Value
Gets the value the value of the member referenced by Name is compared to.
public long? Value { get; }Public ReadOnly Property Value As Long?Property value
The long-value the value of the member referenced by Name is compared to or a null reference (Nothing in Visual Basic) if either the Bit property is set or a comparison against zero needs to be evaluated by default using the NotEqual operator.
Methods
GetSwitch
Retrieves the OpcMemberSwitch defined by the OpcDataTypeMemberSwitchAttribute using the bit specified.
public OpcMemberSwitch GetSwitch(int bit)Public Function GetSwitch(bit As Integer) As OpcMemberSwitchParameters
| Name | Type | Description |
|---|---|---|
bit | Int32 | The zero based number of the next free bit in sequence of all bits in the encoding mask used bits if Name is a null reference ( |
Returns
A new OpcMemberSwitch instance which provides the information required to switch the member the attribute belongs to.

