# Trig

## `Trig` (FB)

FUNCTION\_BLOCK Trig

### Short description

> Edge detection on a binary input signal.\
> Pulse generation on rising / falling or both edges.

### Representation

<figure><img src="/files/d1b1d8549e3553c26fbb48ae746813270d06a5cd" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name  | Data type | Value range | Initial value | Function            |
| ----- | --------- | ----------- | ------------- | ------------------- |
| *xIn* | BOOL      |             |               | Binary input signal |

#### Outputs

| Name     | Data type | Value range | Initial value | Function                                |
| -------- | --------- | ----------- | ------------- | --------------------------------------- |
| *xTrigH* | BOOL      |             |               | Pulse output for rising edges           |
| *xTrigL* | BOOL      |             |               | Pulse output for falling edges          |
| *xTrig*  | BOOL      |             |               | Pulse output for rising / falling edges |

### Function description

#### General

The binary input signal *xIn* is continuously monitored for rising and falling edges.\
On each rising edge, a pulse with a duration of one program cycle is generated at the output *xTrigH* On each falling edge, a pulse with a duration of one program cycle is generated at the output.\
On each falling edge, a pulse with a duration of one program cycle is generated at the output. *xTrigL* On each rising / falling edge, a pulse with a duration of one program cycle is generated at the output.\
On each rising / falling edge, a pulse with a duration of one program cycle is generated at the output, *xTrig* a pulse with a duration of one program cycle is generated.

### CODESYS

InOut:

| Scope  | Name     | Type   |
| ------ | -------- | ------ |
| Input  | `xIn`    | `BOOL` |
| Output | `xTrigH` | `BOOL` |
| Output | `xTrigL` | `BOOL` |
| Output | `xTrig`  | `BOOL` |


---

# Agent Instructions: 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:

```
GET https://support.powerio.com/hub/codesys-hvac/en/hvac-library/functionblocks/binary/trig.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
