> 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-61850-9-2-sv/iec-61850-9-2-sv-faults-example.md).

# IEC 61850‑9-2 SV Faults Example

## Description

The **IEC 61850 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\_61850** and select **IEC\_61850\_SV\_faults**, then click **Finish**. This example demonstrates how to interface the RT‑LAB simulator with Intelligent Electronic Devices (IEDs) and with Human‑Machine Interface (HMI) clients that comply with the IEC 61850 standard.

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

The model showcases high‑speed Sampled Values publishing and subscribing, enabling distributed applications that rely on voltage and current data transmitted over the IEC 61850 Process Bus. It also illustrates how to introduce controlled communication faults on SV streams, emulating adverse network conditions or cyber‑attack scenarios.

This example includes:

* **1 SV publisher with fault‑injection capability**
* **1 SV subscriber**
* **One SV stream** (80 samples/cycle @ 60 Hz → 4800 frames/s) transmitted on **eth1**
  * Stream ID: **OPALRT\_MU\_1**
  * MAC address: **01‑0C‑CD‑04‑00‑00**

Time synchronization is set to **Poll CPU clock**, meaning sampling and transmission timestamps are derived from the target system clock.

## Requirements

[Verify that an active RT-LAB license](https://www.opal-rt.com/docs/rt-lab/licensing-reference/simulator-license.md) with the following features is installed on the simulator:

<table><thead><tr><th width="320">Feature Name</th><th width="155">Required Status</th><th width="265">Description</th></tr></thead><tbody><tr><td>DP_IEC61850_SAMPLED_VALUES_PUB</td><td>enabled</td><td>Enables IEC 61850 Sampled Values publishing</td></tr><tr><td>DP_IEC61850_SAMPLED_VALUES_SUB</td><td>enabled</td><td>Enables IEC 61850 Sampled Values subscribing</td></tr><tr><td>IEC61850_SAMPLED_VALUES_FAULT_INJECTION</td><td>enabled</td><td>Enables IEC 61850 data integrity manipulation</td></tr><tr><td>DP_TOTAL_NUMBER</td><td>50 enabled (or more)</td><td>Activated I/O data points for Ethernet-based communication protocols</td></tr></tbody></table>

In addition to the simulator license, this example requires:

* A **network infrastructure supporting multicast** for Sampled Values (SV) traffic
* **At least two enabled network interfaces** on the simulator, with **one interface dedicated to SV streaming**

For **SV loopback scenarios**, the dedicated SV network interface **must be physically connected to an Ethernet switch** (NIC-to-NIC loopback is not supported).

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

This example illustrates how to simulate a complete IEC 61850 SV environment in real‑time. The model publishes and subscribes to SV frames using dedicated communication threads running in parallel with the simulation engine. Data is exchanged between the real‑time engine and the communication services via shared memory, ensuring precise timing and deterministic behavior.

A key feature of this example is the **fault‑injection mechanism**, allowing users to simulate network disruptions, delays, duplicate frames, counter manipulation, and quality corruption. These scenarios support testing of protection algorithms, validation under unreliable network conditions, and cyber‑security experimentations.

### Model preparation and configuration

1. Configure the Sampled Values I/O using the IEC 61850 configuration panel:

* Define **SV publisher stream** parameters (sample rate, MAC address, Ethernet interface).
* Configure **SV subscriber** to decode the OPALRT\_MU\_1 stream.
* Set time synchronization to **Poll CPU clock**.

2. Build the model in RT‑LAB.
3. Load and execute the model.

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

Once the simulation starts, the SV publisher transmits the OPALRT\_MU\_1 stream on **eno2**, while the subscriber decodes voltage, current, `smpCnt`, `smpSynch`, and quality attributes.

From the console interface, users can:

**For Sampled Values publisher**

* Pause or resume SV transmission
* Modify voltages, currents, or quality flags
* Trigger fault‑injection scenarios
* Observe immediate effects on transmitted SV streams

**For Sampled Values subscriber**

* Monitor decoded voltage and current values
* Observe quality attribute changes
* View `smpCnt` behavior during network disruptions
* Validate fault responses using the scope for `smpCnt` or other signals

**Fault‑injection scenarios**

The following faults can be configured:

* **Stop Transmission:** SV frames stop for a configurable duration.\
  The subscriber's `smpCnt` freezes and resumes afterward.

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

* **Delay Transmission:** Frames are delayed by a configurable duration. The subscriber sees `smpCnt` stall, then resume with an offset.

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

* **Duplicate Transmission:** Frames are duplicated temporarily. Visible through external tools like Wireshark.

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

* **smpCnt Manipulation:** Publisher overrides the counter with a custom value.

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

* **smpSynch Manipulation:** Publisher forces a configured synchronization flag.

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

* **Quality Manipulation:** Voltage/current quality flags are replaced with custom values.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-dde993eabc7c78c722eb51b25082220b666c150f%2FDR-rtlab-sv-ex7.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/iec-61850-9-2-sv/iec-61850-9-2-sv-faults-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.
