ST_PMA_Frequency_Period_InitPars
Function block-specific structure with initialization parameters that are evaluated when the function blocks FB_PMA_Frequency_Period_1Ph and FB_PMA_Frequency_Period_3Ph are initialized.
Syntax
Definition:
TYPE ST_PMA_Frequency_Period_InitPars :
STRUCT
nBufferLength : UDINT := 200; // Length of input buffer
fSampleRate : LREAL := 1_000; // in Hz
fMinFreq : LREAL := 45; // Min measured Freq
fMaxFreq : LREAL := 65; // Max measured Freq
nPeriods : UDINT := 2; // Number of periods to be considered
nFilterOrder : UINT := 3; // Filter order of butterworth lowpass filter
fCutoff : LREAL := 70.0; // Cutoff frequency of filter
eInputSelect : E_PMA_InputSelect := E_PMA_InputSelect.Voltage; // Select input: Voltage | Current
fMinInput : LREAL := 200.0; // Minimal input (RMS) over one period to calculate outputs
nRocofAvgWindow : UDINT := 25; // Window length of elements to calculate moving average of ROCOF
END_STRUCT
END_TYPE
Parameters
Name | Type | Parameters |
---|---|---|
nBufferLength | UDINT | Length of the input buffer |
fSampleRate | LREAL | Indicates the sampling rate (samples per second) of the input signal. |
fMinFreq | LREAL | Minimum expected measuring frequency |
fMaxFreq | LREAL | Maximum expected measuring frequency |
nPeriods | UDINT | Number of periods that influence the calculation. (Period length = sample rate/frequency) |
nFilterOrder | UINT | Indicates the order of the low-pass filter. The stability of the filter must be considered for the setting. Only values up to the tenth order are allowed. |
fCutoff | LREAL | Specifies the cut-off frequency of the low-pass filter. |
eInputSelect | Voltage: The voltage is used as the basis for the frequency calculation Current: The current is used as the basis for the frequency calculation | |
fMinInput | LREAL | Minimum input value (RMS) over one period. This prevents the calculation of input values that are too small. |
nRocofAvgWindow | UDINT | Window size of the sliding average value for the calculation of the ROCOF Resulting period: nPeriods * nRocofAvgWindow / avgeragedFreq) |
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.4024.0 | PC or CX (x86, x64) | Tc3_PowerMonitoring |