Variable: VAR_OUTPUT
Output variables are used at the outputs of function blocks. You declare VAR_OUTPUT
variables between the VAR_OUTPUT
and END_VAR
keywords in the declaration part of POUs. The values of this variable are returned to the calling POU. There you can retrieve the values and continue using them.
The variable can be specified with an attribute keyword (CONSTANT
, RETAIN
or PERSISTENT
) to be expanded.
Example 82. Example
VAR_OUPUT iOut1 : INT; (*1st output variable *) END_VAR
Output variables in functions and methods
According to the IEC 61131-3 standard, functions and methods have additional outputs. You have to assign these additional outputs when calling the function, as shown below.
Example 83. Example
fun(iIn1 := 1, iIn2 := 2, iOut1 => iLoc1, iOut2 => iLoc2);