Flexible NC programming
1.10 Program jumps and branches
Job planning
90 Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
GOTOF
: Jump instruction with jump destination towards the end of the
program.
Instead of
GOTOF all other GOTO commands can be programmed
(refer to the subject "Program jumps to jump markers").
A branch is made to this jump destination if the value of the
variable or arithmetic function corresponds to the first specific
constant.
The jump destination can be specified as follows:
<jump marker>: Jump destination is the jump marker (label)
set in the program with a user-defined name:
<
jump marker>:
<block number>: Jump destination is main block or sub-block
number (e.g.:
200, N300)
<jump destination_1>:
STRING type
variable:
Variable jump destination. The variable
stands for a jump marker or a block number.
<jump destination_2>: A branch is made to this jump destination if the value of the
variable or arithmetic function corresponds to the second specified
constant.
<jump destination_n>: A branch is made to this jump destination if the value of the
variable does not assume the specified constant value.
Example
Program code
...
N20 DEF INT VAR1 VAR2 VAR3
N30 CASE(VAR1+VAR2-VAR3) OF 7 GOTOF Label_1 9 GOTOF Label_2 DEFAULT GOTOF Label_3
N40 Label_1: G0 X1 Y1
N50 Label_2: G0 X2 Y2
N60 Label_3: G0 X3 Y3
...
The CASE instruction from N30 defines the following program branch possibilities:
1. If the value of the arithmetic function VAR1+VAR2-VAR3 = 7, then jump to the block with
the jump marker definition "Label_1" (→
N40).
2. If the value of the arithmetic function VAR1+VAR2-VAR3 = 9, then jump to the block with
the jump marker definition "Label_2" (→
N50).
3. If the value of the arithmetic function VAR1+VAR2-VAR3 is neither 7 nor 9, then jump to
the block with the jump marker definition "Label_3" (→
N60).