According to the IEC 61131-3 standard, functions can have additional outputs. You declare the additional outputs
in the function between the keywords VAR_OUTPUT
and END_VAR
. The function is called according to the following syntax:
<function> (<function output variable1> => <output variable 1>, <function output variable n> => <output variable n>)
Example
The fun
function is defined with two input variables in1
and in2
. The output variable of the fun
function is written to the locally declared output variables loc1
and loc2
.
fun(in1 := 1, in2 := 2, out1 => loc1, out2 => loc2);