en:software:qview:qview_6:qcl_library:vc10lpfilter

This translation is older than the original page and might be outdated. See what has changed.

VC10LPFilter

V = Variables

C = Calculation functions

The VC10LPFilter function implements a first-order low-pass digital filter (RC filter) for WORD dimension data.

VC10LPFilter (Tsample, Tau, FilterIn, FilterOut)

Parameters:

IN/OUTVARIABLE TYPEEXAMPLE NAMEDIM
INSYSTEMswTsampleWSample time filter (msec) [0÷32767].
INSYSTEMswTauWThe filter time constant (ms)
[0÷32767]
INGLOBALgwFilterInWValue of the variable that you want to filter (UM)
[-32768÷32767]
OUTGLOBALgwFilterOutWValue of the filtered variable (UM)
[-32768÷32767]

The VC10LPFilter function implements a digital low-pass filter of the first order whose time constant (Tau) is defined in the parameters passed to the function itself. Assuming you start from a zero input variable value the output of the filter takes a value equal to 63% of the entrance after the long Tau time. Similarly the cutoff frequency of the filter is

Example

;---------------------------------------------
; Project           : REG_012
; Module Name  : ReadTemp
; Author            : 
; Description     : Read temperature & filter
;---------------------------------------------
MAIN:
	CALL ReadTemp
	swTsample = 100		;100 ms sampling time filter
        swTau = 5000		;5 sec filter time constant
	VC10LPFilter (swTsample, swTau, gwFilterIn, gwFilterOut)
 
WAIT 1
JUMP MAIN

Note

  • The function contains a timer that marks the time filter sampling. It's important that the function is placed in the software that runs to each loop task.
  • Last modified: 2019/08/29 17:01