Finn's LabVIEW Goldmine:
a filter function (implemented as a sub-VI)
that implements a time-constant filter based on the Backward method of
to the function:
is the input signal that is to
be filtered (smoothed).
[s] is the filter time-constant.
(The filter bandwidth is 1/(2*pi*Tf) [Hz].)
[s] is the time-step, i.e. the time
between subsequent executions of the the filter. Ts must be set equal
to the cycle time of the While loop, or Timed loop, in which the filter
is used. (If the filter is used in a Simulation loop, Ts must be set
equal to the time-step of the Simulation loop.)
can be used in the
following alternative ways (the first of these can be used in most
- By connecting a First
to the Init/reset
input, the initial filter
output becomes equal to the present (raw) filter input, thereby
avoiding an unfavourable initial bump in the filter output.
connecting a boolean
control to the the Init/reset
input, the present
filter output becomes equal to the present (raw) filter input
the state of the boolean control is locially true.
from the function:
to include the filter in your block-diagram?
the subVI LabVIEW file to any folder (do
not open it directly in LabVIEW).
the subVI to the block-diagram of your VI
via Functions Palette / Select
a VI etc. Then connect its
inputs and its output to the proper signals (wires) in the
block-diagram. (It is not necessary to copy the block-diagram code of
the subVI explicitly into your program.)
[Finn 's LabVIEW Page]
Updated 30 August 2016 by Finn