> 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-telemetry/datran-xl4-plus-rtu/data-logging/set-up-rtu-data-logging.md).

# Set up RTU data logging in DATRAN VI

Add a \_Comms\_Hist\_Data\_ node, choose the points and intervals, and set how often DATRAN collects the log.

You set up RTU data logging in DATRAN VI, by adding a `_Comms_Hist_Data_` node to the site. You can't set it up in QTech Workbench. DATRAN then collects the logged data from the RTU at a set rate and stores it in its SQL database, for trending and reports.

{% hint style="info" %}
**Applies to:** XL4 Plus with DATRAN VI. Use datagram version 2. Logging more than 35 points needs firmware V7.18 or later and DATRAN VI V6.78 or later.
{% endhint %}

The Data Logging can be configured to be:

* Interval (e.g. every 10 minutes)
* Digital State Change (e.g. off-on)
* Analogue changes by a dead band (e.g. 5% variation).

## 1. Add the node

1. A node can be added to an existing one (site node) by selecting the relevant node and right-click on the mouse or by using **Insert** on the keyboard.
2. An **Insert Node** window will pop up where the required node can be selected. In this instance, navigate to the **Logging** tab.
3. Double-click **\_Comms\_Hist\_Data\_**, or select it and click **OK**. The Historical Data Configuration window opens.

## 2. Set the properties

| Property                    | Default           | What it does                                                                                                                                                                                                                                                     |
| --------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Request Rate                | 10 min            | How often the RTU is queried from DATRAN VI for more historical data.                                                                                                                                                                                            |
| Request Offset              | 0 ms              | The Request Offset property allows you to stagger the queries when you have multiple data logging RTUs and do not wish to have all the RTUs queried at the same time.                                                                                            |
| Request Byte Count          | 200               | Specifies the size of a data retrieval network packet. For fast channel types such as TCP this value can be increased to give larger incoming packets sizes and thus quicker downloads of historical logging. For slower radio channels this is not recommended. |
| Comms Path                  | \_Comms\_Object\_ | Specifies the path where the associated \_Comms\_Object\_ can be found. By default, it is assumed to be at the same level within DATRAN.                                                                                                                         |
| Request Timeout             | 5 min             | Specifies the maximum time for a request for historical data to receiving the reply. If a reply is not received within this time a retry will occur.                                                                                                             |
| Interval Rate               | 10 min            | How often the RTU logs interval data (only valid for points using interval logging). This value does not apply for Datagram 2 RTU Logging and is only valid for Datagram 1 RTU Logging.                                                                          |
| Startup Delay               | 1 min             | Specifies a delay from when the system starts until the first Historical Data network packet is sent. This is useful for reducing startup bandwidth.                                                                                                             |
| Datagram Version            | 1                 | Datagram 1 is for older DATRAN RTUs (Q22, Q03, eXcel, XL4). Datagram 2 is for DATRAN XL4 Plus RTUs only.                                                                                                                                                         |
| Request Start, Request Stop |                   | Date range of data to be requested. DATRAN VI uses this parameter for the Request Rate as well as for Manually requesting Logged Data from an RTU.                                                                                                               |

## 3. Choose the points

You can log these point types:

* RDI: real digital inputs
* RAI: real analogue inputs
* NDI: notional digital inputs
* NAI: notional analogue inputs

For each point, set:

* **Interval:** the drop-down runs from 10 seconds to 12 hours. You can type your own, such as `5 sec`, `3 min` or `4 hr`, if you keep that format. Firmware V7.18 and later log reliably down to 1-second intervals.
* **Event:** log on change. Digital points have no dead band: they're either 1 or 0.

Digital points are only logged when they change state, not at intervals. To find a digital value at a given time, work back to its last change.

You can use interval and event logging together, but it's not recommended: it makes the log much bigger.

### How many points

| Firmware       | Maximum logged points               |
| -------------- | ----------------------------------- |
| V7.17 or older | 35 (RDI, RAI, NDI and NAI combined) |
| V7.18 or later | 255                                 |

To log more than 35 points you also need DATRAN VI V6.78 or later, and you may need to change the segment size in the site's comms object. QTech's DATRAN V6.78 application notes cover the settings: ask QTech for them.

## How DATRAN collects the log

* The RTU stores the log in a circular buffer: when it's full, the oldest records are overwritten.
* Collecting the log doesn't delete it. DATRAN can collect it again, from any start date and time.
* DATRAN collects the log at the Request Rate, typically every hour. Separately, RTUs are usually polled every 15 minutes for current values.
* The RTU Logged Data can be retrieved manually from DATRAN VI by right-click on the `_Comms_Hist_Data_` node in DATRAN VI Browser and selecting **Request Data**.

## Example: drinking water standards

A typical site logging for the Drinking Water Standards (DWS 2008, section 3.2) might log:

* every minute: UV dose or intensity, UVT (UV transmittance), turbidity, flow and differential pressure
* every 5 minutes: chlorine and pH

To check how long the log will last, see [Data logging and the archive log](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/data-logging.md).
