Use the RETURN statement in order to exit from a function block. You can make this dependent on
a condition, for example.
Example
IF xIsDone = TRUE THEN RETURN; END_IF; iCounter := iCounter + 1;
If the value of xIsDone is equal to TRUE, then the function block is exited immediately and the statement iCounter := iCounter + 1; is not executed.
See also