> 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/hypersim/automation-api-and-scripting/automate-using-testview/testview-examples/automate-fault-timing-tests.md).

# Automate Fault Timing Tests

## Description

This example demonstrates how to use TestView to automatically vary fault timing in the **HVAC\_500kV\_6Bus** example model found under **Transmission**.

The test will run **three iterations**, setting the fault time to:

* **0.025 s**
* **0.050 s**
* **0.075 s**

Waveforms will be used to confirm the timing changes.

## Detailed explanation

{% stepper %}
{% step %}
**Prepare the example**

Prepare the base of the example by follow the steps in **Launch TestView & Run a Test** section: Open the **HVAC\_500kV\_6Bus** example model, load the `.csv` sensors file, start and stop the simulation once, then launch TestView and create a new TestView project, study, and test, adding the required **HYPERSIM Test** and **HYPERSIM Settings** commands.
{% endstep %}

{% step %}
**Verify HYPERSIM Settings**

In the TestView test sequence, double‑click the **HYPERSIM Settings** command to open the dialog and ensure **Disable Time Events (clrtab)** is **unchecked**. This ensures time‑based events (faults, operations) will be executed.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-3de08487c289ed2c13a4f00058fa58e61f49b0d7%2Fimage%20(1333).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add a 1‑second delay using the Sleep command**

Adding a 1-second delay ensures the simulation reaches steady‑state before the fault. In the **Palette** tab, click **Sleep**, accept the default **1‑second** delay and click **Apply**.

The script now begins with:

* HYPERSIM Test
* HYPERSIM Settings
* Sleep (1s)

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-36f5251f48c68c4f950fd22bed063b705464bdf8%2Fimage%20(1334).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Verify the Fault block parameters in HYPERSIM**

1. In the HYPERSIM model, double‑click the **Fault** block:

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-8e3dbf164ce118324b3f40fd306ca541cbca3f75%2Fimage%20(1336).png?alt=media" alt=""><figcaption></figcaption></figure>

2\. Confirm:

* **General Operation** is **disabled** in the Timing tab (we will enable it via TestView).
* **T1** and **T2** are enabled and configured for a **phase A to ground** fault.
* **Steady‑State Operation** options must be grey (no permanent faults applied).

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-c410213610c30192f69104518c33c4f4a9c6f2f9%2Fimage%20(1337).png?alt=media" alt=""><figcaption></figcaption></figure>

These can be set via TestView, but are verified manually here.
{% endstep %}

{% step %}
**Identify parameter names (e.g., EnaGen)**

To control the **Fault** block from TestView, you must find the parameter name. Either use the:

* **Hover tooltip:** Move the cursor over the option → name appears in brackets (e.g., **EnaGen**).

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-601befb899ff9d6307d68d37797f6ea196e96eef%2Fimage%20(1338).png?alt=media" alt="" width="378"><figcaption></figcaption></figure>

* **Netlist:** Open the **Netlist** (HYPERSIM tab > Netlist). All components and their parameter names are listed.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-3564d8be25f4f4a1909cbaf9932b6562bff644d8%2Fimage%20(1339).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add a Miscellaneous command to enable the fault**

In TestView, add a **Miscellaneous** command. In the **Parameter** section, each drop‑down menu should display a list of components and parameters from the model.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-4f9c096174522e4d828a16330d64b02395c449a7%2Fimage%20(1398).png?alt=media" alt="" width="432"><figcaption></figcaption></figure>

{% hint style="info" %}
If drop‑downs are empty, reconnect TestView to HYPERSIM: Close HYPERSIM and TestView, open the **copy** of the model located in `ProjectName\bank\hnk\ProjectName.ecf`, run the model once and re-open TestView. Alternatively, use the **connection icon** to disconnect/reconnect.
{% endhint %}

In the **Component** drop-down list, select **Fault**. In the **Parameter** drop-down list, select **EnaGen**. In the **Value** field, type **1**. Click **Add**, then **Apply.**

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-2e75e00fa22e999f8c785d03b3aa3b8ba98b8914%2Fimage%20(1399).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If the **Miscellaneous** command is not inserted directly after the **Sleep** command, use the arrow buttons to move it into the correct position.

<img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-0563e91f10e7dcec562de74ea2e432216df2e604%2Fimage%20(1400).png?alt=media" alt="" data-size="original">
{% endhint %}
{% endstep %}

{% step %}
**Add a Snapshot command**

Snapshots preserve currents and voltages, ensuring each iteration starts under identical conditions.

Add a **Snapshot** command, select **Take a snapshot of the simulation** and click **Apply**.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-36a0c5bd2b6747a74b12a9b738b9a2261f877d13%2Fimage%20(1401).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add a Loop command for three iterations**

Add a **Loop** command, check the **User defined** and **Operation** boxes, set **Initial value** to 0, **Final value** to 3 and **Step value** to 1. Click **Apply**. Each iteration now represents one fault timing test.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-d5446595ccd6932c4d913e2eb8cb2a9c5f22d2de%2Fimage%20(1402).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Load the Snapshot inside the loop**

Add another **Snapshot** command. Uncheck **Take snapshot**, check **Load the current snapshot**, and click **Apply**. This ensures each iteration starts from the same steady‑state.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-dc706f553f399d1d2c7505ccbd503d844a7fc32b%2Fimage%20(1403).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Set fault timing using the Breaker command**

1. Add a **Breaker** command, enable **multi‑param**, select component **Fault** and check parameters **SW\_T1** and **SW\_T2**.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-dbc00a166de38125021ec6da5a7e392c712d721d%2Fimage%20(1404).png?alt=media" alt=""><figcaption></figcaption></figure>

2. For both SW\_T1 and SW\_T2 tabs, press **Add** three times and enter the timings **0.025 / 0.050 / 0.075**, then click **Apply**.

{% hint style="info" %}
If a tab is red, it does not have the same number of rows as the others.

The loop runs **3 iterations**, so only the first three rows are used.
{% endhint %}
{% endstep %}

{% step %}
**Add the Processing command**

Add a **Processing** command from the **Main** folder to acquire signals using ScopeView’s engine.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-d880c805eeba97dbae52fdf3a2ef129b85dc58bd%2Fimage%20(1405).png?alt=media" alt="" width="152"><figcaption></figcaption></figure>

In the **General** tab:

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-8ca6740b851ceca1e7827f6b79e52757ac7f30d1%2Fimage%20(1408).png?alt=media" alt=""><figcaption></figcaption></figure>

1. Set the **Sampling rate** = `1 / timestep` = **20,000 Hz** for 50 µs timestep and check both the **Synchronization** (POW-based) and **Operation sequence** (executes fault and breaker sequence) boxes.
2. Click **Signals Key**, select the **Breaker** category and click once on **Fault.CMDa** (command signal from **Fault** block), **Di1.Ia**, **Di1.Ib** and **Di1.Ic** (currents from the breaker near the fault location) to select them.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-e8b63e79133242158d9747ef042a5bb8a192d3dc%2Fimage%20(1406).png?alt=media" alt=""><figcaption></figcaption></figure>

3. Save as a new keyname, give a name and then click **Ok**.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-cf6ac15a32c80c3689663f7aafa67eaed31f5950%2Fimage%20(1407).png?alt=media" alt=""><figcaption></figcaption></figure>

In the **Processing** tab:

Only the signals from the Signals Key appear. Click once on **Fault.CMDa**, **Di1.Ia**, **Di1.Ib** and **Di1.Ic** to select them. Click **Apply**.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-161eca014a7e59a4fe3a284a537214b9e2ea232e%2Fimage%20(1409).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Review the test sequence**

The test sequence is now complete and should look like in the following image.

Go to the **View** tab and check **Show** under the **Processing** section. This displays waveforms after each iteration.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-fdc01cc8d5706f01c2757ff0872e20bd2b7cc065%2Fimage%20(1411).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Run the test**

In the **Runner** tab, choose **Current test only**, then press **Play**.

After each test:

* A ScopeView window appears
* Close each window to proceed to the next iteration

Waveforms show the automatically varied fault timings and corresponding current responses.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-c551115f13ad2f145d98663440850cb45ecbb731%2Fimage%20(1412).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Additional Considerations**

* By default, the data is saved in COMTRADE format in the project directory. Use **Export** to save results in different formats.
* To run without viewing waveforms, uncheck **Show** in the View tab.
* Fault cannot occur at exactly 25 ms because it falls between time‑steps; TestView schedules it at the nearest step.
* The breaker reclosing timing may need adjustment (e.g., 0.35 s instead of 0.2 s).
  {% endhint %}


---

# 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/hypersim/automation-api-and-scripting/automate-using-testview/testview-examples/automate-fault-timing-tests.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.
