EasyManuals Logo
Home>Siemens>Control Unit>SINUMERIK 808D

Siemens SINUMERIK 808D User Manual

Siemens SINUMERIK 808D
339 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 #127 background imageLoading...
Page #127 background image
Programming and Operating Manual (Milling)
6FC5398-4DP10-0BA6, 09/2017
127
Arithmetic operations/arithmetic functions
When operators/arithmetic functions are used, it is imperative to use the conventional mathematical notation. Machining
priorities are set using the round brackets. Otherwise, multiplication and division take precedence over addition and
subtraction.
Degrees are used for the trigonometric functions.
Permitted arithmetic functions: see Section "List of instructions (Page 327)"
Programming example: Calculating with R parameters
N10 R1= R1+1
;The new R1 is calculated from the old R1 plus 1
N20 R1=R2+R3 R4=R5-R6 R7=R8*R9 R10=R11/R12
N30 R13=SIN(25.3)
;R13 equals sine of 25.3 degrees
N40 R14=R1*R2+R3
; Multiplication and division take pre cedence over ad-
dition or subtraction R14=(R1* R2)+R3
N50 R14=R3+R2*R1
;Result, the same as block N40
N60 R15=SQRT(R1*R1+R2*R2)
;Meaning:
N70 R1= -R1
;The new R1 is the negative old R1
Programming example: Assign R parameters to the axes
R1=40 R2=10 R3=-20 R4 =-45 R5=-30
N10 G1 G90 X= R1 Z=R2 F300
;Separate blocks (traversing blocks)
N20 Z=R3
N30 X=-R4
N40 Z= SIN(25.3)-R5
;With arithmetic operations
M30
Programming example: Indirect programming
N10 R1=5
;Assigning R1 directly value 5 (intege r)
N20 G0 X R[R1]=27.123
;Indirectly assign R5 the value 2 7.123
M30
11.13.2
Local User Data (LUD)
Fu n ctionality
The operator/programmer (user) can define his/her own variable in the program from various data types (LUD = Local User
Data). These variables are only available in the program in which they were defined. The definition takes place immediately
at the start of the program and can also be associated with a value assignment at the same time. Otherwise the starting
value is zero.
The name of a variable can be defined by the programmer. The naming is subject to the following rules:
A maximum of 31 characters can be used.
It is imperative to use letters for the first two characters; the remaining characters can be either letters, underscore or
digits.
Do not use a name already used in the control system (NC addresses, keywords, names of programs, subroutines, etc.).
Programming/data types
DEF BOOL varname1
;Boolean type, values: TRUE (=1), FALSE (=0)
DEF CHAR varname2
;Char type, 1 ASCII code character: "a", "b", ...
;Numerical code value: 0 ... 255
DEF INT varname3
;Integer type, integer values, 32 bit value range:
;-2 147 483 648 through +2 147 483 647 (decimal)
DEF REAL varname4
;Real type, natural number (like arithmetic parameter R),
;Value range: ±(0.000 0001 ... 9999 9999)
;(8 decimal places, arithmetic sign and decimal point) or
;Exponential notation: ± (10 to power of
-300 ... 10 to power of +300)
DEF STRING[string length] varname41
; STRING type, [string length]: Maximum number of characters

Table of Contents

Other manuals for Siemens SINUMERIK 808D

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens SINUMERIK 808D and is the answer not in the manual?

Siemens SINUMERIK 808D Specifications

General IconGeneral
BrandSiemens
ModelSINUMERIK 808D
CategoryControl Unit
LanguageEnglish

Related product manuals