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

Job planning
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Flexible NC programming
1.12 Check structures
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
Meaning
WHILE
ENDWHILE
<condition>
Example
Program code
...
WHILE $AA_IW[DRILL_AXIS] > -10
G1 G91 F250 AX[DRILL_AXIS] = -1
ENDWHILE
...
114
:
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.
Comment
; 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
Comment
; Call the WHILE loop under the following
condition: The actual WCS setpoint for the
drilling axis must be greater than -10.
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Job Planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents