> For the complete documentation index, see [llms.txt](https://support.powerio.com/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.powerio.com/hub/codesys-hvac/en/hvac-alarm-library/funktionsbausteine/timetrig.md).

# TimeTrig

## `TimeTrig` (FB)

FUNCTION\_BLOCK TimeTrig

FB timer (On/Off timer) with separate on/off durations and triggers for state changes. It only runs when xEnable is active and switches between on and off based on the time settings.

Function The program creates a pulse function / blinker with the following characteristics:

> Is activated by xEnable. Start state is set via xStartQ. tOn determines the duration in the “on” state. tOff determines the duration in the “off” state. xQ is the current output state (on/off). xOnTrig and xOffTrig are event flags that are set for one cycle when the state changes. Internal helper variables \_tTime, \_tStart, \_xEnTrig are used for time measurement and edge detection.

InOut:

| Scope  | Name       | Type   | Comment                                                        |
| ------ | ---------- | ------ | -------------------------------------------------------------- |
| Input  | `xEnable`  | `BOOL` | input signal                                                   |
| Input  | `tOn`      | `TIME` | on delay                                                       |
| Input  | `tOff`     | `TIME` | off delay                                                      |
| Input  | `xStartQ`  | `BOOL` | start option TRUE = start with pulse, FALSE = start with pulse |
| Output | `xQ`       | `BOOL` | output pulse                                                   |
| Output | `xOnTrig`  | `BOOL` | rising edge when xQ = TRUE                                     |
| Output | `xOffTrig` | `BOOL` | rising edge when xQ = FALSE                                    |
| Output | `tET`      | `TIME` | elapsed time since the rising edge (switch)                    |


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://support.powerio.com/hub/codesys-hvac/en/hvac-alarm-library/funktionsbausteine/timetrig.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
