Introduction

Control elements are used for executing jumps within an FBD section and for returning from a subroutine (SRx) or derived function block (DFB) to the main program.

Control Elements

The following control elements are available.

Designation

Representation

Description

Jump

When the status of the left link is 1, a jump is made to a label (in the current section).

To generate a conditional jump, a jump object is linked to a Boolean FFB output.

To generate an unconditional jump, the jump object is assigned the value 1 for example, using the AND function.

Label

LABEL:

Labels (jump targets) are indicated as text with a colon at the end.

This text is limited to 32 characters and must be unique within the entire section. The text must conform to general naming conventions.

Jump labels can only be placed between the first two grid points on the left edge of the section.

Note: Jump labels may not "cut through" networks, i.e. an assumed line from the jump label to the right edge of the section may not be crossed by any object. This is also valid for links.

Return

RETURN objects can not be used in the main program.

  • In a DFB, a RETURN object forces the return to the program which called the DFB.

    • The rest of the DFB section containing the RETURN object is not executed.

    • The next sections of the DFB are not executed.

    The program which called the DFB will be executed after return from the DFB.

    If the DFB is called by another DFB, the calling DFB will be executed after return.

  • In a SR, a RETURN object forces the return to the program which called the SR.

    • The rest of the SR containing the RETURN object is not executed.

    The program which called the SR will be executed after return from the SR.