> 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-functions/advanced-functions/advanced-or-sitopref.md).

# Advanced | SITOPREF

## **RELATIVE OPERATING TIME – \[SITOPREF]**

Compute the operating time of a relay relative to the rise or fall of a reference signal.

## **CATEGORY**

Advanced

![](https://opal-rt.atlassian.net/wiki/download/thumbnails/1517158751/image2018-9-25_8-33-42.png?version=1\&modificationDate=1757702716467\&cacheVersion=1\&api=v2\&width=438\&height=362)

## **DESCRIPTION**

The function allows computing the operating time of a relay relative to the rise or fall of a reference signal.

## **RESULT VARIABLES AND PARAMETERS**

<table data-header-hidden><thead><tr><th width="192.39996337890625"></th><th></th></tr></thead><tbody><tr><td><strong>res</strong></td><td><p>time in milliseconds for which the threshold value is reached on the signal analyzed, as specified by the reference pulse.</p><ul><li><strong>On a rise</strong> (m, c, C), the returned time is relative to the rising time of the reference pulse.</li><li><strong>On a fall</strong> (d, f, F), the returned time is relative to the falling time of the reference pulse.</li></ul></td></tr><tr><td><strong>Signal</strong></td><td>Signal to analyze.</td></tr><tr><td><strong>Reference</strong> <strong>signal</strong></td><td>Reference signal.</td></tr><tr><td><strong>Types (m, d, c, C, f, F)</strong></td><td><p>Type of search for the relay operating time, in other words the time when a threshold value is reached. On a rise (m, c, C), the relay must operate between the rise of the reference pulse and its end. On a fall (d, f, F), the relay must operate only after the fall of the reference pulse.</p><ul><li><strong>For type m</strong>, a change of state is searched for relative to the threshold and the initial state starting time between the start and the end of the reference pulse. If the state is the same at the beginning of the pulse, only a change of state is searched for. If however, the state is different at the beginning of the pulse, the initial state and then a change of state are searched for, both between the start and the end of the reference pulse.</li><li><strong>For type c</strong>, a value smaller than the threshold value is searched for, between the start and the end of the reference pulse. If at the beginning of the pulse, the sample is already below the threshold, the search is for a value above the threshold and then for a value below it, before the end of the reference pulse.</li><li><strong>For type C,</strong> a value greater than the threshold value is searched for, between the start and the end of the reference pulse. If at the beginning of the pulse, the threshold is already overshot, the search is for a value below the threshold and then for a value above it, before the end of the reference pulse.</li><li><strong>For type f</strong>, a value smaller than the threshold value is searched for, between the end of the reference pulse and the ending time. If at the end of the pulse, the sample is already below the threshold, the search is for a value above the threshold and then for a value below it, before the end of the analysis limits.</li><li><strong>For type F</strong>, a value greater than the threshold value is searched for, between the end of the reference pulse and the ending time. If, at the end of the pulse, the threshold is already overshot, the search is for a value below the threshold and then for a value above it, before the end of the analysis limits.</li></ul></td></tr><tr><td><strong>Threshold</strong></td><td>Threshold to reach on the signal analyzed showing that the relay operated. The method used to establish that the value was reached is determined by the type of search (m, d, c, C, f, F)</td></tr><tr><td><strong>Threshold_ref</strong></td><td>Threshold value to reach on the reference signal specifying the start and the end of the reference pulse</td></tr><tr><td><strong>Begin_time</strong></td><td>Time at which the analysis of a signal must start. This time is expressed in milliseconds [ms]. This value must be greater than 0 and lower than the duration of the test. The default value is 0.</td></tr><tr><td><strong>End_time</strong></td><td>Time at which the analysis of a signal must end. This time is expressed in milliseconds [ms]. The value of this time must be larger than the specified begin_time and smaller than the duration of the test. Use the “HUGE” value to specify the end of the test. The default value is HUGE.</td></tr><tr><td><strong>Factor</strong></td><td>Multiplying factor for the results generated by the function. The default value of the multiplying factor is 1.0 and has no effect on the results.</td></tr></tbody></table>

## **SYNTAX**

**res** = sitopref( a, ref, "m", threshold, threshold\_ref, 0, HUGE, 1)

## **CHARACTERISTICS**

Data type support\
Double Floating point

## **EXAMPLE**

The following figure shows the different cases for this function, including the limit cases where the values returned are HUGE, -HUGE or simply 0.

![](https://opal-rt.atlassian.net/wiki/download/attachments/1517158751/image2018-9-25_8-35-57.png?version=1\&modificationDate=1757702716698\&cacheVersion=1\&api=v2)

<br>


---

# 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-functions/advanced-functions/advanced-or-sitopref.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.
