EasyManuals Logo

Siemens MCP 398C Programming Manual

Siemens MCP 398C
1334 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #467 background imageLoading...
Page #467 background image
Example 4: Jump with jump condition
Program code Comment
N40 R1=30 R2=60 R3=10 R4=11 R5=50 R6=20 ; Assignment of the initial values
N41 LA1: G0 X=R2*COS(R1)+R5 Y=R2*SIN(R1)+R6 ; Jump label LA1
N42 R1=R1+R3 R4=R4-1
; IF jump condition == TRUE
; THEN jump toward beginning of program to the jump label LA1
N43 IF R4>0 GOTOB LA1
N44 M30 ; End of program
3.1.5.3 Program branch (CASE ... OF ... DEFAULT ...)
The CASE function provides the possibility of checking the actual value (type: INT) of a variable
or an arithmetic function and, depending on the result, to jump to different positions in the
program.
Syntax
CASE(<expression>) OF <constant_1> GOTOF <jump target_1>
<constant_2> GOTOF <jump target_2> ... DEFAULT GOTOF <jump target_n>
Meaning
CASE: Jump statement
<expression>: Variable or arithmetic function
OF: Keyword to formulate conditional program branches.
<constant_1>: First specified constant value for the variable or arithmetic function
Type: INT
<constant_2>: Second specified constant value for the variable or arithmetic function
Type: INT
DEFAULT: For the cases where the variable or arithmetic function does not assume
any of the specified constant values, the DEFAULT statement can be used
to determine the jump target.
Note:
If the DEFAULT statement is not programmed, then in these cases, the
block following the CASE statement is the jump target.
GOTOF: Jump statement with jump target 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").
Work preparation
3.1 Flexible NC programming
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 467

Table of Contents

Other manuals for Siemens MCP 398C

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens MCP 398C and is the answer not in the manual?

Siemens MCP 398C Specifications

General IconGeneral
BrandSiemens
ModelMCP 398C
CategoryControl Systems
LanguageEnglish

Related product manuals