# LGF_Frequency (FB / 3.0.1)

Overview

Author: Siemens Industry Support

## Short description

This function generates a signal that changes between the values `FALSE` and `TRUE` depending on a defined frequency and a pulse pause ratio.

### Block Interface

| LGF_Frequency (FB) |
--- | --- | ---
Real |  |  | frequency |  | clock |  |  | Bool
Real |  |  | pulsePauseRatio |  | countdown |  |  | Time

### Input parameter

Identifier | Data type | Default value | Description
--- | --- | --- | ---
frequency | Real | 0.0 | Clock frequency in Hz.
pulsePauseRatio | Real | 1.0 | Pulse pause ratio (standard: 1.0 corresponds to 1:1).

### Output parameter

Identifier | Data type | Description
--- | --- | ---
clock | Bool | Output changes with defined frequency.
countdown | Time | Remaining time of the current `clock` state.

## Functional description

The `clock` output is a Boolean value that toggles at the desired frequency. The `pulsePauseRatio` input is used to set the pulse pause ratio.

The output `countdown` outputs the remaining time of the current state of `clock`.

If the desired frequency or pulse pause ratio is less than or equal to `0.0`, the output `clock` = FALSE and `countdown` = `0s`.

### Example

Note
  The `clock` of the FB LGF_Frequency depends on the cycle time of the OB Main. To increase the accuracy, the FB can also be called in a cyclic interrupt OB with a low time interval.

## Change log

Version & Date | Change description
--- | ---
| 1.0.0 | Siemens Industry Online Support
| 19.08.2015 | First released version
| 1.1.0 | Siemens Industry Online Support
| 25.05.2016 | New function: pulse pause ratio
| 1.1.1 | Siemens Industry Online Support
| 26.05.2016 | Add comments
| 1.1.2 | Siemens Industry Online Support
| 02.01.2017 | Upgrade: TIA Portal V14 Update 1
| 1.1.3 | Siemens Industry Online Support
| 17.08.2018 | Upgrade: TIA V15 Update 2
| 1.1.4 | Siemens Industry Online Support
| 23.11.2018 | Upgrade: TIA V15.1
| 1.0.7 | Simatic Systems Support
| 20.09.2019 | Code refactoring, regions and more comments added
| 3.0.0 | Simatic Systems Support
| 23.04.2020 | Set version to V3.0.0, harmonize the version of the whole library
| 3.0.1 | Simatic Systems Support
| 15.02.2021 | Insert documentation