Output Variables - VAR_OUTPUT¶
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 section of programming objects. CODESYS returns these variable values back to the calling function block, where the values can be interrogated and used again.
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);