> 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/communications/slave-rtus-store-and-forward.md).

# Slave RTUs and store and forward

Use an XL4 Plus as a master to poll up to eight slave RTUs, or to pass DATRAN traffic on to them.

An XL4 Plus can talk to up to eight slave RTUs. Use this when the slaves have no direct comms path to the base station, or when sites need to exchange I/O for a local control loop.

There are three ways to use it:

1. **Polling:** the XL4 Plus can be a master to the slave RTU(s) by polling them.
2. **Store and forward:** the XL4 Plus can act as a pure store and forward device to other RTU(s) by passing on commands to/from DATRAN base station.
3. **Both:** perform both polling and store and forward.

{% hint style="info" %}
**Applies to:** XL4 Plus firmware v7.x with store and forward licensed (fully featured units). An XL4 Plus master can have XL4 Plus, XL4 or eXcel (Q03) slave RTUs. An XL4 master can have XL4 Plus slaves, but QTech recommends the master is always an XL4 Plus.
{% endhint %}

![Store and forward: DATRAN VI talks to the XL4 Plus master over Ethernet; the master talks to the XL4 Plus slave through a pair of Tait TM8xxx radios on RS232](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2F7KSGg68NEkhlkSpLQPlr%2Fdiagram-store-and-forward.png?alt=media)

This example sets up pure store and forward: DATRAN has full control of the slave.

## 1. Set up the master RTU

1. Set up the master's Ethernet port and DATRAN link: the RTU address used in DATRAN (for example 13) and DATRAN's TCP port (for example 4001). See [Configure](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/configure.md).
2. Select **Datran – Slave RTUs**, then in the Properties page on the right:
   * Check the **Enabled** box.
   * Select the serial port (**RS232A**).
   * Select the Equipment (**Tait Radio**).
   * For a pure Store and Forward scenario uncheck **RTU ACKs COS** and **RTU Controls Outputs**, as we want Datran to have full control of the Slave RTU.
   * Set the **Notional Point Count**, this is the point count for the Master RTU.

## 2. Add each slave to the master

1. Right Click on **Datran – Slave RTUs** → **Add** → **Slave RTU**.
2. Optionally, give it a name.
3. Set the slave RTU address (11).
4. Uncheck the **Poll Enabled** box. For a pure store and forward site this is unchecked. Optionally it can be checked for testing purposes (to establish comms with the slave is working) or if the Master RTU needs to use the slave I/O (e.g., in its DLP).
5. Set the **Telemetry Point Count** for the Slave RTU. Set the **Notional Point Count** for the Slave RTU.

{% hint style="warning" %}
If **Poll Enabled** is ticked, DATRAN has full control, and the master has no DLP, the master sets the slave's outputs from its own data each time it polls. For example, DATRAN sets a slave output to 1, then the master's next poll sets it back to 0. To prevent this, load a dummy DLP containing `telinp` and `telout` into the master.
{% endhint %}

## 3. Set up the slave RTU

Set up the slave like any RTU that talks directly to DATRAN. There are no store and forward settings on the slave.

1. Select **Datran – Base Station (serial)**.
2. Check the **Enabled** box.
3. Select the serial port (**RS232A**). Select the Equipment (**Tait Radio**).
4. Set the address (11): this must be the same as that specified at the Master RTU.

## 4. Set up DATRAN

The master and each slave are separate sites in DATRAN. Nothing at that level shows that a site is a slave.

**Master site:**

* **Slave addresses** tab, we enter the address of the slave (RTU 11). There can be up to eight slave RTUs.
* The **Point Count** tab settings need to agree with those entered in Workbench.

**Slave site:**

* Set the channel to the master's channel (Ethernet in this example), even though the master talks to the slave by radio. DATRAN's messages go to the master first.
* The **Comms Settings** tab has the IP address automatically set to **Slave**.
* As for the Master site, the **Point Count** tab must also agree with the points configured in Workbench.

### Data logging on slave RTUs

Slave RTUs can use RTU data logging: the master passes the logging datagrams through. In each site's `_comms_hist_data_` node, set the datagram version to **2** for an XL4 Plus and **1** for any other RTU. See [Data logging and the archive log](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/data-logging.md).

## Things to plan for

* **Base comms channel.** A master with slaves becomes a busy, critical site. Make sure its channel to DATRAN has enough bandwidth: QTech recommends high-speed radio, Ethernet or cellular.
* **Power.** The master and its radio transmit more often than a normal site. Size the UPS or backup battery for the extra load.
* **Point count.** Add up the I/O of the master and all its slaves. If it's more than 255 digitals or 128 analogues, use DATRAN's Extended Point Count feature (DATRAN VI v6.70 or later, up to 65,535 points).
