> 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/dnp3-master/dnp3-master-example.md).

# DNP3 Master Example

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

The **DNP3 Master** 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\_ > DNP3\_Master** and select **DNP3 Master**, then click **Finish**. This example demonstrates how to use the DNP3 master interface to communicate with a DNP3 slave that provides analog, binary, and double‑bit binary data. The main objective of this example is to show how to configure the DNP3 master, exchange data with a slave device, and observe the interaction between the master subsystem and the console subsystem.

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

In this example:

* The model receives 2 analog, 2 binary, and 2 double‑bit binary values. These are displayed in the console subsystem.
* The model sends 2 analog, 2 binary, and 2 double‑bit binary values. These are defined in the console subsystem.

## Requirements <a href="#requirements" id="requirements"></a>

In addition to the requirements stated in the DNP3 master **Requirements, Features & Limitations** section, this example requires an external DNP3 slave to provide data to the DNP3 master interface. The slave can be any external tool, such as the [Triangle Communication Protocol Test Harness](https://www.trianglemicroworks.com/products/downloads) configured as a DNP3 slave.

## Detailed explanation <a href="#detailedexplanation" id="detailedexplanation"></a>

This example illustrates the setup, configuration, and operation steps required to simulate a DNP3 master that communicates with a DNP3 slave.

### Using Triangle Communication Protocol Test Harness <a href="#usingthetrianglecommunicationprotocoltestharness" id="usingthetrianglecommunicationprotocoltestharness"></a>

The Triangle Communication Protocol Test Harness can simulate a DNP3 slave on your workstation. Set the tool’s host IP address to `*.*.*.*`. This configuration allows the Test Harness to listen on all network interfaces of your workstation, meaning the DNP3 slave will be reachable using your workstation’s IP address.

### Model preparation and configuration <a href="#modelpreparationandconfiguration" id="modelpreparationandconfiguration"></a>

1. Start the DNP3 slave on the external tool first.
2. Adjust the DNP3 master interface parameters (TCP port, IP address, link addresses, read mode, etc.) as required.
3. Build the DNP3 Master model.
4. Load and execute the model.

## Simulation and results <a href="#simulationandresults" id="simulationandresults"></a>

Once communication is established, the DNP3 master and DNP3 slave begin exchanging data according to their configured read and control parameters.

Users can modify analog, binary, and double‑bit binary values in the slave external tool, and these updates will appear in the model console, confirming that the DNP3 master is correctly receiving data. Conversely, any values changed in the model console are reported back to the slave external tool, demonstrating that the master correctly transmits data.


---

# 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/dnp3-master/dnp3-master-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.
