Skip to main content

Attribute: dataflow

With this pragma you control the data flow in the processing of function blocks in the FBD/LD/IL editor. The attribute defines the input or output of a function block to which the continuing connection to the next or previous function block is connected.

You may provide only one input and one output can be decorated with the attribute in the declaration of a function block.

For function blocks without the 'dataflow' attribute, the data flow is determined automatically: First, the connection between an output and an input of the same data type is made. The highest input or output variable of the function blocks is always taken. If there are no variables with a matching data type, then the top output is connected to the top input of the next POU.

Syntax:

{attribute 'dataflow'}

Insert location

Line above the line with the declaration of the corresponding variables

'dataflow'

Identifies the input or output of the function block which is connected to the previous or next POU

Example 262.

The FB and the previous function block are connected using the input variable i1. The connection between FB and the following function block is established via the output variable outRes1.

FUNCTION_BLOCK FB
VAR_INPUT
 r1 : REAL;
 {attribute 'dataflow'}
 i1 : INT;
 i2 : INT;
 r2 : REAL;
END_VAR

VAR_OUTPUT
 {attribute 'dataflow'}
 outRes1 : REAL;
 out1 : INT;
 g1 : INT;
 g2 : REAL;
END_VAR