> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/opcua/read.md).

# Read

Task for reading data from OPCUA Server.

Task version: 1.1.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Opcua/tree/main/Frends.Opcua.Read>

## Task Parameters

{% tabs %}
{% tab title="Input" %}

| Name                      | Description                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Mode : `OpcOperationMode` | <p>Determines the mode for either reading specific nodes or browse existing nodes.</p><p>Possible values:</p><ul><li><code>Read</code>: Reads specific nodes specifyed in NodeIds parameter.</li><li><code>Browse</code>: Browses existing nodes using StartNodeId parameter.</li></ul><p><br>Default: <code>Read</code><br>Example: <code>OpcOperationMode.ReadNodes</code></p> |
| NodeIds : `String[]`      | <p>List of NodeIds to read from the OPC UA Server.</p><p><br>Default: <code>-</code><br>Example: <code>\[ "ns=2;i=1001", "ns=2;s=Temperature" ]</code></p>                                                                                                                                                                                                                       |
| StartNodeId : `String`    | <p>NodeId of the node where browsing should be started.</p><p><br>Default: <code>-</code><br>Example: <code>ns=2;s=Temperature</code></p>                                                                                                                                                                                                                                        |
| {% endtab %}              |                                                                                                                                                                                                                                                                                                                                                                                  |

{% tab title="Connection" %}

| Name                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ServerName : `String`                       | <p>OPC UA Server name or IP address.</p><p><br>Default: <code>localhost</code><br>Example: <code>localhost</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Port : `Int32`                              | <p>Port to be used to connect to the OPC UA Server.</p><p><br>Default: <code>4080</code><br>Example: <code>4080</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Path : `String`                             | <p>Optional parameter to set a specific path to the server URL.</p><p><br>Default: <code>-</code><br>Example: <code>path</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| AutoAcceptUntrustedCertificates : `Boolean` | <p>Whether to accept untrusted/self-signed server certificates.</p><p>Set to false in production environments.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Authentication : `AuthenticationMode`       | <p>Authentication to be used connecting to the OPC UA Server.</p><p>Possible values:</p><ul><li><code>Anonymous</code>: No authentication is used to connect.</li><li><code>UsernamePassword</code>: Username and password authentication is used.</li><li><code>Certificate</code>: Certificate authentication is used.</li></ul><p><br>Default: <code>UsernamePassword</code><br>Example: <code>AuthenticationMode.UsernamePassword</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Username : `String`                         | <p>Username for the authentication.</p><p><br>Default: <code>-</code><br>Example: <code>user</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| 🗝Password : `String`                       | <p>Password for the authentication.</p><p><br>Default: <code>-</code><br>Example: <code>pass</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| CertificatePath : `String`                  | <p>Path to the certificate to be used to authenticate to OPC UA Server.</p><p><br>Default: <code>-</code><br>Example: <code>C:\path\to\certificate</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 🗝CertificatePassword : `String`            | <p>Password for the certificate file.</p><p><br>Default: <code>-</code><br>Example: <code>Password</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| PrivateKeyPath : `String`                   | <p>Path to the private key. Used forr certificate authentication if .der or .crt typed certifications are being used.</p><p><br>Default: <code>-</code><br>Example: <code>C:\path\to\privatekey</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ConnectionTimeout : `Int32`                 | <p>Connection timeout in seconds.</p><p><br>Default: <code>10</code><br>Example: <code>10</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| SessionTimeout : `Int32`                    | <p>Session timeout in seconds.</p><p><br>Default: <code>60</code><br>Example: <code>60</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| SecurityMode : `OpcMessageSecurityMode`     | <p>Defines the OPC UA message security level applied to communication between client and server.</p><p>Controls whether messages are sent without security, digitally signed for integrity,</p><p>or both signed and encrypted for full confidentiality and protection against tampering.</p><p>Possible values:</p><ul><li><code>None</code>: No message security is applied. Messages are sent in plain text without signing or encryption.</li></ul><p>This mode provides no confidentiality or integrity protection and should only be used in trusted environments such as development or isolated networks.</p><ul><li><code>Sign</code>: Messages are digitally signed to ensure data integrity and authenticity.</li></ul><p>The content is not encrypted, meaning it can still be read in transit.</p><p>This mode protects against tampering but does not provide confidentiality.</p><ul><li><code>SignAndEncrypt</code>: Messages are both signed and encrypted.</li></ul><p>This provides full confidentiality, integrity, and authentication of OPC UA communication.</p><p>This is the recommended mode for production and untrusted networks.</p><p><br>Default: <code>None</code><br>Example: <code>OpcMessageSecurityMode.None</code></p>                          |
| ApplicationCertificatePath : `String`       | <p>Optional path to a PFX/PKCS#12 file to use as the client application certificate</p><p>for establishing a secure channel. When left empty a temporary self-signed certificate</p><p>is generated for the duration of the task and discarded afterwards.</p><p>Requires ApplicationCertificatePassword if the PFX is password protected.</p><p><br>Default: <code>-</code><br>Example: <code>C:\path\to\cert</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| 🗝ApplicationCertificatePassword : `String` | <p>Password for the PFX file specified in ApplicationCertificatePath.</p><p>Leave empty if the certificate has no password.</p><p><br>Default: <code>-</code><br>Example: <code>passphrase</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| SecurityPolicy : `OpcSecurityPolicy`        | <p>Defines the cryptographic algorithm set used for securing OPC UA communication.</p><p>Includes encryption algorithms, hashing functions, and key exchange mechanisms.</p><p>The selected policy must be supported by the server endpoint and compatible with the chosen SecurityMode.</p><p>Possible values:</p><ul><li><code>None</code>: No security policy is applied.</li></ul><p>Communication is unencrypted and unsigned.</p><p>This should only be used in development or fully trusted environments.</p><ul><li><code>Basic256Sha256</code>: Legacy security policy using RSA encryption with SHA-256 hashing.</li></ul><p>Widely supported by industrial OPC UA servers and older PLC implementations.</p><ul><li><code>Aes128Sha256RsaOaep</code>: Modern security policy using AES-128 encryption, SHA-256 hashing, and RSA-OAEP key exchange.</li></ul><p>Provides strong security and is widely used in current OPC UA implementations.</p><ul><li><code>Aes256Sha256RsaPss</code>: High-security policy using AES-256 encryption, SHA-256 hashing, and RSA-PSS signatures.</li></ul><p>Designed for environments requiring maximum cryptographic strength and compliance.</p><p><br>Default: <code>None</code><br>Example: <code>OpcSecurityPolicy.None</code></p> |
| {% endtab %}                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

{% tab title="Options" %}

| Name                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ApplicationName : `String`       | <p>Application name used when connecting to the OPC UA Server.</p><p><br>Default: <code>Frends.OpcUa.Client</code><br>Example: <code>Frends.OpcUa.Client</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| PkiRootPath : `String`           | <p>The root directory path where the OPC UA client PKI store is located.</p><p>The SDK will create the following subdirectories automatically:</p><p>own — stores the auto-generated client application certificatetrusted — stores trusted server certificatesrejected — stores rejected server certificates</p><p>On first connect the SDK generates a self-signed application certificate and saves it</p><p>under {PkiRootPath}/own, which is then reused on subsequent runs.</p><p>Only applicable when OpcMessageSecurityMode is anything other than None.</p><p><br>Default: <code>-</code><br>Example: <code>./pki</code></p> |
| ThrowErrorOnFailure : `Boolean`  | <p>Whether to throw an error on failure.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ErrorMessageOnFailure : `String` | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error message</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| {% endtab %}                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| {% endtabs %}                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

## Task Result

| Name                               | Description                                                                                                                                          |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`                | <p>Indicates whether the read operation was successful.<br>Example: <code>true</code></p>                                                            |
| NodeValues : `Object`              | <p>JSON array of node read results. Each element contains NodeId, Value, DataType, StatusCode, and SourceTimestamp.<br>Example: <code>{ }</code></p> |
| Error : `Error`                    | <p>Error message if the operation failed.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p>                           |
| Error.Message : `String`           | <p>Summary of the error.<br>Example: <code>Unable to join strings.</code></p>                                                                        |
| Error.AdditionalInfo : `Exception` | <p>Additional information about the error.<br>Example: <code>object { Exception AdditionalInfo }</code></p>                                          |

## Task Changelog

Changelog for Task Frends.Opcua.Read.

### \[1.1.0] - 2026-07-23

#### Fixed

* Updated copyright information to comply with Frends platform standards.

### \[1.0.0] - 2026-05-18

#### Added

* Initial implementation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.frends.com/tasks/tasks/opcua/read.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
