# OpcEngineeringUnitInfo Members

> Reference: Provides information to classify a value using codes for units of measurements.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcEngineeringUnitInfo</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Constructors

### OpcEngineeringUnitInfo

<span class="api-meta">7 overloads</span>

| Overload | Description |
|---|---|
| [OpcEngineeringUnitInfo()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#opcengineeringunitinfo-noparams) | Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class. |
| [OpcEngineeringUnitInfo(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#opcengineeringunitinfo-system-string) | Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `displayName` specified. |
| [OpcEngineeringUnitInfo(string, string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#opcengineeringunitinfo-system-string-system-string) | Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `displayName` and `namespaceUri` specified. |
| [OpcEngineeringUnitInfo(string, string, string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#opcengineeringunitinfo-system-string-system-string-system-string) | Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `displayName`, `description` and `namespaceUri` specified. |
| [OpcEngineeringUnitInfo(int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#opcengineeringunitinfo-system-int32) | Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `unitId` specified. |
| [OpcEngineeringUnitInfo(int, string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#opcengineeringunitinfo-system-int32-system-string) | Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `unitId` and `displayName` specified. |
| [OpcEngineeringUnitInfo(int, string, string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#opcengineeringunitinfo-system-int32-system-string-system-string) | Initialues a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `unitId`, `displayName` and `description` specified. |

#### OpcEngineeringUnitInfo()

Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEngineeringUnitInfo()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New()
```

</div>

#### OpcEngineeringUnitInfo(string)

Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `displayName` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEngineeringUnitInfo(string displayName)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(displayName As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `displayName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the engineering unit which is typically an abbreviation. For example "h" for "hour". |

#### OpcEngineeringUnitInfo(string, string)

Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `displayName` and `namespaceUri` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEngineeringUnitInfo(string displayName, string namespaceUri)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(displayName As String, namespaceUri As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `displayName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the engineering unit which is typically an abbreviation. For example "h" for "hour". |
| `namespaceUri` | [String](https://learn.microsoft.com/dotnet/api/system.string) | A string representing the [Uri](https://learn.microsoft.com/dotnet/api/system.uri) of the organization (company, standards organization) that defines the engineering unit. |

#### OpcEngineeringUnitInfo(string, string, string)

Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `displayName`, `description` and `namespaceUri` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEngineeringUnitInfo(
    string displayName,
    string description,
    string namespaceUri)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(
    displayName As String,
    description As String,
    namespaceUri As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `displayName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the engineering unit which is typically an abbreviation. For example "h" for "hour". |
| `description` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The full name of the engineering unit such as "hour" or "meter per second". |
| `namespaceUri` | [String](https://learn.microsoft.com/dotnet/api/system.string) | A string representing the [Uri](https://learn.microsoft.com/dotnet/api/system.uri) of the organization (company, standards organization) that defines the engineering unit. |

#### OpcEngineeringUnitInfo(int)

Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `unitId` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEngineeringUnitInfo(int unitId)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(unitId As Integer)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `unitId` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The numeric identifier of the engineering unit. |

**Remarks**

Using this constructor will use the [CommonCode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#commoncode) as the initial value of the [DisplayName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#displayname) and [Description](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#description) of the engineering unit represented.

#### OpcEngineeringUnitInfo(int, string)

Initializes a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `unitId` and `displayName` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEngineeringUnitInfo(int unitId, string displayName)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(unitId As Integer, displayName As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `unitId` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The numeric identifier of the engineering unit. |
| `displayName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the engineering unit which is typically an abbreviation. For example "h" for "hour". |

#### OpcEngineeringUnitInfo(int, string, string)

Initialues a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class using the `unitId`, `displayName` and `description` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEngineeringUnitInfo(
    int unitId,
    string displayName,
    string description)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(unitId As Integer, displayName As String, description As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `unitId` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The numeric identifier of the engineering unit. |
| `displayName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the engineering unit which is typically an abbreviation. For example "h" for "hour". |
| `description` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The full name of the engineering unit such as "hour" or "meter per second". |

## Fields

### DefaultNamespaceUri

<span class="api-meta">static</span>

Defines the default value used for the [NamespaceUri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#namespaceuri) property.

<div class="api-signature" data-lang="csharp">

```csharp
public static readonly string DefaultNamespaceUri
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared ReadOnly DefaultNamespaceUri As String
```

</div>

**Field value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### CommonCode

Gets the common code derived from the [UnitId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#unitid) of the engineering unit represented.

<div class="api-signature" data-lang="csharp">

```csharp
public string CommonCode { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property CommonCode As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The unique code defined by the UNECE/CEFACT Trade Facilitation Recommendation No.20 from which the [UnitId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#unitid) is derived. In case there is no [UnitId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#unitid) defined (see [HasUnitId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#hasunitid)) an empty string.

### Description

Gets or sets the full name of the engineering unit represented.

<div class="api-signature" data-lang="csharp">

```csharp
public string Description { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property Description As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The full name of the engineering unit for example "hour" or "meter per second". For the according abbreviation see [DisplayName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#displayname).

### DisplayName

Gets or sets the name of the engineering unit represented.

<div class="api-signature" data-lang="csharp">

```csharp
public string DisplayName { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property DisplayName As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The name (typically an abbreviation) of the engineering unit for example "h" for "hour" or "m/s" for "meter per second".

### HasUnitId

Gets a value indicating whether the engineering unit provides an according numeric identifier (see [UnitId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#unitid)) for programmatic evaluation.

<div class="api-signature" data-lang="csharp">

```csharp
public bool HasUnitId { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property HasUnitId As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the engineering unit provides an identifier for the unit represented; otherwise the value false.

### IsUndefined

Gets a value indicating whether the engineering unit does not provide any concrete information about the unit represented.

<div class="api-signature" data-lang="csharp">

```csharp
public bool IsUndefined { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property IsUndefined As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the engineering unit represented does not provide any concrete information; otherwise the value false. This property provides by default the value true in case there the parameterless default constructor is used to create a new instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class.

### NamespaceUri

Gets or sets a value that identifies the organization (company, standards organization) that defines the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) represented.

<div class="api-signature" data-lang="csharp">

```csharp
public string NamespaceUri { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property NamespaceUri As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A string representing the [Uri](https://learn.microsoft.com/dotnet/api/system.uri) of the organization (company, standards organization) that defines the engineering unit.

### UnitId

Gets or sets the numeric identifier of the engineering unit.

<div class="api-signature" data-lang="csharp">

```csharp
public int UnitId { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property UnitId As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The numeric identifier of the engineering unit used for programmatic evaluation. A value equals -1 indicates that the [UnitId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#unitid) is not available for the engineering unit represented.

## Methods

### GetCommonCode

<span class="api-meta">static</span>

Retrieves the common code which is associated with the `unitId` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public static string GetCommonCode(int unitId)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Function GetCommonCode(unitId As Integer) As String
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `unitId` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The numeric unit identifier specified by the OPC Foundation for OPC UA to unique identify a specific unit specified by the UNECE/CEFACT Trade Facilitation Recommendation No.20. |

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The according (mostly three letters) encoded string representation of the unit identified using `unitId` specified. In case there the `unitId` is less or equals zero or results into a non alphanumeric code a null reference (Nothing in Visual Basic).

### ToString

<span class="api-meta">override</span>

Returns a string that represents the current [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/).

<div class="api-signature" data-lang="csharp">

```csharp
public override string ToString()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A string that represents the current [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) including the used [DisplayName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#displayname) (if available), [Description](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#description) (if available), alternatively the [UnitId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/members#unitid) or "Unknown" in case there the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) does not provide any engineering unit information.

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Operators

### Explicit

<span class="api-meta">static</span>

Converts a [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) to an <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.EUInformation">EUInformation</abbr> object.

<div class="api-signature" data-lang="csharp">

```csharp
public static explicit operator EUInformation(OpcEngineeringUnitInfo value)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Narrowing Operator CType(
    value As OpcEngineeringUnitInfo) As EUInformation
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) | A [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) that represents the engineering unit information. |

**Returns**

<abbr title="OPC Foundation stack type, not documented here: Opc.Ua.EUInformation">EUInformation</abbr>

An instance of the <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.EUInformation">EUInformation</abbr> class initialized from the `value`.

### Implicit

<span class="api-meta">static</span>

Converts a <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.EUInformation">EUInformation</abbr> to an [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) object.

<div class="api-signature" data-lang="csharp">

```csharp
public static implicit operator OpcEngineeringUnitInfo(EUInformation value)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Shared Widening Operator CType(
    value As EUInformation) As OpcEngineeringUnitInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.EUInformation">EUInformation</abbr> | A <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.EUInformation">EUInformation</abbr> that represents the engineering unit information. |

**Returns**

[OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/)

An instance of the [OpcEngineeringUnitInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcengineeringunitinfo/) class initialized from the `value`.
