MeasureFrequence (FB)ΒΆ
FUNCTION_BLOCK MeasureFrequence
This function block will measure the average frequency of an input signal over a defined number of periods.
Note
The function block has to be called with a frequency higher than the maximum frequency of the input signal to be able to calculate the correct result.
- InOut:
Scope
Name
Type
Initial
Comment
Input
xEnableBOOLReset
xInputBOOLInput signal
usiPeriodsUSINT (1..10)
1
Number of time periods the frequency shall be averaged in ( \(1 \leq \mbox{number} \leq 10\) )
Output
lrFrequencyLREALAvareged frequency (in Hz)
xValidBOOLValidity of resultFALSE: If the required number of time periods has not yet been passed or if the distance in time of two raising edges exceeds \(3 \cdot \mbox{lrFrequency}\)