PulseFreq('Expression','Omega=0*','EdgeType=2*' )
Arguments
|
'Expression' |
Pulse counter signal |
|
|
'Omega*' |
Filter frequency |
|
|
'EdgeType*' |
Edge type to be counted |
|
|
'EdgeType' = -1 |
Falling edges only |
|
|
'EdgeType' = 0 |
Rising and falling edges |
|
|
'EdgeType' = 1 |
Rising edges only |
|
|
'EdgeType' = 2 |
'Expression' is a pulse counter |
|
Parameters ending with * are only evaluated once at the start of the acquisition.
Description
This function computes the frequency of 'Expression' pulse counters or pulses. The unit of the result is pulses/sec or Hz.
A low-pass filter with an 'Omega' limit angular speed is applied to the result. If 'Omega' is 0 then the low-pass filter is deactivated. 'EdgeType' determines which edges of pulses should be counted.
Zero is returned as the calculated frequency if no pulse occurs in 1000 samples.
This function was especially created for using the WAGO incremental encoder 750-631. You may use the function to calculate the speed based on the pulse counter signal from the encoder. The pulse counter value is differentiated taking into consideration possible counter overflows. As the result of the differentiation may include interfering frequencies or noise, a low-pass filter can then be used. The filter frequency to be set should be slightly above the maximum pulse frequency.