EasyManua.ls Logo

JUMO LOGOSCREEN 700 - Repeat Instructions; FOR Instruction; WHILE Instruction

JUMO LOGOSCREEN 700
64 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
33
7 Instructions
7.2 Repeat instructions
With repeat instructions (iterations), instructions and groups of instructions are executed repeatedly.
There are three types of repeat instructions:
•FOR
•WHILE
REPEAT UNTIL
FOR instruction
The FOR instruction is used if the number of repeats is fixed.
Keywords:
FOR, TO, BY, DO, END_FOR
Examples:
VAR
i: UINT;
j: UINT;
a: UINT;
b: UINT;
END_VAR
FOR i := 10 TO 100 BY 10 DO
j := j + i;
END_FOR;
(* i runs from 10 to 100 in steps of 10 (10, 20, 30, …, 100) *)
FOR a := 1 TO 5 DO
b := b + a;
END_FOR;
(* if "BY x" is not specified, the control variable is increased by 1 in each cycle
(1, 2, 3, 4, 5) *)
WHILE instruction
The WHILE instruction causes a group of instructions to be repeatedly executed until the associated
Boolean expression is incorrect (FALSE, untrue). If the Boolean expression is incorrect from the begin-
ning, the group of instructions is not executed at all.
Keywords:
WHILE, DO, END_WHILE
Example:
WHILE j < 100 DO
j := j + 2;
END_WHILE;

Other manuals for JUMO LOGOSCREEN 700

Related product manuals