Skip to content

Reference

OpcEncoding Members

Identifies how data is encoded on the wire and therefore describes in which way information is serialized or deserialized.

Reference

OpcEncoding Members ​

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

Properties ​

DefaultBinary ​

static

Gets the foundation defined encoding used by default to encode information using the binary representation (known as 'OPC UA Binary') of the information to serialize or deserialize.

csharp
public static OpcEncoding DefaultBinary { get; }
vbnet
Public Shared ReadOnly Property DefaultBinary As OpcEncoding

Property value

OpcEncoding

An instance of the OpcEncoding class used to define the OPC UA Binary encoding. The OpcEncoding instance provided identifies a data independent encoding and does therefore not refer to a specific node which refers to the OpcEncodingType used by the instance (Id is equals Null).

DefaultXml ​

static

Gets the foundation defined encoding used by default to encode information using a XML-based serialization format (known as 'OPC UA XML') to serialize or deserialize information.

csharp
public static OpcEncoding DefaultXml { get; }
vbnet
Public Shared ReadOnly Property DefaultXml As OpcEncoding

Property value

OpcEncoding

An instance of the OpcEncoding class used to define the OPC UA XML encoding. The OpcEncoding instance provided identifies a data independent encoding and does therefore not refer to a specific node which refers to the OpcEncodingType used by the instance (Id is equals Null).

Id ​

Gets the identifier of the node which refers to a specific OpcEncodingType (defined by Type) used to encode information.

csharp
public OpcNodeId Id { get; }
vbnet
Public ReadOnly Property Id As OpcNodeId

Property value

OpcNodeId

An instance of the OpcNodeId class which either identifies a data type specific encoding or Null in case there this OpcEncoding represents one of the default encodings defined by the foundation.

Namespace ​

Gets the namespace within the encoding has been defined. This can be the same namespace as referenced by data type dictioanries using their NamespaceUri property.

csharp
public OpcNamespace Namespace { get; }
vbnet
Public ReadOnly Property [Namespace] As OpcNamespace

Property value

OpcNamespace

An instance of the OpcNamespace class which refers to the namespace within the encoding has been defined. These instance may be the same OpcNamespace as used by the Id (see Namespace) or a custom namespace which in case of data type encodings have to be the same namespace as referenced by data type dictionaries using their NamespaceUri property.

Type ​

Gets a value which identifies the underlying logic used to encode information.

csharp
public OpcEncodingType Type { get; }
vbnet
Public ReadOnly Property Type As OpcEncodingType

Property value

OpcEncodingType

One of the members defined by the OpcEncodingType enumeration.

Methods ​

All ​

static · 2 overloads

OverloadDescription
All(OpcNodeId)staticRetrieves for each supported OpcEncodingType a new OpcEncoding while each uses the id specified.
All(OpcNodeId, OpcNamespace)staticRetrieves for each supported OpcEncodingType a new OpcEncoding while each uses the id and encodingNamespace specified.

Exceptions (all overloads)

ExceptionCondition
ArgumentNullExceptionThe id is a null reference (Nothing in Visual Basic).

All(OpcNodeId) ​

static

Retrieves for each supported OpcEncodingType a new OpcEncoding while each uses the id specified.

csharp
public static OpcEncoding[] All(OpcNodeId id)
vbnet
Public Shared Function All(id As OpcNodeId) As OpcEncoding()

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the node which relates to the encodings offered.

Returns

OpcEncoding[]

An array of OpcEncoding instances representing all OpcEncodingTypes supported while referencing to the encoding node specified by id.

All(OpcNodeId, OpcNamespace) ​

static

Retrieves for each supported OpcEncodingType a new OpcEncoding while each uses the id and encodingNamespace specified.

csharp
public static OpcEncoding[] All(OpcNodeId id, OpcNamespace encodingNamespace)
vbnet
Public Shared Function All(
    id As OpcNodeId,
    encodingNamespace As OpcNamespace) As OpcEncoding()

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the node which relates to the encodings offered.
encodingNamespaceOpcNamespaceThe OpcNamespace which refers to the namespace within the encodings has been defined. In case of data type encodings this OpcNamespace instance have to be the same namespace as referenced by data type dictionaries using their NamespaceUri property. This parameter can be a null reference (Nothing in Visual Basic); in this case the Namespace of the id specified is used instead.

Returns

OpcEncoding[]

An array of OpcEncoding instances representing all OpcEncodingTypes supported while referencing to the encoding node specified by id.

Binary ​

static · 3 overloads

OverloadDescription
Binary(OpcNodeId)staticRetrieves a new OpcEncoding which uses the id specified to define an encoding which uses the logic used for binary data encoding.
Binary(OpcNodeId, OpcNamespace)staticRetrieves a new OpcEncoding which uses the id and encodingNamespace specified to define an encoding which uses the logic used for binary data encoding.
Binary(params OpcEncoding[])staticSelects the first OpcEncoding in encodings which defines an encoding which uses the Binary encoding type as the logic used to encode data.

Binary(OpcNodeId) ​

static

Retrieves a new OpcEncoding which uses the id specified to define an encoding which uses the logic used for binary data encoding.

csharp
public static OpcEncoding Binary(OpcNodeId id)
vbnet
Public Shared Function Binary(id As OpcNodeId) As OpcEncoding

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the node which relates to the encoding offered.

Returns

OpcEncoding

A new instance of the OpcEncoding class representing the encoding node specified by the id while using the Binary encoding type as the Type of encoding.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe id is a null reference (Nothing in Visual Basic).

Binary(OpcNodeId, OpcNamespace) ​

static

Retrieves a new OpcEncoding which uses the id and encodingNamespace specified to define an encoding which uses the logic used for binary data encoding.

csharp
public static OpcEncoding Binary(OpcNodeId id, OpcNamespace encodingNamespace)
vbnet
Public Shared Function Binary(
    id As OpcNodeId,
    encodingNamespace As OpcNamespace) As OpcEncoding

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the node which relates to the encoding offered.
encodingNamespaceOpcNamespaceThe OpcNamespace which refers to the namespace within the encoding has been defined. In case of data type encodings this OpcNamespace instance have to be the same namespace as referenced by data type dictionaries using their NamespaceUri property. This parameter can be a null reference (Nothing in Visual Basic); in this case the Namespace of the id specified is used instead.

Returns

OpcEncoding

A new instance of the OpcEncoding class representing the encoding node specified by the id within the further defined encodingNamespace while using the Binary encoding type as the Type of encoding.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe id is a null reference (Nothing in Visual Basic).

Binary(params OpcEncoding[]) ​

static

Selects the first OpcEncoding in encodings which defines an encoding which uses the Binary encoding type as the logic used to encode data.

csharp
public static OpcEncoding Binary(params OpcEncoding[] encodings)
vbnet
Public Shared Function Binary(
    ParamArray encodings As OpcEncoding()) As OpcEncoding

Parameters

NameTypeDescription
encodingsparams OpcEncoding[]An array of OpcEncoding instances from which the first binary encoding is to be selected.

Returns

OpcEncoding

The first binary OpcEncoding in encodings or a null reference (Nothing in Visual Basic)

Default ​

static

Retrieves the according default OpcEncoding which is used for the encodingType specified.

csharp
public static OpcEncoding Default(OpcEncodingType encodingType)
vbnet
Public Shared Function [Default](encodingType As OpcEncodingType) As OpcEncoding

Parameters

NameTypeDescription
encodingTypeOpcEncodingTypeThe OpcEncodingType for that the according default OpcEncoding is to be determined.

Returns

OpcEncoding

The default OpcEncoding used for the encodingType specified.

Empty ​

static · since v2.50

Returns an empty array of the type OpcEncoding.

csharp
public static OpcEncoding[] Empty()
vbnet
Public Shared Function Empty() As OpcEncoding()

Returns

OpcEncoding[]

Returns an empty OpcEncoding array.

Equals ​

2 overloads

OverloadDescription
Equals(object)overrideDetermines whether the specified other is equal to this OpcEncoding.
Equals(OpcEncoding)Determines whether the specified other is equal to this OpcEncoding.

Equals(object) ​

override

Determines whether the specified other is equal to this OpcEncoding.

csharp
public override bool Equals(object other)
vbnet
Public Overrides Function Equals(other As Object) As Boolean

Parameters

NameTypeDescription
otherObjectThe OpcEncoding to compare to the current OpcEncoding.

Returns

Boolean

The value true if the specified OpcEncoding is equal to the current OpcEncoding; otherwise the value false.

Overrides

Equals(object)

Equals(OpcEncoding) ​

Determines whether the specified other is equal to this OpcEncoding.

csharp
public bool Equals(OpcEncoding other)
vbnet
Public Function Equals(other As OpcEncoding) As Boolean

Parameters

NameTypeDescription
otherOpcEncodingThe OpcEncoding to compare to the current OpcEncoding.

Returns

Boolean

The value true if the specified OpcEncoding is equal to the current OpcEncoding; otherwise the value false.

Implements

Equals(OpcEncoding)

GetHashCode ​

override

Retrieves a hash code for this OpcEncoding.

csharp
public override int GetHashCode()
vbnet
Public Overrides Function GetHashCode() As Integer

Returns

Int32

An int that contains the hash code for the OpcEncoding.

Overrides

GetHashCode()

GetType ​

static · since v2.9

Determines the expressed type of encoding using the information encoded in the encodingName specified.

csharp
public static OpcEncodingType? GetType(string encodingName)
vbnet
Public Shared Function [GetType](encodingName As String) As OpcEncodingType?

Parameters

NameTypeDescription
encodingNameStringA string expressing the name of a specific encoding from which the according OpcEncodingType is to be determined.

Returns

Nullable<OpcEncodingType>

One of the members defined by the OpcEncodingType enumeration or a null reference (Nothing in Visual Basic) in case there no encoding type related information could be determined in the encodingName.

Of ​

static

Selects the first OpcEncoding in encodings which defines an encoding which uses the encodingType specified as the logic used to encode data.

csharp
public static OpcEncoding[] Of(
    OpcEncodingType encodingType,
    params OpcEncoding[] encodings)
vbnet
Public Shared Function [Of](
    encodingType As OpcEncodingType,
    ParamArray encodings As OpcEncoding()) As OpcEncoding()

Parameters

NameTypeDescription
encodingTypeOpcEncodingTypeThe type of encoding the OpcEncoding instance is to be selected from the encodings specified.
encodingsparams OpcEncoding[]An array of OpcEncoding instances from which the first encoding with of the encodingType specified is to be selected.

Returns

OpcEncoding[]

The first OpcEncoding in encodings of the encodingType specified or a null reference (Nothing in Visual Basic).

ToString ​

override

Returns a string representing the encoding described.

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

Returns

String

A string represening the information used by this OpcEncoding instance.

Overrides

ToString()

Xml ​

static · 3 overloads

OverloadDescription
Xml(OpcNodeId)staticRetrieves a new OpcEncoding which uses the id specified to define an encoding which uses the logic used for XML data encoding.
Xml(OpcNodeId, OpcNamespace)staticRetrieves a new OpcEncoding which uses the id and encodingNamespace specified to define an encoding which uses the logic used for XML data encoding.
Xml(params OpcEncoding[])staticSelects the first OpcEncoding in encodings which defines an encoding which uses the Xml encoding type as the logic used to encode data.

Xml(OpcNodeId) ​

static

Retrieves a new OpcEncoding which uses the id specified to define an encoding which uses the logic used for XML data encoding.

csharp
public static OpcEncoding Xml(OpcNodeId id)
vbnet
Public Shared Function Xml(id As OpcNodeId) As OpcEncoding

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the node which relates to the encoding offered.

Returns

OpcEncoding

A new instance of the OpcEncoding class representing the encoding node specified by the id while using the Xml encoding type as the Type of encoding.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe id is a null reference (Nothing in Visual Basic).

Xml(OpcNodeId, OpcNamespace) ​

static

Retrieves a new OpcEncoding which uses the id and encodingNamespace specified to define an encoding which uses the logic used for XML data encoding.

csharp
public static OpcEncoding Xml(OpcNodeId id, OpcNamespace encodingNamespace)
vbnet
Public Shared Function Xml(
    id As OpcNodeId,
    encodingNamespace As OpcNamespace) As OpcEncoding

Parameters

NameTypeDescription
idOpcNodeIdThe identifier of the node which relates to the encoding offered.
encodingNamespaceOpcNamespaceThe OpcNamespace which referes to the namespace within the encoding has been defined. In case of data type encodings this OpcNamespace instance have to be the same namespace as referenced by data type dictionaries using their NamespaceUri property. This parameter can be a null reference (Nothing in Visual Basic); in this case the Namespace of the id specified is used instead.

Returns

OpcEncoding

A new instance of the OpcEncoding class representing the encoding node specified by the id within the further defined encodingNamespace while using the Xml encoding type as the Type of encoding.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe id is a null reference (Nothing in Visual Basic).

Xml(params OpcEncoding[]) ​

static

Selects the first OpcEncoding in encodings which defines an encoding which uses the Xml encoding type as the logic used to encode data.

csharp
public static OpcEncoding Xml(params OpcEncoding[] encodings)
vbnet
Public Shared Function Xml(ParamArray encodings As OpcEncoding()) As OpcEncoding

Parameters

NameTypeDescription
encodingsparams OpcEncoding[]An array of OpcEncoding instances from which the first XML encoding is to be selected.

Returns

OpcEncoding

The first XML OpcEncoding in encodings or a null reference (Nothing in Visual Basic)

Operators ​

Equality ​

static

Returns a value indicating whether two instance of OpcEncoding are equal.

csharp
public static bool operator ==(OpcEncoding left, OpcEncoding right)
vbnet
Public Shared Operator =(left As OpcEncoding, right As OpcEncoding) As Boolean

Parameters

NameTypeDescription
leftOpcEncodingThe first OpcEncoding to compare.
rightOpcEncodingThe second OpcEncoding to compare.

Returns

Boolean

The value true if left and right are equal; otherwise the value false.

Inequality ​

static

Returns a value indicating whether two instances of OpcEncoding are not equal.

csharp
public static bool operator !=(OpcEncoding left, OpcEncoding right)
vbnet
Public Shared Operator <>(left As OpcEncoding, right As OpcEncoding) As Boolean

Parameters

NameTypeDescription
leftOpcEncodingThe first OpcEncoding to compare.
rightOpcEncodingThe second OpcEncoding to compare.

Returns

Boolean

The value true if left and right are not equal; otherwise the value false.