# LGF_CountBooleanEdges (FB / V1.0.0)

Author: Siemens Simatic Systems Support

## Short description

This function evaluates a input signal for different states in a certain amount of time.

The states are:

- One edge and input present over the whole monitoring time
- Single edge
- Double edge
- N-Edges in between the monitoring time

The Output signal is present for at least on cycle after the monitoring time has expired, or as long as the input `trigger` remains `TRUE`.

### Block Interface

| LGF_CountBooleanEdges (FB) |
--- | --- | ---
Bool |  |  | trigger |  | single |  |  | Bool
Time |  |  | monitorTime |  | double |  |  | Bool
|  |  |  |  | long |  |  | Bool
|  |  |  |  | severalEdges |  |  | Bool
|  |  |  |  | noOfEdges |  |  | USInt

### Input parameter

Identifier | Data type | Default value | Description
--- | --- | --- | ---
trigger | Bool | FALSE | Trigger to evaluate signal signal (rising edges)
monitorTime | Time | T#1s | Time to monitor fand count edges on `trigger` input

### Output parameter

Identifier | Data type | Description
--- | --- | ---
single | Bool | Single edge until monitoring time expires
double | Bool | Two edges in between the monitoring time
long | Bool | Just a single edge in the monitoring time, the `trigger` input stays TRUE after the edge appears
severalEdges | Bool | Numeros Edges occure within the monitoring time, see `noOfEdges` to get the number of edges
noOfEdges | USInt | Number of edges in between the monitoring time frame

## Change log

Version & Date | Change description
--- | ---
| 01.00.00 | Simatic Systems Support
| 19.01.2021 | First released version