ST instruction RETURN

You use the RETURN instruction to exit a function block. You can make this dependent on a condition, for example.

Sample:

IF bVar1 = TRUE THEN 
    RETURN; 
END_IF; 
nVar2 := nVar2 + 1;

If the value of bVar1 is TRUE, the function block is exited immediately and TwinCAT does not execute the instruction nVar2 := nVar2 + 1;.

See also: