LABELS

Statement - Destination of a Jump instruction.

Remarks

Labels are used as a destination of a jump instruction in FDB, FFLD, or IL language.

Labels and jumps cannot be used in structured ST Language.

  • A label must be represented by a unique name, followed by a colon :.
  • In all languages, it is not mandatory that a label is a target of a jump instruction.
    • Use label for marking parts of the programs in order to increase its readability.

FBD Language Example

  • Labels can be inserted anywhere in the diagram.
  • They are connected to nothing.

In this example, the DTAt block is not called if bEnable is TRUE.

FFLD Language Example

  • A label must identify a rung.
  • It is shown on the left side of the rung.

In this example Network #6 is skipped if IN1 is TRUE.

IL Language Example

  • Labels are destination for JMP, JMPC, JMPCN and JMPNC instructions.
  • They must be written before the instruction at the beginning of the line.
  • They must index the beginning of a valid IL statement: FFLD (load) instruction, or unconditional instructions such as CAL, JMP or RET.
  • The label can also be written alone on a line before the indexed instruction.
Start:   FFLD   IN1     (* unused label - just for readability *)
         JMPC TheRest (* Jump to "TheRest" if IN1 is TRUE *)

         FFLD   IN2 (* these two instructions are not executed *)
         ST   Q2      (* if IN1 is TRUE *)

TheRest: FFLD   IN3     (* label used as the jump destination *)
         ST   Q3

ST Language Example

Not available.

See Also