> 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/c37.118-slave/c37.118-slave-example.md).

# C37.118 Slave Example

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

The **C37.118 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\_ > C37118\_Slave** and select **C37\_118\_Slave**, then click **Finish**. This example demonstrates how to use the C37.118 slave (PMU) interface to communicate with a C37.118 master and transmit phasor, analog, and digital measurement channels. The main objective of this example is to show how to configure the C37.118 slave, generate measurement data, and validate the transmitted values using an external C37.118 master tool.

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

In this example:

* The model transmits 8 phasor channels, 2 analog channels, and 2 digital channels, all displayed in the console subsystem.
* The configured nominal frequency is 60 Hz
* The data rate is 60 fps
* Communication uses TCP on port 4712
* The C37.118 master connects using the simulator’s IP address
* Phasors, analogs, and frequency are encoded in INT16 format

Additional details:

* The timestamp is generated internally using the simulator’s motherboard clock. It can be replaced by an external synchronization source if required.
* The nominal frequency (50 Hz or 60 Hz) must match both the driver configuration and the `Nominal_freq` constant in the subsystem before compilation.
* Phasor, analog, and frequency formats (INT16 or FLOAT) can be changed in the interface configuration without recompiling the model.
* The console allows modifying one analog and one digital output value; remaining values are generated randomly.

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

In addition to the requirements stated in the C37.118 Slave **Requirements, Features & Limitations** section, this example requires any external phasor data concentrator (PDC) capable of receiving C37.118 streams such as [PMU Connection Tester](https://github.com/GridProtectionAlliance/PMUConnectionTester).

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

This example illustrates how to configure the C37.118 slave interface, generate PMU data in the model, and validate measurements using a C37.118 master application.

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

1. Adjust the C37.118 slave interface parameters (protocol, port, IP address, phasor representation, phasor format, etc.) as required.
2. Build the C37.118 Slave model.
3. Load and execute the model.
4. Then start the DNP3 master on the external tool.

### Using TPMU Connection Tester <a href="#usingthetrianglecommunicationprotocoltestharness" id="usingthetrianglecommunicationprotocoltestharness"></a>

PMU Connection Tester can simulate a C37.118 master on your workstation.

1. Configure it with the correct communication parameters.
2. In PMU Connection Tester, ensure **Force IPv4 = True** in the *Settings* tab.
3. Depending on the C37.118 standard version:
   * **2005:** Click **Connect** to begin transmission.
   * **2011:** Click **Connect**, send **Config Frame 2**, and then send **Enable Real-Time Data**.

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

Once communication is established, the C37.118 master and C37.118 slave begin exchanging data. Modify values in the console and observe updates in the master tool.

* Because the example model generates synthetic data, values do not represent real power system behavior.
* Phasor angles for voltage (0°, −120°, 120°) and current (−10°, −130°, 110°) create overlapping lines in phasor plots.
* PMU Connection Tester also displays GPS time, frequency deviation, angle, and magnitude for any selected phasor.

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


---

# 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/c37.118-slave/c37.118-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.
