Chapter 9 NC Control Function
6) Repetitive statement (DO, WHILE)
WHILE [<Conditional expression>] DO n
(n = 1, 2, 3, …)
~
END n
WHILE: Conditional repetitive statement
DO n: Repeat until n declaration statement
[……]: Conditional statement
END n: End of the block to be repeated
When the <conditional expression> is met, it repeats from the block following DO n to the END n block. If the
<conditional expression> is not satisfied, it jumps to the block following the END n. WHILE [<conditional
expression>] can be omitted and If omitted, it repeats infinitely from DO n to END n.
WHILE [<conditional expression>] Do n and END n are always used as a pair, and by the identification number
n, the pair is identified. If another loop is selected in the Iteration loop, it is distinguished by the pair of
identification factors.
7) Operation command
There are substitution of variables and integers, the four fundamental arithmetic operations, Mathematical
operation, etc. for available operations. The types of commands are shown in the table below. When using
multiple operations in combination, the priority is given in order of variable, multiplication / division, addition /
subtraction. The brackets "[]" are used to set the priority.