Reference
OpcMemberSwitch Members
Declares the condition under which an optional member exists in dependency of the value of a switch member.
Reference
OpcMemberSwitch Members
- Type
- OpcMemberSwitch
- Namespace
- Opc.UaFx
- Assembly
- Opc.UaFx.Advanced.dll
- Package
- Opc.UaFx.Advanced v2.59.0
- Also in
- Opc.UaFx.Client
Constructors
OpcMemberSwitch
| Overload | Description |
|---|---|
| OpcMemberSwitch( | Initializes a new instance of the OpcMemberSwitch class which refers to the bit specified. |
| OpcMemberSwitch( | Initializes a new instance of the OpcMemberSwitch class which refers to the switch member using its name specified. |
| OpcMemberSwitch( | Initializes a new instance of the OpcMemberSwitch class which refers to the switch member using its name while its value needs to be equals to the value specified. |
| OpcMemberSwitch( | Initializes a new instance of the OpcMemberSwitch class which refers to the switch member using its name while its values is compared to the value using the operator specified. |
OpcMemberSwitch(int)
Initializes a new instance of the OpcMemberSwitch class which refers to the bit specified. Using this constructor results in a OpcMemberSwitch which evaluates to the value true in case there the bit referenced is set (= high) in the 'EncodingMask'.
public OpcMemberSwitch(int bit)Public Sub New(bit As Integer)Parameters
| Name | Type | Description |
|---|---|---|
bit | Int32 | The zero-based number of the bit in the 'EncodingMask' which controls the existence of an optional member. The value needs to be between 0 and 63 ( |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The bit is less than 0 or greater than 63. |
Remarks
This constructor uses the Bit condition for the Conditions property.
OpcMemberSwitch(string)
Initializes a new instance of the OpcMemberSwitch class which refers to the switch member using its name specified. Using this constructor results in a OpcMemberSwitch which evaluates to the value true in case there the value of the switch member referenced by the name is not equals zero.
public OpcMemberSwitch(string name)Public Sub New(name As String)Parameters
| Name | Type | Description |
|---|---|---|
name | String | The name of the switch member its value is compared to control the existence of an optional member. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The name is equals Empty. |
| Argument | The name is a null reference ( |
Remarks
This constructor uses the Field condition for the Conditions property.
OpcMemberSwitch(string, long)
Initializes a new instance of the OpcMemberSwitch class which refers to the switch member using its name while its value needs to be equals to the value specified. Using this constructor results in a OpcMemberSwitch which evaluates to the value true in case there the value of the switch member referenced by the name is equals to the value.
public OpcMemberSwitch(string name, long value)Public Sub New(name As String, value As Long)Parameters
| Name | Type | Description |
|---|---|---|
name | String | The name of the switch member its value is compared to the value to control the existence of an optional member. |
value | Int64 | The value towards the value of the switch member is to be compared using the Equals operator. The value needs to be between MinValue and MaxValue. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The name is equals Empty. |
| Argument | The name is a null reference ( |
| Argument | The value is less than MinValue or greater than MaxValue. |
Remarks
This constructor uses the Field and Value conditions for the Conditions property.
OpcMemberSwitch(string, long, OpcMemberSwitchOperator)
Initializes a new instance of the OpcMemberSwitch class which refers to the switch member using its name while its values is compared to the value using the operator specified. Using this constructor results in a OpcMemberSwitch which evaluates to the value true in case there the comparison of value of the switch member referenced by the name using the operator and the value results to the value true.
public OpcMemberSwitch(
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 of the switch member its value is compared to the value to control the existence of an optional member. |
value | Int64 | The value towards the value of the switch member is to be compared using the operator specified. The value needs to be between MinValue and MaxValue. |
operator | Opc | One of the members defined by the Opcvalue specified. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The name is equals Empty. |
| Argument | The name is a null reference ( |
| Argument | The value is less than MinValue or greater than MaxValue. |
Remarks
This constructor uses the Field, Value and Operator conditions for the Conditions property.
Properties
Bit
Gets the zero-based number of the bit in the 'EncodingMask' which controls the existence of an optional member.
public int Bit { get; }Public ReadOnly Property Bit As IntegerProperty value
A value between 0 and 63 (inclusive) which refers to the bit in the 'EncodingMask' evaluated to control the existence of an optional member or -1 in case there the OpcMemberSwitch refers to a switch member using its Name.
Conditions
Gets a value which identities in which way the current OpcMemberSwitch decides whether a member exists.
public OpcMemberSwitchConditions Conditions { get; }Public ReadOnly Property Conditions As OpcMemberSwitchConditionsProperty value
A combination of the members defined by the OpcMemberSwitchConditions enumeration.
Remarks
The value of this property depends on which constructor of the OpcMemberSwitch class has been used. For more details see the documentation of the constructors.
Name
Gets the name of the switch member its value is compared to control the existence of an optional member.
public string Name { get; }Public ReadOnly Property Name As StringProperty value
The string which identifies the member its value is to be evaluated.
Operator
Gets a value which defines the relational operator to use when comparing the value of a referenced Bit or the value of a referenced switch member refered to by Name.
public OpcMemberSwitchOperator Operator { get; }Public ReadOnly Property [Operator] As OpcMemberSwitchOperatorProperty value
One of the members defined by the OpcMemberSwitchOperator enumeration.
Value
Gets the value towards the value of the switch member, referenced by the Bit of the 'EncodingMask' or by the Name, is to be compared using the Operator of the OpcMemberSwitch.
public long Value { get; }Public ReadOnly Property Value As LongProperty value
The value towards the value of the switch member is compared.
Methods
Equals
Provides a generic named equality OpcMemberSwitch evaluating to the value specified.
public static OpcMemberSwitch Equals(long value)Public Shared Function Equals(value As Long) As OpcMemberSwitchParameters
| Name | Type | Description |
|---|---|---|
value | Int64 | The value towards the value of the switch member is to be compared using the Equals operator. The value needs to be between MinValue and MaxValue. |
Returns
A new instance of the OpcMemberSwitch class initialized with the switch member name "Switch" which evaluates to equality of the value specified.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The value is less than MinValue or greater than MaxValue. |
Matches
Evaluates the switch condition against the value specified.
public bool Matches(long value)Public Function Matches(value As Long) As BooleanParameters
| Name | Type | Description |
|---|---|---|
value | Int64 | The value of the 'EncodingMask' or the value of the switch member referenced by the Name to evaluate (value is evaluated on the left using the Operator against the Value on the right). |
Returns
The value true if the value of the 'EncodingMask' specified declares the according Bit equals 'high' or if the value of the switch member compares to the Value with a result equals true; otherwise the value false.
ToString
Returns a string representing the information used by the current OpcMemberSwitch.
public override string ToString()Public Overrides Function ToString() As StringReturns
A string representing the current OpcMemberSwitch.
Overrides

