Siemens SINUMERIK 840D sl Programming Manual page 52

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

Advertisement

Flexible NC programming
1.12 Control structures
Restrictions
Blocks with control structure elements cannot be suppressed. Labels may not be used in
blocks of this type.
Control structures are processed interpretively. When a loop end is detected, a search is
made for the loop beginning, allowing for the control structures found in the process.
For this reason, the block structure of a program is not checked completely in interpreter
mode.
It is not generally advisable to use a mixture of control structures and program branches.
A check can be made to ensure that control structures are nested correctly when cycles are
preprocessed.
Sequence
1. IF-ELSE-ENDIF
An IF-ELSE-ENDIF block is used to select one of two alternatives:
IF (expression)
NC blocks
ELSE
NC blocks
ENDIF
If the value of the expression is TRUE, i.e., the condition is fulfilled, then the next program
block is executed. If the condition is not fulfilled, then the ELSE program branch is executed.
The ELSE branch can be omitted.
2. Endless loop control LOOP
Endless loops are used in endless programs. At the end of the loop, there is always a branch
back to the beginning.
LOOP
NC blocks
ENDLOOP
3. Counter loop FOR
The FOR loop is used if it is necessary to repeat an operation by a fixed number of runs. In
this case, the count variable is incremented from the start value to the end value. The start
value must be lower than the end value. The variable must be of type INT.
FOR Variable = start value TO end value
NC blocks
ENDFOR
1-38
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Job planning

Advertisement

Table of Contents
loading

Table of Contents