Programming
10.9 Arithmetic parameters, LUD and PLC variables
Cylindrical grinding
306
Programming and Operating Manual, 07/2009, 6FC5398-4CP10-2BA0
Programming example: Assign R parameters to the axes
N10 G1 G91 X=R1 Z=R2 F300
;Separate blocks (traversing blocks)
N20 Z=R3
N30 X=-R4
N40 Z= SIN(25.3)-R5
;With arithmetic operations
...
Programming example: Indirect programming
N10 R1=5
;Assigning R1 directly value 5 (integer)
...
N100 R[R1]=27.123
;Indirectly assign R5 the value 27.123
10.9.2
Local User Data (LUD)
Functionality
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 32 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 typ, 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 t2 147 483 647 (decimal)
DEF REAL varname4
;Real type, natural number (like arithmetic parameter
R),
;Value range: ±(0.000 0001 ... 9999 9999)
Содержание SINUMERIK 802D
Страница 6: ...Preface Cylindrical grinding 6 Programming and Operating Manual 07 2009 6FC5398 4CP10 2BA0 ...
Страница 12: ...Table of contents Cylindrical grinding 12 Programming and Operating Manual 07 2009 6FC5398 4CP10 2BA0 ...
Страница 64: ...Define 4 10 User data Cylindrical grinding 64 Programming and Operating Manual 07 2009 6FC5398 4CP10 2BA0 ...
Страница 152: ...System 8 7 Alarm display Cylindrical grinding 152 Programming and Operating Manual 07 2009 6FC5398 4CP10 2BA0 ...
Страница 334: ...Programming 10 15 Oscillation Cylindrical grinding 334 Programming and Operating Manual 07 2009 6FC5398 4CP10 2BA0 ...
Страница 394: ...Appendix A 5 Overview Cylindrical grinding 394 Programming and Operating Manual 07 2009 6FC5398 4CP10 2BA0 ...
Страница 399: ...Index Cylindrical grinding Programming and Operating Manual 07 2009 6FC5398 4CP10 2BA0 399 W Word structure 221 ...