RETURN   RET   RETC   RETNC   RETCN

Statement - Jump to the end of the program.

Remarks

The "RETURN" statement jumps to the end of the program. In FBDClosed"Function block diagram" A function block diagram describes a function between input variables and output variables. A function is described as a set of elementary blocks language, the return statement is represented by the "<RETURN>" symbol. The input of the symbol must be connected to a valid Boolean signal. The jump is performed only if the input is TRUE. In FFLD language, the "<RETURN>" symbol is used as a coil at the end of a rung. The jump is performed only if the rung state is TRUE. In ILClosed"Instruction list" This is a low-level language and resembles assembly language, RET, RETC, RETCN and RETNC instructions are used.

When used within an action block of an SFCClosed"Sequential function chart" It can be used to program processes that can be split into steps. The main components of SFC are: - Steps with associated actions - Transitions with associated logic conditions - Directed links between steps and transitions step, the RETURN statement jumps to the end of the action block.

ST Language

IF NOT bEnable THEN
   RETURN;
END_IF;
(* the rest of the program will not be executed if bEnable is FALSE *)

FBD Language

(* In this example the DTat block will not be called if bIgnore is TRUE *)
Ret FBD

FFLD Language

(* In this example all the networks above 5 are skipped if ENABLE is FALSE *)
Ret FFLD

IL Language

Below is the meaning of possible instructions:
RET    Jump to the end always
RETC   Jump to the end if the current result is TRUE
RETNC  Jump to the end if the current result is FALSE
RETCN  Same as RETNC

Start: FFLD   IN1
       RETC        (* Jump to the end if IN1 is TRUE *)

       FFLD   IN2   (* these instructions are not executed *)
       ST    Q2    (* if IN1 is TRUE *)
       RET        (* Jump to the end unconditionally *)

       FFLD   IN3   (* these instructions are never executed *)
       ST   Q3

See also

Labels   Jumps