FUNCTION_BLOCK FREQ_MEASURE
Measures the frequency of a signal
InOut:
Scope |
Name |
Type |
Initial |
Comment |
Input |
IN |
BOOL |
Input signal |
|
PERIODS |
INT (1..10) |
1 |
A period is the time between two rising edges of the input signal. OUT will equal the average frequency during the given PERIODS (number of periods; minimal 1 maximal 10) |
|
RESET |
BOOL |
Reset measurement |
||
Output |
OUT |
REAL |
Frequency [Hz] |
|
VALID |
BOOL |
FALSE: As long as the first measure has been finished. Or time distance between two rising edges > 3 * OUT. (Indicates that something is wrong with the inputs) |