> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/configure-ios/communication-protocol-ios/iec-60870-5-104-slave/iec-60870-5-104-slave-example.md).

# IEC 60870‑5‑104 Slave Example

## Description <a href="#description" id="description"></a>

The **IEC 60870‑5‑104 Slave** example can be created by starting a new RT‑LAB project. From the menu bar, select **File > New > RT‑LAB Project**. Enter a name and location for your project, then click **Next**. From the available templates list, navigate to **IO > Generic > IEC\_60870\_5\_104\_Slave** and select **IEC 60870‑5‑104 Slave**, then click **Finish**. This example demonstrates how to use the IEC 60870‑5‑104 slave interface to simulate an IEC 60870‑5‑104 slave device that communicates with an external IEC 60870‑5‑104 master over Ethernet using TCP/IP.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-c0efe205032e2576431f29d14633cc154583d4ba%2FDR-rtlab-iec104-ex.png?alt=media" alt="" width="422"><figcaption></figcaption></figure>

This example shows how to exchange multiple IEC 60870‑5‑104 data types between the simulated slave and a master device, including indications, measured values, and control commands. An external IEC 60870‑5‑104 master is required to communicate with the simulated slave.

## Requirements

In addition to the requirements stated in the IEC 60870‑5‑104 Slave **Requirements, Features & Limitations** section, this example requires an IEC 60870‑5‑104 master device or software capable of establishing a TCP/IP connection with the simulated slave using the configured IP address, TCP port, and ASDU address.

## Detailed explanation

The slave supports general interrogation, group interrogation, spontaneous event reporting, control commands, and time synchronization, allowing realistic interaction with a control station.

### Model preparation and configuration

1. Adjust the IEC 60870‑5‑104 slave interface parameters (TCP port, IP address, ASDU address, number of configured data points, etc) if required.
2. Build the IEC 60870‑5‑104 Slave model.
3. Load and execute the model.
4. Then start the external IEC 60870‑5‑104 master.

## Simulation and results

Once the simulation is running, the IEC 60870‑5‑104 master can establish a TCP/IP connection to the simulated slave using the configured communication parameters. The master session must be configured with an ASDU address and TCP port matching the slave configuration. In this example, the slave IP address is set to **AUTO**, so the simulator IP address is used.

After the connection is established, the master can read values using general or group interrogation commands and can control writable data points. Changes made by the master are reflected in the simulation and displayed in the console subsystem. Likewise, values controlled by the simulation are transmitted to the master, either cyclically, on request, or spontaneously, depending on the configured reporting mode.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/configure-ios/communication-protocol-ios/iec-60870-5-104-slave/iec-60870-5-104-slave-example.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
