# Trig

## `Trig` (FB)

FUNCTION\_BLOCK Trig

### Kurzbeschreibung

> Flankenerkennung an einem binären Eingangssignal.\
> Impulserzeugung bei ansteigenden / abfallenden oder beiden Flanken.

### Darstellung

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

### Schnittstellen

#### Eingänge

| Name  | Datentyp | Wertebereich | Initialwert | Funktion               |
| ----- | -------- | ------------ | ----------- | ---------------------- |
| *xIn* | BOOL     |              |             | Binäres Eingangssignal |

#### Ausgänge

| Name     | Datentyp | Wertebereich | Initialwert | Funktion                                           |
| -------- | -------- | ------------ | ----------- | -------------------------------------------------- |
| *xTrigH* | BOOL     |              |             | Impulsausgang für ansteigende Flanken              |
| *xTrigL* | BOOL     |              |             | Impulsausgang für abfallende Flanken               |
| *xTrig*  | BOOL     |              |             | Impulsausgang für ansteigende / abfallende Flanken |

### Funktionsbeschreibung

#### Allgemeines

Das binäre Eingangssignal *xIn* wird permanent auf ansteigende und abfallende Flanken überwacht.\
Bei jeder ansteigenden Flanke wird am Ausgang *xTrigH* ein Impuls mit einer Zeitdauer von einem Programmzyklus erzeugt.\
Bei jeder abfallenden Flanke wird am Ausgang *xTrigL* ein Impuls mit einer Zeitdauer von einem Programmzyklus erzeugt.\
Bei jeder ansteigenden / abfallenden Flanke wird am Ausgang *xTrig* ein Impuls mit einer Zeitdauer von einem Programmzyklus erzeugt.

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