While (program repeat), 27 pr ogr am br anc h es, pr ogr a m repeats – HEIDENHAIN MANUALplus 4110 User Manual
Page 402

402
6 DIN Programming
6.27 Pr
ogr
am Br
anc
h
es, Pr
ogr
a
m Repeats
WHILE (program repeat)
Press "Program variable function."
Select "Program repeat."
Enter the "variable condition" (see figure to the top
right).
A "program repeat" consists of the elements:
"WHILE"—followed by a condition (comparison).
"ENDWHILE"—concludes the conditional program
branch.
The NC blocks that are programmed between WHILE
and ENDWHILE are executed repeatedly for as long
as the "condition" is fulfilled. If the condition is not
fulfilled, MANUALplus continues execution of the
program with the block programmed after
"ENDWHILE."
The "condition" includes a variable or mathematical
expression on either side of the relational operator
(see figure to the top right).
After entering the "program repeat," program the NC
blocks to be executed.
Relational operators
<
Less than
<=
Less or equal
<>
Not equal
>
Greater than
>=
Greater or equal
==
Equal
AND
Logical AND operation
OR
Logical OR operation
If the condition you program in the WHILE
command is always true, the program
remains in an "endless loop." This is one of
the most frequent causes of error when
working with program repeats.