> 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-rtu/configure.md).

# Configure

Connect QTech Workbench, set the RTU address, restore factory defaults, move an eXcel site to the XL4, and connect an SDI-12 interface.

The XL4 is configured using software called “QTech Workbench”. The QTech Workbench software is free to download from the QTech Website. Connection to your PC is via a USB cable (Type A to Type B). The port is labelled “CNFG” on the XL4. QTech Workbench allows the XL4 RTU to be configured both online and offline.

{% hint style="info" %}
**Applies to:** DATRAN XL4 RTU with Q04 firmware v6.x. From the XL4 Owners Manual v1.1 and Quick Start Guide v1.1. In Workbench, choose the device type **DATRAN XL4 RTU**.
{% endhint %}

To install Workbench and connect, see [Install Workbench](https://help.qtech.co.nz/qtech/qtech-workbench/install.md) and [Connect to a device](https://help.qtech.co.nz/qtech/qtech-workbench/connect.md). If the RTU restarts each time Workbench connects, see [The XL4 RTU restarts every time I connect](https://help.qtech.co.nz/qtech/qtech-workbench/troubleshooting/xl4-restarts-on-connect.md).

## Set the RTU address

Every RTU has a unique site address so that a DATRAN base station can communicate with it. When an RTU is installed at site, its address must be configured.

The module address can be any number between 1 and 239.

Unlike older model DATRAN RTUs, the address for the XL4 is configured using QTech Workbench.

## Restore the factory defaults

From time to time it may be necessary for you to reset the XL4 back to factory defaults. There are two ways of doing this.

* **In Workbench:** the factory default settings can also be loaded back into the RTU using the ‘Factory Default’ button at the bottom of the QTech Workbench screen.
* **With the INIT jumper:** there is a jumper on the XL4 main processor board labelled **INIT**. It is normally open, but if the RTU is started up while the jumper is installed it will cause the RTU to restore the factory default settings. The jumper is normally open, and should be returned to the open position after performing a factory default operation. See [Install and wire](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-rtu/install-and-wire.md#q04-processor-board).

## Move an eXcel site to the XL4

This section describes the process required to upgrade the configuration of an existing DATRAN II eXcel RTU site to use the XL4 RTU, and shows how the original configuration can be reused.

### What you need

* Laptop with “Q90” and “QTech Workbench” software installed
* USB cable Type A to Type B (QTech P/N CB-USB-AB)
* Q90 Serial Diagnostics cable D9 Female to RJ45 (QTech P/N PD6502)
* DATRAN VI v6.68 software installed at the Base Station

### Save the eXcel configuration

1. Using the existing Q90 serial diagnostics cable, connect the Laptop to the **DIAG** port on the eXcel RTU.
2. Run Q90 software and click **Load from RTU** button.
3. Once the eXcel RTU’s configuration is successfully loaded save it by clicking **File** menu then **Save Configuration** giving an appropriate filename.
4. Please note down what RTU address number is being used. This will be needed later to check the configuration has been restored correctly. The eXcel RTU with a Q03 uses DIP switches, the XL4 uses Workbench to set this address.

### Load it into the XL4

1. Using the USB cable, connect the Laptop to the XL4 RTU’s **CNFG** port.
2. Run the QTech Workbench software and choose **XL4 RTU** device type before clicking **Connect** button. Ensure that comms status is reported as **Online** before continuing.
3. Load the previously saved configuration into the XL4 RTU by first selecting **Open** from the **File** menu then navigate to the `.Q22` configuration file and then pressing the **Open** button. Then upload the file to the RTU.

### Check it

1. Click the **Disconnect** button in “QTech Workbench”.
2. Cycle the power to the XL4 RTU.
3. Click the **Connect** button in “QTech Workbench”.
4. Download the configuration from the device, by clicking the **Read from Device** button.
5. Ensure the RTU Address and other configuration items are correctly presented.

## DATRAN VI versions

* The XL4 RTU can be used with DATRAN VI software v6.66 Service Pack 2 and above.
* To achieve RTU data logging with an XL4 RTU, the minimum version of DATRAN VI is v6.68.

## Connect an SDI-12 interface

{% hint style="warning" %}
This section is from a draft quick start guide (v0.1). Check with QTech before you rely on it.
{% endhint %}

The SDI-12 protocol specifies an electrical format as well as a how the data is represented. The purpose of the SDI-12 interface device is to convert the SDI-12 electrical signals and data values into RS232 ASCII text that can be communicated with the XL4 RTU. The RTU can then convert the measured values into unsigned 16 bit integers, and store them into its IO table.

### Wiring

* Two transducers can be connected directly to the interface. More transducers can be connected in parallel with a separate termination arrangement if required.
* Always power the SDI-12 Interface from the CTL line out from the XL4. Doing so will ensure that the converter has a ‘clean’ power supply voltage.

### Settings

1. The RTU can be configured to have one SDI-12 interface device connected to either the RS232A or RS232B ports.
2. In Workbench go to the appropriate RS232 port configuration page and change the **Port Function** option to be **SDI-12**. The UART settings are hard coded as 9600, n, 8, 1.
3. Select the number of measurements to add. Up to 8 measurements can be added. Each measurement can have up to 8 values.
4. It is a good idea to have CRC checking enabled, but not all SDI-12 devices support this option. Leave **Mode** as normal.
5. Ensure that the interval is not too short for the number of measurements configured.

The software will automatically create virtual IPB module with an IPB address of 246. The mapping below shows how the SDI-12 measurements would be mapped into the RTUs IO Table if it was the first expansion module. The Interface has been configured to have two measurements. Measurement 1 is from the SDI-12 sensor with address 0, and has 3 values in its list. Measurement 2 is from the SDI-12 sensor with address 1 and has 2 values in its list. Measurement 1: value 1 -> RAI7, value 2 -> RAI8, value 3 -> RAI9. Measurement 2: value 1 -> RAI10, value 2 -> RAI11.

### Scaling

There are four scaling parameters for each value:

| Setting          | Type                    | Meaning                                           |
| ---------------- | ----------------------- | ------------------------------------------------- |
| Unscaled Minimum | Floating point          | The lowest expected input value                   |
| Unscaled Maximum | Floating point          | The highest expected input value                  |
| Scaled Minimum   | Unsigned 16 bit Integer | The output value if the input is Unscaled Minimum |
| Scaled Maximum   | Unsigned 16 bit Integer | The output value if the input is Unscaled Maximum |

The RTU will round the scaled value to the nearest integer and saturate the result to 0 or 65535 depending on whether the result is less than zero or greater than 65535 respectively.

### Comms failure

The XL4 will detect if there has been a communications failure between the RTU and the SDI-12 interface. The XL4 will automatically calculate an appropriate timeout as the shortest configured measurement interval multiplied by 2. So if the Interface is configured to measure with a period of 10 seconds, then the RTU will set the exp fail flag corresponding to the SDI-12 virtual IPB module if it has been more than 20 seconds since it received a measurement. The comms failure flag will be reset the once the XL4 receives a valid measurement.

Workbench diagnostics can be used to check that the XL4 is communicating correctly with the SDI-12 interface, and that the interface is communicating with the transducers. The RTU commands the interface to STOP ongoing measurements, DELETEs the previous configuration, ADDs the new configuration, SAVEs it to the interfaces Non-volatile memory, then STARTs the interface measurement scheduler again.
