Download Print this page

Siemens Sinumerik 840D Operating Turning page 127

Hide thumbs Also See for Sinumerik 840D:

Advertisement

Program loops
Contrary to the "REPEAT" command "GOTOB/GOTOF" provides the pro-
grammer with greater flexibility.
GOTOB/GOTOF can be used along with conditional statements.
If a condition is satisfied, a certain sections of the program will be re-
peated.
In this case the number of loop executions is counted and evaluated with
the instruction "IF".
The following comparison operators can be evaluated with "IF":
==
equal
<
larger than
<=
larger or equal
N30 T1
N40 R20=0
N50 G96 S160 F0.2 M4 D1
N60 G00 X82 Z0 M8
N70 G01 X-1.6
N80 Z3
N90 G00 X80
N100 LBL14:
N110 STOPRE
N120 R20=R20+1
N130 G00 G42 X=IC(-4) Z1
N140 G01 Z-20
N150 X=IC(6)
N160 G00 G40 Z4
N170 G01 X=IC(-6)
N180 IF R20==4 GOTOF LBL16 ; Comparison of the counters
N190 GOTOB LBL14
N200 LBL16:
N210 G00 X200 Z300
Example:
Explanation of the situation directly after the program start:
N40 Counter for number of repeats set to 0
N100 First run without jump instruction
N120 Counter increases to 1
N130 to N170 technological motion sequence
N180 Comparison operation:
N190 Jump back to block N100, the second run starts
Situation in the fourth run:
N120 Counter receives the value 4
N180 The counter comparison is positive, hence jump to marker LBL16:
N200 Marker LBL16:
N210 Regular continuation of program
840D/828D SINUMERIK Operate
<>
not equal
>
smaller than
>=
smaller or equal
; Roughing tool
; Counter = 0
; Raw dimension
; Advance evaluation stop
; Counter is increased by 1
; Jump back to the marker LBL14
Counter is not = 4, hence carry on to
block N190
Page 11
Section 5
Notes
B509
B509

Advertisement

loading

This manual is also suitable for:

Sinumerik 828d