Call

The method is called in each cycle to execute the calculations from the input buffer when new data is present.

The function block waits for input data if the method outputs neither new results nor an error. This is a regular behavior in the process of the analysis chain.

The CallEx method may be suitable as an alternative. It calculates the quantiles only after a defined number of spectrum calculation results, in order to minimize CPU usage.

Syntax

METHOD Call : BOOL
VAR_INPUT
    pMagnitudeSpectrum_UL1 : POINTER TO LREAL;
    pMagnitudeSpectrum_UL2 : POINTER TO LREAL;
    pMagnitudeSpectrum_UL3 : POINTER TO LREAL;
    pMagnitudeSpectrum_IL1 : POINTER TO LREAL;
    pMagnitudeSpectrum_IL2 : POINTER TO LREAL;
    pMagnitudeSpectrum_IL3 : POINTER TO LREAL;
    nMagnitudeSpectrumSize : UDINT
    pSpectrumQuantiles_UL1 : POINTER TO LREAL;
    pSpectrumQuantiles_UL2 : POINTER TO LREAL;
    pSpectrumQuantiles_UL3 : POINTER TO LREAL;
    pSpectrumQuantiles_IL1 : POINTER TO LREAL;
    pSpectrumQuantiles_IL2 : POINTER TO LREAL;
    pSpectrumQuantiles_IL3 : POINTER TO LREAL;
    nSpectrumQuantilesSize : UDINT;
END_VAR

Call 1: Inputs

Name

Type

Description

pMagnitudeSpectrum_UL1 .. UL3

POINTER TO LREAL

Pointer to an array of type LREAL with the dimension: FFT length/2+1. If the spectrum is not to be output, the input can be set to 0.

pMagnitudeSpectrum_IL1 .. IL3

POINTER TO LREAL

Pointer to an array of type LREAL with the dimension: FFT length/2+1. If the spectrum is not to be output, the input can be set to 0.

nMagnitudeSpectrumSize

UDINT

Indicates the size of the output array of a spectrum.

pSpectrumQuantiles_UL1 .. UL3

POINTER TO LREAL

Pointer to an array of type LREAL with the dimension: FFT length/2+1 x quantile. If these values are not to be output, the input can be set to 0.

pSpectrumQuantiles_IL1 .. IL3

POINTER TO LREAL

Pointer to an array of type LREAL with the dimension: FFT length/2+1 x quantile. If these values are not to be output, the input can be set to 0.

nSpectrumQuantilesSize

UDINT

Indicates the size of the output array for a quantile calculation.

Call 2: Return value

Name

Type

Description

Call

BOOL

Indicates whether the method was executed successfully. Further information is provided in the Event interface of the function block.