> 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/scopeview/use-tools-and-templates/use-the-comtrade-combiner-tool.md).

# Use the Comtrade Combiner Tool

## Description

This tool allows you to group several COMTRADE files from several versions to combine their signals and produce a single file. It can be accessed through the signal selection window, in the top bar by clicking on Tools.

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FcSv7niqw4n1uUANmBmn5%2Fimage.png?alt=media&amp;token=43d66ee3-4265-4f18-aef4-c4bba93cd125" alt=""><figcaption></figcaption></figure>

The combination is done with predetermined parameters to adequately select the desired data. Among these parameters, we find a start and end time in milliseconds, a new sampling rate, the type of interpolation chosen if re-sampling must be done, and the COMTRADE version produced.

It is divided into four sections related to the following image interface:

* Section 1: Contol
* Section 2: Settings
* Section 3: Min/Max comtrade values
* Section 4: Selected Files

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FoblSaPJthlHoVZh5DGO9%2Fimage.png?alt=media&amp;token=66f3544e-4927-4864-817a-356faefdf8d0" alt=""><figcaption></figcaption></figure>

## Section 1: Control

To add multiple files, the user can select a parent folder and all COMTRADE files under that folder is added. To have a better overview, the user can group their COMTRADE files by acquisition types in individual folders under a parent folder:

<div align="center"><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FUKUQmR9XZO2Gvx6Doa96%2Fimage.png?alt=media&amp;token=6038f5df-e535-42fb-890b-f000e3cead9a" alt=""> <img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2F0pQR7hpC3x6yHnWefy7E%2Fimage.png?alt=media&amp;token=f62a8e56-a749-4dc1-8a70-f43e2f777652" alt=""></div>

When selecting the parent folder, all subfolders are read and COMTRADE files are added to the table.

The combiner allows the selection of desired signals from the list of all signals in the added files. To open the menu, the **Signal filter menu...** button must be selected. This menu has two tables and buttons. On the left, we find the list of signals for all the added files:

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2Fb5eJo8zZ8WqxPYPmSAZf%2Fimage.png?alt=media&amp;token=788c8482-6b7f-4a71-890b-838a692bd3f0" alt=""><figcaption></figcaption></figure>

When no signals are selected, the combiner chooses all available signals. To select signals, choose them individually from the table on the left. It is also possible to search for a specific signal in the list using the text field below the table, in addition to being able to select several at once.

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2Fcf2JWXCeEpVole9FiAsI%2Fimage.png?alt=media&amp;token=9b5dfb12-70de-4270-abdc-de1f89c63cd7" alt=""><figcaption></figcaption></figure>

To remove items from the right table, select them and press the **Remove Selected** button or the **Delete** key on the keyboard.

## Section 2: Settings

All settings to create the combined COMTRADE file is here. Choosing parameter values applies a filter to select all signals that meet the desired conditions.

<table><thead><tr><th width="198.54547119140625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Desired frequency</strong></td><td>All signals that are not at the desired frequency is filtered.</td></tr><tr><td><strong>Sampling rate</strong></td><td>All signals that are retained from the filters is interpolated at this frequency.</td></tr><tr><td><strong>Interpolation method</strong></td><td>The retained signals use this interpolation method for the new sample frequency.</td></tr><tr><td><strong>Time start &#x26; Time stop</strong></td><td>It defines the start of the space-time of the generated COMTRADE file. Any signals that exist between the start and the end is chosen. If a signal ends before the end time, NaN values is set, which shows as a blank when read. If a signal starts before the start, only its part after the time start are taken into account. Since all signals are on a time scale, the times chosen here represent absolute space-time.</td></tr><tr><td><strong>Output version</strong></td><td>COMTRADE version generated by the tool. It is possible to combine a single file and change its COMTRADE version.</td></tr><tr><td><strong>Units panel</strong></td><td>Allows you to choose the unit format for the following four types of values: amperage, voltage, wattage and reactive power (VAr)</td></tr></tbody></table>

### Example

If a user wants to combine several small successive acquisitions into a single file, he has to set the start time of the first acquisition and the end time of the last acquisition to filter the good signals.

5 files represent the continuation of a 23-millisecond acquisition. Currently, these files are independent acquisitions in ScopeView. Their start and end times are the same since the files only represent the time-space of their acquisition:

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FwYXZl9nYbFD8zjLrap9w%2Fimage.png?alt=media&amp;token=090e11bd-0efe-4ceb-938c-b5ce256b3437" alt=""><figcaption></figcaption></figure>

If these five files are added to the combiner, their adjustments to real space-time can be made. This means that the signals are referenced according to the start time and the end time indicated in the settings. Using the Maximum Values button (from the next section), a user can enter these parameters automatically:

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FYzgrHbwbsotAOVy1x8dm%2Fimage.png?alt=media&amp;token=e47a893a-0d2b-49dc-af52-8038b52b78a9" alt="" width="563"><figcaption></figcaption></figure>

After the combination, the signals from all five files are centered on the new time reference.

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FV1P2vAQJ229vBXhBaMjP%2Fimage.png?alt=media&amp;token=4084304d-1cf1-4d0a-b81d-533102bb33a5" alt=""><figcaption></figcaption></figure>

Therefore, it is possible to see the sequence of signals, according to their true time reference, using the superposition in ScopeView:

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FQwzkMU5kDgE5qzNQNhdk%2Fimage.png?alt=media&amp;token=89bb6066-e06e-4763-abab-1827b48f99b2" alt=""><figcaption></figcaption></figure>

## Section 3: Min/Max comtrade values

This section has non-editable fields and a button to apply them. These fields represent the maximum information that can be put as parameters. The minimum time represents the signal among the added files with the most recent start time. The maximum time represents the opposite, the oldest time among the signals. Additionally, the highest sampling rate value is present, to allow all signals to be adjusted to the same. This section quickly encompasses and includes all signals from files that are added to the combiner.

It is important to note that combinations are limited to a maximum of 60 minutes for performance reasons.

Additionally, a **Set selected row** button is present to apply the settings of the selected file in the table. When pressed, the settings of the chosen files are now the combination settings. This feature is useful when a user wants to target a specific file among the others.

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FOt1FCUfl737wNxpD1gVS%2Fimage.png?alt=media&amp;token=55a9ee4c-e2c5-4a64-8dc5-08118215e222" alt="" width="159"><figcaption></figcaption></figure>

## Section 4: Selected files

When adding a COMTRADE file, several information and fields are displayed in a new table row:

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FTNRYCBlD4PuvTDdOk99s%2Fimage.png?alt=media&amp;token=02c6cde0-4f2a-4256-8978-d14da8105194" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="137.63641357421875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>File Name</strong></td><td>COMTRADE file name</td></tr><tr><td><strong>Path</strong></td><td>The absolute path of the COMTRADE file</td></tr><tr><td><strong>Prefix</strong></td><td>This column allows you to give a prefix to the name of signals that is combined. This makes it possible to differentiate between several signals that have the same names when combined.</td></tr><tr><td><strong>Offset</strong></td><td><p>This column allows you to apply time compensation (offset) to the signals in this COMTRADE file.</p><p>The value is in seconds and can be written in decimal form or with the unit. Example: 0.005 or 5ms. A positive value moves the signal backwards and a negative value moves the signal forward in time.</p></td></tr></tbody></table>

## Synchronizing files

Some COMTRADE files may have minimal delays, which negatively affect signal analysis. These delays are in the form of a few seconds or less. To compensate for these delays automatically, a tool has been added to provide the exact value in the offset column of the table. Synchronization is done in a few steps.

You must first select the reference file. This file is selected with a click on its row in the table of added files. When selected, the row is highlighted in blue. This subsequently allows any synchronization to be based on this file and its parameters. The sample rate can also be adjusted, it defaults to the average of added files, but it can be lowered to reduce file size.

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2F9ZcXuFYOfjDLfI3EkAJE%2Fimage.png?alt=media&amp;token=7b6cb856-7f48-406b-80fc-3972c7e0fd66" alt=""><figcaption></figcaption></figure>

The timing menu can be opened by selecting the Calculate delay button. This menu displays a list of signals by files to synchronize. The signals on the left are the signals from the reference file chosen earlier and on the right are the other files in the table that have been added. The tool tries to link signals that have names with similarities, but if nothing is found, the first signal in the list is selected. At any time, the user can change the signals to be used for synchronization.

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2FSPOhNlKhh4EsFAvCVpTu%2Fimage.png?alt=media&amp;token=34178d56-d134-4f77-941c-e3f745bdfcfd" alt="" width="563"><figcaption></figcaption></figure>

The tool determines the delay between the chosen signals and the reference one using algorithms. Any delay found is subsequently added in the offset column to the added files. It is then necessary to combine everything to have the deadlines applied. If the signals are already synchronized in time, the returned value is 0.0.


---

# 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/scopeview/use-tools-and-templates/use-the-comtrade-combiner-tool.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.
