ST_CM_VibrationAssessment_InitPars

Function block-specific structure with initialization parameters, which are analyzed when the function block is initialized.

TYPE ST_CM_VibrationAssessment_InitPars EXTENDS ST_CM_Object_InitPars :
STRUCT
    nFFT_Length           : UDINT := 512;                              (* Length of FFT. *) 
    nWindowLength         : UDINT := 400;                              (* Length of analysis window. *)
    fSampleRate           : LREAL := 20000;                            (* Sample rate in Hertz. *)
    nChannels             : UDINT := 2;                                (* Number of channels. *)
    nOrder                : UDINT := 2;                                (* Maximum order of integration: 0 = acceleration, 1 = velocity, 2 = place. *)
    nMaxBands             : UDINT := 1;                                (* Maximum number of frequency bands. *)
    nMaxClasses           : UDINT := 3;                                (* Number of configurable threshold classes. *)
    bMemorize             : BOOL :=TRUE;                               (* Flag if results are memorized. *)
    eWindowType           : E_CM_WindowType := eCM_HannWindow;         (* Window type. *)
    aWindowParameters     : T_CM_WindowParameters := [2.5,1,1,1,1];    (* Window parameters for specific windows, e.g. FlatTop. *)
    nOverlap              : UDINT := -1;                               (* Size of overlap in samples. *)
    bTransformToDecibel   : BOOL := TRUE;                              (* Transform to decibel. *)
    fDecibelThreshold     : LREAL := cCM_MinArgLog10;                  (* Minimum argument of decadic logarithm for 64- bit IEEE 754 arithmetic. *)
END_STRUCT
END_TYPE
ST_CM_VibrationAssessment_InitPars 1:

Note the window length

The value of nWindowLength must be less or equal the value of nFFT_Length. The length of the FFT can orient itself to the required frequency resolution. Typically a value of about 4/5 of the FFT-length is often used as the window length.

If nFFT_Length is greater than nWindowLength, the frequency resolution of the FFT (and therefore also the length of the return values vector) is increased. The length difference is filled with zeros before the Fourier transform. This can be useful for achieving a higher frequency resolution, or for avoiding circular aliasing in calculations with inverse transformation in the time domain. Despite the higher frequency resolution, however, the result contains no more information.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4022.25

PC or CX (x86, x64)

Tc3_CM_Base