Output variables are used at the outputs of function blocks.
VAR_OUTPUT
variables are declared between the keywords VAR_OUTPUT
and END_VAR
in the declaration part of programming objects. CODESYS returns the values of this variable to the calling POU. There you can retrieve the
values and continue using them.
You can extend output variables with an attribute keyword.
Example
VAR_OUPUT iOut1 : INT; (*1st output variable *) END_VAR
See also
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
fun(iIn1 := 1, iIn2 := 2, iOut1 => iLoc1, iOut2 => iLoc2);