EasyManua.ls Logo

Siemens SINUMERIK 840D - Page 127

Siemens SINUMERIK 840D
713 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
840D/828D SINUMERIK Operate Page 11
B509
B509
Notes
Section 5
Program loops
Contrary to the REPEAT” commandGOTOB/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 <> not equal
< larger than > smaller than
<= larger or equal >= smaller or equal
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: Counter is not = 4, hence carry on to
block N190
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
N30 T1 ; Roughing tool
N40 R20=0 ; Counter = 0
N50 G96 S160 F0.2 M4 D1
N60 G00 X82 Z0 M8
N70 G01 X-1.6
N80 Z3
N90 G00 X80 ; Raw dimension
N100 LBL14:
N110 STOPRE ; Advance evaluation stop
N120 R20=R20+1 ; Counter is increased by 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 ; Jump back to the marker LBL14
N200 LBL16:
N210 G00 X200 Z300

Other manuals for Siemens SINUMERIK 840D

Related product manuals