> 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/simulink-blocks-reference/rt-events-library/rte-period-meter.md).

# RTE Period Meter

## Description

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

The **RTE Period Meter** block, located in the **RT-EVENTS /Signal Attributes** library, measures the period and frequency of a Boolean input signal. It can also compute the duty cycle and the durations of the high (Ton) and low (Toff) states.

Period and frequency can be measured between consecutive rising edges or consecutive falling edges.

Ton, Toff, and duty cycle can be computed over one calculation step or over one complete signal period. In calculation step mode, Ton and Toff range from 0 to the step size, and the duty cycle is Ton divided by the step size. In signal period mode, Ton and Toff range from 0 to the signal period, and the duty cycle is Ton divided by the period.

Use the minimum frequency parameter for very low-frequency inputs. If no edges are detected for a duration longer than the inactive period condition, the period output is set to infinity and the frequency output to zero.

When the input frequency is lower than the minimum frequency, the duty cycle switches instantly between 0 and 1 depending on the input logic level (Low or High). The **RTE Frequency Meter** block uses a different algorithm for the duty cycle under this condition.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-a7a6947344ef292db31a521083f5ed69bf285690%2FRTE_periodmeter_mask.png?alt=media" alt="" width="318"><figcaption></figcaption></figure>

<table><thead><tr><th width="259.5999755859375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Period</strong></td><td>Outputs the period of the input signal.</td></tr><tr><td><strong>Display Frequency</strong></td><td>Outputs the frequency of the input signal.</td></tr><tr><td><strong>Measurement between consecutive</strong></td><td>Selects rising-edge or falling-edge measurements for period and frequency.</td></tr><tr><td><strong>Display Ton</strong></td><td>Outputs the duration of the high state.</td></tr><tr><td><strong>Display Toff</strong></td><td>Outputs the duration of the low state.</td></tr><tr><td><strong>Display Duty Cycle</strong></td><td>Outputs the duty cycle.</td></tr><tr><td><strong>Measurement during one</strong></td><td>Selects whether Ton, Toff, and duty cycle are calculated over one calculation step or one complete signal period.</td></tr><tr><td><strong>Minimum frequency</strong></td><td>When the input signal frequency is lower than this value, the frequency and period outputs are 0 and Inf.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="259.60003662109375">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Input (RTE Boolean)</strong></td><td>RTE Boolean signal to measure.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="260.4000244140625">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Period (Double)</strong></td><td>Signal period in seconds.</td></tr><tr><td><strong>Frequency (Double)</strong></td><td>Signal frequency in Hz.</td></tr><tr><td><strong>Ton (Double)</strong></td><td>Duration of the high state in seconds.</td></tr><tr><td><strong>Toff (Double)</strong></td><td>Duration of the low state in seconds.</td></tr><tr><td><strong>Duty Cycle (Double)</strong></td><td>Duty cycle in the range [0..1].</td></tr></tbody></table>

## Characteristics and limitations

| Characteristic     | Value                         |
| ------------------ | ----------------------------- |
| Direct Feedthrough | Yes                           |
| Sample time        | Inherited and fixed discrete. |
| Work Offline       | Yes                           |
| Dimensionalized    | Yes                           |


---

# 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/simulink-blocks-reference/rt-events-library/rte-period-meter.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.
