> 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/smart-power-simulation-software-sps/blocks-functions-tools/control-and-measurements/pulse-and-signal-generators/triangle-generator.md).

# Triangle Generator

## Description

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-edfcf0e0965bee9090c173edf613adb04104baf5%2Ftraingle_generator_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **Triangle Generator** block, located in the **OPAL-RT SPS Software/Sources / Signal Generator Sources** library, generates a symmetrical triangle waveform, with peak amplitude of +/−1.

The figure shows how the **Frequency** and **Phase** block parameters affect the output waveform.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-a565a190661144bd8d2355591b13ca747fecf84b%2Ftriangle_generator_waveform.png?alt=media" alt="" width="300"><figcaption></figcaption></figure>

## Characteristics

<table data-header-hidden><thead><tr><th width="250.111083984375"></th><th></th></tr></thead><tbody><tr><td>Sample Time</td><td>Specified in the <strong>Sample Time</strong> parameter Continuous if <strong>Sample Time</strong> = 0</td></tr><tr><td>Scalar Expansion</td><td>No</td></tr><tr><td>Dimensionalized</td><td>No</td></tr><tr><td>Zero-Crossing Detection</td><td>No</td></tr></tbody></table>

## Parameters

<table data-header-hidden><thead><tr><th width="250"></th><th></th></tr></thead><tbody><tr><td><strong>Frequency (Hz)</strong> — Frequency of triangle waveform<br>1e3 (default) | scalar</td><td>Frequency of the triangle waveform, in hertz.</td></tr><tr><td><strong>Phase (degrees)</strong> — Delay of triangle waveform<br>90 (default) | scalar</td><td><p>Delay of the triangle waveform, in degrees.</p><p>When the phase is set to 0, the waveform starts with an amplitude of -1 and a positive slope.</p></td></tr><tr><td><strong>Sample time</strong> — Block sample time<br>0 (default) | nonnegative scalar</td><td><p>Sample time of the block, in seconds.</p><p>Set to 0 to implement a continuous block.</p></td></tr></tbody></table>

## Examples

The power\_SignalGenerators example shows various uses of the Triangle Generator block.


---

# 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/smart-power-simulation-software-sps/blocks-functions-tools/control-and-measurements/pulse-and-signal-generators/triangle-generator.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.
