Case Statement - Siemens SINUMERIK 840D sl Programming Manual

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

Advertisement

Flexible NC programming

1.11 CASE statement

Example: single character access in call-by-reference parameter:
DEF STRING [50] STRG
DEF CHAR CHR1
EXTERN UP_CALL (VAR CHAR1)
...
CHR1 = STRG [5]
UP_CALL (CHR1)
STRG [5] = CHR1
1.11
CASE statement
1.11
Function
The CASE statement enables various branches to be executed according to a value of
type INT.
The program jumps to the point specified by the jump destination, depending on the value of
the constant evaluated in the CASE statement.
Programming
CASE (expression) OF constant1 GOTOF LABEL1 ... DEFAULT GOTOF LABELn
CASE (expression) OF constant1 GOTOB LABEL1 ... DEFAULT GOTOB LABELn
Parameters
CASE
GOTOB
GOTOF
GOTO
GOTOC
LABEL
LABEL:
Expression
Constant
DEFAULT
1-34
;Call-by-reference parameter!
;Call-by-reference
Keyword for jump statement
Jump statement with jump destination
backward (toward the beginning of
program)
Jump statement with forward jump
destination (toward the end of program)
Jump statement with the jump destination
first forward and then backward (the
direction first to the end of the program
and then to the start of the program)
Suppress Alarm 14080 "Destination not
found".
Jump statement with the jump destination
first forward and then backward (the
direction first to the end of the program
and then to the start of the program)
Destination (label within the program)
The name of the jump destination is
followed by a colon
Arithmetic expression
Constant of type INT
Program path if none of the previously
named constants applies
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Job planning

Advertisement

Table of Contents
loading

Table of Contents