FB_PMA_Source_3Ph
The function block FB_PMA_Source_3Ph 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 requirements for the size of the output buffers may vary depending on the analysis function block used. They depends either on the FFT-length used or the buffer size.
Syntax
Definition:
FUNCTION BLOCK FB_PMA_Source_3Ph
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
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. See Parallel Processing in Transfer Tray). |
stInitPars |
Function block-specific structure with initialization parameters. The parameters must match the definition of the input and output buffers. |
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. |
Methods
Name | Description |
---|---|
The method is called in each cycle to write the values to the output buffer. | |
This method can be used to reset the data currently in the buffer. | |
Calling this method causes an automatic reset of all algorithms in the full analysis chain. | |
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 |