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

Nc programming
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Examples
Example 1: INTEGER variable or R parameter as count variable
INTEGER variable as count variable:
Program code
DEF INT iVARIABLE1
R10=R12-R20*R1 R11=6
FOR iVARIABLE1 = R10 TO R11
R20=R21*R22+R33
ENDFOR
M30
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
3.1.7.4

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

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
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
Comment
; Count variable = INTEGER variable
Comment
; Count variable = R parameter (real variable)
Comment
; Defines type INT variable with the name
"WKPCCOUNT".
; Initiates the count loop. The "WKPCCOUNT" vari-
able increments from the initial value "0" to the
end value "100".
; End of count loop
Work preparation
3.1 Flexible NC programming
479

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents