MATH.MeasureFrequence (FB)

(CAA_Mathematics.library)

This function block will measure the average frequency of an input signal over a defined number of periods. The function block being able to return a correct result it has to be called with a frequency higher than the maximum frequency of the input signal.

Input:

xEnable

BOOL

reset (see “CAA 指南”)

xInput

BOOL

input signal

usiPeriods

USINT(1..10)

number of time periods the frequency shall be averaged in ( number

Output:

lrFrequency

LREAL

averaged frequency ( in Hz)

xValid

BOOL

validity of result; will be set to FALSE, if the required number of time periods has not yet been passed or if the distance in time of two  raising edges exceeds 3*lrFrequency