Conditional Statement And Branch (If, Else, Endif) - Siemens SINUMERIK 840D sl Programming Manual

Nc programming
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Work preparation
3.1 Flexible NC programming
Supplementary conditions
● Blocks with check structure elements cannot be suppressed.
● Jumper markers (labels) are not permitted in blocks with check structure elements.
● Check structures are processed interpretively. When a loop end is detected, a search is
made for the loop beginning, allowing for the check 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 check structures and program branches.
● A check can be made to ensure that check structures are nested correctly when cycles are
preprocessed.
3.1.7.1

Conditional statement and branch (IF, ELSE, ENDIF)

Conditional statement: IF - program block - ENDIF
With a conditional statement, the program block between IF and ENDIF is only executed when
the condition is satisfied.
Branch: IF - program block_1 - ELSE - program block_2 - ENDIF
With a branch, one of two program blocks is always executed.
If the condition is satisfied, program block_1 between IF and ELSE is executed.
If the condition is not satisfied, program block_2 between ELSE and ENDIF is executed.
Note
ELSE in synchronized actions
The keyword ELSE can also be programmed in synchronized actions. Thus a synchronized
action can be expanded by actions that are to be executed if the condition is not fulfilled.
Syntax
Conditional statement
IF <condition>
ENDIF
Branch
IF <condition>
ELSE
ENDIF
476
Program block
Program block_1
Program block_2
; Execution with: <Condition> == TRUE
; Execution with: <Condition> == TRUE
; Execution with: <Condition> == FALSE
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
NC programming

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents