> 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/timer.md).

# Timer

## Description

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

The **Timer** block, located in the **OPAL-RT SPS Software/Control & Measurements** library, generates signal changing at specified transition times.

The Timer block generates a signal changing at specified transition times. Use this block to generate a logical signal (0 or 1 amplitude) and control the opening and closing times of power switches like the Breaker block and the Ideal Switch block. You can also use this block to generate a signal whose amplitude changes by steps at specified transition times.

{% hint style="info" %}
The Pulse & Signal Generators section of the Control and Measurements library contains the [**Stair Generator block**](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/control-and-measurements/pulse-and-signal-generators/stair-generator.md). This is an improved version of the Timer block. The new block features a mechanism that eliminates duplicate continuous and discrete versions of the same block by basing the block configuration on the simulation mode. If your legacy models contain the Timer block, they continue to work. However, for best performance, use the Stair Generator block in your new models.
{% endhint %}

## Parameters

<table data-header-hidden><thead><tr><th width="250.2222900390625"></th><th></th></tr></thead><tbody><tr><td><strong>Time(s)</strong></td><td><p>The transition times, in seconds, when the output of the block changes its value as defined by the <strong>Amplitude</strong> parameter.</p><p>The <strong>Time(s)</strong> parameter must be a vector of the same length as the vector defined in the <strong>Amplitude</strong> parameter.</p><p>The definition of the time 0 is optional. If a signal is not specified at time 0, the output is kept at zero until the first transition time specified in the <strong>Amplitude</strong> vector.</p></td></tr><tr><td><strong>Amplitude</strong></td><td><p>The vector of amplitudes of signal to be generated by the Timer block.</p><p>The amplitude is kept constant between transition times defined in the <strong>Time(s)</strong> vector.</p></td></tr></tbody></table>

## Inputs and Outputs

The output is a signal changing by steps at specified transition times.


---

# 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/timer.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.
