LABELS

Statement - Destination of a Jump instruction.

Remarks

Labels are used as a destination of a jump instruction in FDB, LD 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 FBD language, labels can be inserted anywhere in the diagram, and are connected to nothing. In LD language, a label must identify a rung, and is shown on the left side of the rung. In IL language, labels are destination for JMP, JMPC, JMPCN and JMPNC instructions. They must be written before the instruction at the beginning of the line, and should index the beginning of a valid IL statement: LD (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. In all languages, it is not mandatory that a label be a target of a jump instruction. You can also use label for marking parts of the programs in order to increase its readability.

ST Language

Not available

FBD Language

(* In this example the TON block will not be called if bEnable is TRUE *)
JumpFbd.gif (1708 octets)

LD Language

(* In this example the second rung will be skipped if IN1 is TRUE *)
JumpLd.gif (1971 octets)

IL Language:

Start:   LD   IN1     (* unused label - just for readability *)
         JMPC TheRest (* Jump to "TheRest" if IN1 is TRUE *)

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

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

See also

Jumps   RETURN