Programming
8.8 Program jumps
8-180
SINUMERIK 802D sl Operation and Programming Nibbling (BP-N), 06/2006 Edition
6FC5 398-3CP10-0BA0
N10
...
...
N20 GOTOF LABEL0
...
...
...
...
...
N50 LABEL0: R1 = R2+R3
; Jump to label LABEL1N51
...
...
; Jump to label LABEL0
GOTOF LABEL0
G0 X... Y...
Program
execution
...
LABEL2: X... Y...
N100 M2 ; End of program
LABEL1: X... Y...
; Jump to label LABEL2N150 GOTOB LABEL2
Fig. 8-32 Unconditional jumps using an example
8.8.3 Conditional program jumps
Functionality
Jump conditions are formulated after the IF instruction. If the jump condition (value not
zero) is satisfied, the jump takes place.
The jump destination can be a block with a label or with a block number. This block must
be located within the program.
Conditional jump instructions require a separate block. Several conditional jump instructions
can be located in the same block.
By using conditional program jumps, you can also considerably shorten the program, if ne-
cessary.
Programming
IF condition GOTOF label ; Jump forward
IF condition GOTOB label ; Jump backwards
GOTOF ; Jump direction forward (in the direction of the last block in the program)
GOTOB ; Jump direction backwards (in the direction of the first block in the program)
Label ; String selected for the label (jump label) or block number
IF ; Initiation of the jump condition
condition ; Arithmetic parameters, arithmetic expression for formulating the condition