Program Loop With Condition At Start Of Loop (While, Endwhile) - Siemens SINUMERIK 828D Programming Manual

Hide thumbs Also See for SINUMERIK 828D:
Table of Contents

Advertisement

R parameter as count variable:
Program code
R11=6
FOR R10=R12-R20*R1 TO R11
R20=R21*R22+R33
ENDFOR
M30
Example 2: Production of a fixed quantity of parts
Program code
DEF INT WKPCCOUNT
FOR WKPCCOUNT = 0 TO 100
G01 ...
ENDFOR
M30
1.12.4

Program loop with condition at start of loop (WHILE, ENDWHILE)

Function
For a WHILE loop, the condition is at the beginning of the loop. The WHILE loop is executed
as long as the condition is fulfilled.
Syntax
WHILE <condition>
...
ENDWHILE
Significance
WHILE
ENDWHILE
<condition>
Job planning
Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
:
Initiates the program loop.
:
Marks the end of the loop and results in a return jump to the beginning
of the loop.
:
The condition must be fulfilled so that the WHILE loop is executed.
Comments
; Count variable = R parameter (real variable)
Comments
; Defines type INT variable with the name
"WKPCCOUNT".
; Initiates the count loop. The "WKPCCOUNT"
variable increments from the initial value "0"
to the end value "100".
; End of count loop
Flexible NC programming
1.12 Check structures
103

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents