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- nFFT_Lengthis the length of the FFT. It must be greater than one and an integral power of two.
- nWindowLengthis the length of the analysis window in samples. The length must be greater than one and an even number.
- fSampleRateSampling rate of the incoming time signal. The value is used for the scaling of the result in Hz.
- nChannelsdefines the number of independent channels. This must be greater than zero.
- nOrderis the maximum order of the integration. This must be an integer between zero and two. The number of the values determined per channel is (nOrder+1).
- nMaxBandsspecifies the maximum number of frequency bands for which the RMS value is calculated.
- nMaxClassesis the maximum number of classes that are configured. This must be at least one.
- bMemorizeis a Boolean variable. If it is- FALSE, the function block recalculates the number of the highest category and the corresponding channel for each step. If the value is- TRUE, the result values are stored when a limit value is exceeded until the ResetData() method is executed or a channel reaches a higher category. The default value is- TRUE.
- eWindowTypedefines the used window function (of the type E_CM_WindowType). A good default value is the window type- eCM_HannWindow.
- aWindowParameterscontains the free parameters of selected window functions. When using- eCM_KaiserWindow, the first entry defines the parameter beta; if- eCM_FlatTopWindowis used, all parameters are used. See section Window functions.
- nOverlapdefines the number of overlapping samples. This must be greater than or equal to zero. If the value- cCM_OverlapRecommendedis selected, a recommended overlap is calculated internally (see F_CM_CalculateRecommendedOverlap); the value- cCM_OverlapInactivedeactivates the internally used buffer and sets the value to zero.
- bTransformToDecibelis a Boolean value that indicates whether the result of the FFT is to be transformed to the decibel scale, according to transformation x → 20 * log10(x).
- fDecibelThresholdis a very small floating point value greater than zero. Values that are less than this number are replaced with this value before any transformation to the decibel scale. (The purpose is the avoidance of value range errors. The logarithm of zero is not defined and strives infinitely towards minus for the limit value of small arguments. The same applies to the argument of the number zero, arg(0). The smallest possible value is 2.3e-308, which is equivalent to the constant- cCM_MinArgLog10.)
|  | Note the window length The value of  | 
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 |