FB_PMA_TaskTransfer_Receive
The function block FB_PMA_TaskTransfer_Receive can be used to transfer data from a slow task back to a fast task. This may be necessary if computationally intensive algorithms were swapped out to a slow task and the results are required in another task.
The input buffer is provided via the function block FB_PMA_TaskTransfer_Send. The buffer to be initialized must be sufficient to cover the data to be transmitted.
Syntax
Definition:
FUNCTION BLOCK FB_PMA_TaskTransfer_Receive
VAR_INPUT
nOwnID : UDINT
tTransferTimeout : LTIME := LTIME#500US
stInitPars : ST_PMA_TaskTransfer_InitPars;
END_VAR
VAR_OUTPUT
bError : BOOL;
ipResultMessage : I_TcMessage;
bNewResult : 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 read the values from the input buffer when new data is present. | |
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 |