# IOpcTranslatePathsService Members

> Reference: Defines a specialized IOpcService<TResponse, TRequest> which can be used to translate one or more paths (see OpcRelativePath) to one or more node identifiers.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">IOpcTranslatePathsService</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.services">Opc.UaFx.Services</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>

Inherits members from [IOpcService&lt;OpcTranslatePathsResponse, OpcTranslatePathsRequest&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.iopcservice-2/members).

## Properties

### MaxPathsPerTranslate

Gets or sets the maximum number of paths which shall be translated using a single translate request. This number indirectly defines the number of requests used to send a specific number of translate requests to the server.

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

```csharp
uint? MaxPathsPerTranslate { get; set; }
```

</div>

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

```vbnet
Property MaxPathsPerTranslate As UInteger?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[UInt32](https://learn.microsoft.com/dotnet/api/system.uint32)&gt;

The absolute number of translate commands which shall be send to the server per request or a null reference (Nothing in Visual Basic). In case there a specific number of nodes is used, a request with more commands as the [MaxPathsPerTranslate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.iopctranslatepathsservice/members#maxpathspertranslate) is partitioned into multiple requests and the responses of them are accumulated. The default value of this property is a null reference (Nothing in Visual Basic) and means that all commands defined are send to the server using the server defined number of paths per translate request.

### UsedMaxPathsPerTranslate

Gets the maximum number of paths which are translated using a single translate request. This property will use either the [MaxPathsPerTranslate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.iopctranslatepathsservice/members#maxpathspertranslate) or the maximum number of paths which can be translated in one request as defined by the server. The lowest number of paths is used to partition the commands to execute into multiple translate requests.

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

```csharp
uint? UsedMaxPathsPerTranslate { get; }
```

</div>

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

```vbnet
ReadOnly Property UsedMaxPathsPerTranslate As UInteger?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[UInt32](https://learn.microsoft.com/dotnet/api/system.uint32)&gt;

In case there has already been one translate attempt (with more than one translate command) the definite number of commands per translate request; otherwise a null reference (Nothing in Visual Basic).

## Methods

### TranslatePaths

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

| Overload | Description |
|---|---|
| [TranslatePaths(IEnumerable&lt;OpcTranslatePath&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.iopctranslatepathsservice/members#translatepaths-system-collections-generic-ienumerable-of-opc-uafx-opctranslatepath) | Translates one or more paths starting from one or more dedicated nodes using the specified `commands`. |
| [TranslatePaths(params OpcTranslatePath\[\])](#translatepaths-opc-uafx-opctranslatepath-array) | Translates one or more paths starting from one or more dedicated nodes using the specified `commands`. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `commands` sequence or one of its items is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The translate path service is currently not supported, especially using the `commands` specified. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The service execution failed upon different circumstances; for more details see exception details. The following issues can lead to that exception: [BadNothingToDo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo) and [BadTooManyOperations](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanyoperations). |

#### TranslatePaths(IEnumerable&lt;OpcTranslatePath&gt;)

Translates one or more paths starting from one or more dedicated nodes using the specified `commands`.

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

```csharp
OpcTranslatePathResultCollection TranslatePaths(
    IEnumerable<OpcTranslatePath> commands)
```

</div>

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

```vbnet
Function TranslatePaths(
    commands As IEnumerable(Of OpcTranslatePath)) As OpcTranslatePathResultCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `commands` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcTranslatePath](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctranslatepath/)&gt; | A sequence of [OpcTranslatePath](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctranslatepath/) instances to process. |

**Returns**

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

An instance of the [OpcTranslatePathResultCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctranslatepathresultcollection/) class which contains the target identifiers the paths were translated to through the `commands` specified; together with information about the outcome of each processed command.

**Remarks**

Known results for the `commands` specified are:

| Status | Description |
|---|---|
| [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid) | For more details see [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid). |
| [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown) | For more details see [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown). |
| [BadNothingToDo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo) | This code indicates that the relativePath contained an empty list. |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | This code indicates that a TargetName was missing in a RelativePath. |
| [UncertainReferenceOutOfServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#uncertainreferenceoutofserver) | The path element has targets which are in another server. |
| [BadTooManyMatches](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanymatches) | The requested operation has too many matches to return. Users should use queries for large result sets. Servers should allow at least 10 matches before returning this error code. |
| [BadQueryTooComplex](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badquerytoocomplex) | The requested operation requires too many resources in the server. |
| [BadNoMatch](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnomatch) | The requested relativePath cannot be resolved to a target to return. |

#### TranslatePaths(params OpcTranslatePath\[\])

Translates one or more paths starting from one or more dedicated nodes using the specified `commands`.

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

```csharp
OpcTranslatePathResultCollection TranslatePaths(
    params OpcTranslatePath[] commands)
```

</div>

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

```vbnet
Function TranslatePaths(
    ParamArray commands As OpcTranslatePath()) As OpcTranslatePathResultCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `commands` | params [OpcTranslatePath](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctranslatepath/)[] | An array of [OpcTranslatePath](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctranslatepath/) instances to process. |

**Returns**

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

An instance of the [OpcTranslatePathResultCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctranslatepathresultcollection/) class which contains the target identifiers the paths were translated to through the `commands` specified; together with information about the outcome of each processed command.

**Remarks**

Known results for the `commands` specified are:

| Status | Description |
|---|---|
| [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid) | For more details see [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid). |
| [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown) | For more details see [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown). |
| [BadNothingToDo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo) | This code indicates that the relativePath contained an empty list. |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | This code indicates that a TargetName was missing in a RelativePath. |
| [UncertainReferenceOutOfServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#uncertainreferenceoutofserver) | The path element has targets which are in another server. |
| [BadTooManyMatches](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanymatches) | The requested operation has too many matches to return. Users should use queries for large result sets. Servers should allow at least 10 matches before returning this error code. |
| [BadQueryTooComplex](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badquerytoocomplex) | The requested operation requires too many resources in the server. |
| [BadNoMatch](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnomatch) | The requested relativePath cannot be resolved to a target to return. |
