FB_PMA_Source_1Ph

The function block FB_PMA_Source_1Ph writes data from an external PLC data buffer into a multi-array buffer.

It accumulates input data continuously, until the maximum size of the multi-array is reached. When the multi-array is completely filled, it is passed to a function block with the target analysis ID.

The output buffers are provided for the function blocks whose ID is entered in the array of target IDs. They contain the current and voltage values. The required size of the output buffer may vary depending on the analysis block used. It depends either on the FFT length used or the buffer size.

Syntax

Definition:

FUNCTION BLOCK FB_PMA_Source_1Ph
VAR_INPUT
    nOwnID            : UDINT;
    aDestIDs          : ARRAY[1..GVL_PMA.cMA_MaxDest] OF UDINT;
    nResultBuffers    : UDINT := 4;
    tTransferTimeout  : LTIME := LTIME#40US;
    stInitPars        : ST_PMA_Source_InitPars;
END_VAR
VAR_OUTPUT
    bError            : BOOL;
    ipResultMessage   : I_TcMessage;
    bNewResults       : BOOL;
    nCntResults       : ULINT;
END_VAR

FB_PMA_Source_1Ph 1: Inputs

The input parameters of this function block represent initialization parameters and have to be assigned during the declaration of the function block instance (alternatively: Init method). They may only be assigned once. A change at runtime is not possible.

Name

Type

Description

nOwnID

UDINT

Identifies the function block instance with a unique ID. This must always be greater than zero. A proven approach is to define an enumeration for this purpose.

aDestIDs

ARRAY[1..GVL_PMA.cMA_MaxDest] OF UDINT

Identifies the function block instance with a unique ID. This must always be greater than zero. A proven approach is to define an enumeration for this purpose.

nResultBuffers

UDINT 

Number of multi-array buffers that are initialized for the results.

tTransferTimeout

LTIME 

Setting of the synchronous timeout for internal multi-array forwardings.

stInitPars

ST_PMA_Source_InitPars

Function block-specific structure with initialization parameters. The parameters must match the definition of the input and output buffers.

FB_PMA_Source_1Ph 2: Outputs

Name

Type

Description

bError

BOOL

TRUE if an error occurs.

ipResultMessage

I_TcMessage

The interface offers detailed information about the return value.

bNewResult

BOOL

TRUE once new results have been provided.

nCntResults

ULINT

Count value is incremented with new output data.

FB_PMA_Source_1Ph 3: Methods

Name

Description

Call

The method is called in each cycle to write the values to the output buffer.

ResetData

This method can be used to reset the data currently in the buffer.

ResetAnalysisChain

Calling this method causes an automatic reset of all algorithms in the full analysis chain.

Init

Alternative to the function block initialization

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4024.0

PC or CX (x86, x64)

Tc3_PowerMonitoring