Siemens Sinumerik 840D sl Programming Manual page 98

Job planning
Hide thumbs Also See for Sinumerik 840D sl:
Table of Contents

Advertisement

Flexible NC programming
1.10 Program jumps and branches
GOTOF:
<jump
destination_1>:
<jump
destination_2>:
<jump
destination_n>:
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).
98
Jump instruction with jump destination towards the end of the
program.
Instead ofGOTOF 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)
STRING type
Variable jump destination. The variable
variable:
stands for a jump marker or a block number.
A branch is made to this jump destination if the value of the
variable or arithmetic function corresponds to the second specified
constant.
A branch is made to this jump destination if the value of the
variable does not assume the specified constant value.
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Job planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de slSinumerik 828d

Table of Contents