> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-opc-ua-server/rtu-logged-data.md).

# Send RTU logged data over OPC UA

Pass RTU logged data collected by DATRAN's HDI on to an OPC UA client, such as a historian, without missing values.

As RTU logged data is received by DATRAN in a batch, DATRAN OPC-UA Server streams the notifications to the OPC-UA Client in a way to ensure no data is missed.

{% hint style="info" %}
**Applies to:** DATRAN OPC UA Server V1.4 and later, with DATRAN VI RTU data logging. In V1.4, data log values now have a source timestamp. For setting up RTU logging, see [RTU data logging (HDI)](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/rtu-data-logging.md).
{% endhint %}

## Set up DATRAN

1. You have to add `_Comms_Hist_Data_` to the "Include" list in TCPServer properties (Datran Browser, `<Computer>\Applications\TCPServer\Properties\Include`). The list is a `\r\n` separated list of special `_*_` nodes (`\r\n` means you have to press Enter after each string).
2. The "TreeBase Write Rate" parameter is only read at start-up or every time the `_Comms_Hist_Data_` object is validated ("Apply"). A sensible value is either 0 (deliver almost immediately – almost because the task is scheduled, not directly performed) or anyway a low value such as 10. A high value may cause the queue to grow too much and eventually overflow.
3. The "DataLog Queue Capacity" must be chosen appropriately. A value of 0 means no queue and the behaviour is the same as before the changes. A value > 0 defines the queue capacity (number of records that can be queued before an overflow occurs).

The updated values are accessible from an OPC UA client as:

```
\Data Root\Sites\<site>\_Comms_Hist_Data_\Points\RAI\1
```

## Set up the OPC UA client

In order to receive all the data log records the OPC UA client must configure monitored items:

| Setting             | Value                                                                                                                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Sampling interval   | To be sampled reasonably fast; a value of 0 can be set, meaning to use the fastest practical rate. DATRAN OPC UA Server uses an exception-based model, therefore the fastest supported rate is 0. |
| Queue size          | To have an adequate queue size (depends on the number of points and sample rate)                                                                                                                  |
| Data change trigger | To be updated whenever the value OR the timestamp change                                                                                                                                          |
| Monitoring mode     | To be monitored in "reporting" mode (this may be the normal case for ready to use, commercial OPC UA clients)                                                                                     |

## Check it works

Credentials used to connect to DATRAN TCP Server are only required by OPC UA Server to write data to the TreeBase, not for connecting. It is therefore important that such credentials are verified after the installation by performing some dummy writes to DATRAN TreeBase – e.g. change a node value from an OPC UA Client and verify that such change is retained, if the credentials are wrong the node retains its original value. See [User does not exist, or writes from the client don't stick](https://help.qtech.co.nz/datran/datran-vi-scada/datran-opc-ua-server/troubleshooting/user-does-not-exist.md).
