LGF_Frequency (FB / V3.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

IdentifierData type Default value Description
frequencyReal 0.0 Clock frequency in Hz.
pulsePauseRatioReal 1.0 Pulse pause ratio (standard: 1.0 corresponds to 1:1).

Output parameter

IdentifierData type Description
clockBool Output changes with defined frequency.
countdownTime 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

LGF_Frequency


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 & DateChange description
01.00.00Siemens Industry Online Support
19.08.2015First released version
01.01.00Siemens Industry Online Support
25.05.2016New function: pulse pause ratio
01.01.01Siemens Industry Online Support
26.05.2016Add comments
01.01.02Siemens Industry Online Support
02.01.2017Upgrade: TIA Portal V14 Update 1
01.01.03Siemens Industry Online Support
17.08.2018Upgrade: TIA V15 Update 2
01.01.04Siemens Industry Online Support
23.11.2018Upgrade: TIA V15.1
01.00.07Simatic Systems Support
20.09.2019Code refactoring, regions and more comments added
03.00.00Simatic Systems Support
23.04.2020Set version to V3.0.0, harmonize the version of the whole library
03.00.01Simatic Systems Support
15.02.2021Insert documentation