Skip to content

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 ​

4 overloads

OverloadDescription
OpcMemberSwitch(int)Initializes a new instance of the OpcMemberSwitch class which refers to the bit specified.
OpcMemberSwitch(string)Initializes a new instance of the OpcMemberSwitch class which refers to the switch member using its name specified.
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.
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.

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'.

csharp
public OpcMemberSwitch(int bit)
vbnet
Public Sub New(bit As Integer)

Parameters

NameTypeDescription
bitInt32The 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 (inclusive).

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe 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.

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

Parameters

NameTypeDescription
nameStringThe name of the switch member its value is compared to control the existence of an optional member.

Exceptions

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

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.

csharp
public OpcMemberSwitch(string name, long value)
vbnet
Public Sub New(name As String, value As Long)

Parameters

NameTypeDescription
nameStringThe name of the switch member its value is compared to the value to control the existence of an optional member.
valueInt64The 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

ExceptionCondition
ArgumentExceptionThe name is equals Empty.
ArgumentNullExceptionThe name is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionThe 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.

csharp
public OpcMemberSwitch(
    string name,
    long value,
    OpcMemberSwitchOperator @operator)
vbnet
Public Sub New(
    name As String,
    value As Long,
    [operator] As OpcMemberSwitchOperator)

Parameters

NameTypeDescription
nameStringThe name of the switch member its value is compared to the value to control the existence of an optional member.
valueInt64The 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.
operatorOpcMemberSwitchOperatorOne of the members defined by the OpcMemberSwitchOperator enumeration which defines the operator to use when comparing the value of the switch member with the value specified.

Exceptions

ExceptionCondition
ArgumentExceptionThe name is equals Empty.
ArgumentNullExceptionThe name is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionThe 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.

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

Property value

Int32

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 ​

since v2.9

Gets a value which identities in which way the current OpcMemberSwitch decides whether a member exists.

csharp
public OpcMemberSwitchConditions Conditions { get; }
vbnet
Public ReadOnly Property Conditions As OpcMemberSwitchConditions

Property value

OpcMemberSwitchConditions

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.

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

Property value

String

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.

csharp
public OpcMemberSwitchOperator Operator { get; }
vbnet
Public ReadOnly Property [Operator] As OpcMemberSwitchOperator

Property value

OpcMemberSwitchOperator

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.

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

Property value

Int64

The value towards the value of the switch member is compared.

Methods ​

Equals ​

static · since v2.32

Provides a generic named equality OpcMemberSwitch evaluating to the value specified.

csharp
public static OpcMemberSwitch Equals(long value)
vbnet
Public Shared Function Equals(value As Long) As OpcMemberSwitch

Parameters

NameTypeDescription
valueInt64The 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

OpcMemberSwitch

A new instance of the OpcMemberSwitch class initialized with the switch member name "Switch" which evaluates to equality of the value specified.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe value is less than MinValue or greater than MaxValue.

Matches ​

Evaluates the switch condition against the value specified.

csharp
public bool Matches(long value)
vbnet
Public Function Matches(value As Long) As Boolean

Parameters

NameTypeDescription
valueInt64The value of the 'EncodingMask' or the value of the switch member referenced by the Name to evaluate (the value is evaluated on the left using the Operator against the Value on the right).

Returns

Boolean

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 ​

override

Returns a string representing the information used by the current OpcMemberSwitch.

csharp
public override string ToString()
vbnet
Public Overrides Function ToString() As String

Returns

String

A string representing the current OpcMemberSwitch.

Overrides

ToString()