siemens 840D Programming Manual

SINUMERIK
SINUMERIK 840D sl / 828D Job Planning
Programming Manual
Valid for
Software Version CNC software 4.5 SP2
Preface
Flexible NC programming File and Program
Management
Protection zones
Special motion commands Coordinate transformations
(frames)
Transformations
Kinematic chains Collision avoidance with
kinematic chains
Tool offsets
Path traversing behavior
Axis couplings
Synchronized actions
Oscillation
Punching and nibbling
Grinding
Additional functions User stock removal
programs Programming cycles
externally
Tables
Appendix
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16 17 18 19
A
03/2013
6FC5398-2BP40-3BA1
Legal information Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems. The permissible ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this publication is reviewed regularly and any necessary corrections are included in subsequent editions.
Siemens AG
Industry Sector Postfach 48 48 90026 NÜRNBERG GERMANY
Order number: 6FC5398-2BP40-3BA1 04/2013 Technical data subject to change
Copyright © Siemens AG 1995 - 2013. All rights reserved

Preface

SINUMERIK documentation
The SINUMERIK documentation is organized in the following categories:
● General documentation
● User documentation
● Manufacturer/service documentation
Additional information
You can find information on the following topics at www.siemens.com/motioncontrol/docu:
● Ordering documentation/overview of documentation
● Additional links to download documents
● Using documentation online (find and search in manuals/information)
Please send any questions about the technical documentation (e.g. suggestions for improvement, corrections) to the following address:
docu.motioncontrol@siemens.com
My Documentation Manager (MDM)
Under the following link you will find information to individually compile OEM-specific machine documentation based on the Siemens content:
www.siemens.com/mdm
Training
For information about the range of training courses, refer under:
● www.siemens.com/sitrain
SITRAIN - Siemens training for products, systems and solutions in automation technology
● www.siemens.com/sinutrain
SinuTrain - training software for SINUMERIK
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
3
Preface
FAQs
You can find Frequently Asked Questions in the Service&Support pages under Product Support. http://support.automation.siemens.com
SINUMERIK
You can find information on SINUMERIK under the following link:
www.siemens.com/sinumerik
Target group
This publication is intended for:
● Programmers
● Project engineers
Benefits
With the programming manual, the target group can develop, write, test, and debug programs and software user interfaces.
Standard scope
This Programming Manual describes the functionality afforded by standard functions. Extensions or changes made by the machine tool manufacturer are documented by the machine tool manufacturer.
Other functions not described in this documentation might be executable in the control. This does not, however, represent an obligation to supply such functions with a new control or when servicing.
Further, for the sake of simplicity, this documentation does not contain all detailed information about all types of the product and cannot cover every conceivable case of installation, operation or maintenance.
Technical Support
You will find telephone numbers for other countries for technical support in the Internet under http://www.siemens.com/automation/service&support
Job Planning
4 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Preface
Information on structure and contents
"Fundamentals" and "Job planning" Programming Manual
The description of the NC programming is divided into two manuals:
1. Fundamentals
The "Fundamentals" Programming Manual is intended for use by skilled machine operators with the appropriate expertise in drilling, milling and turning operations. Simple programming examples are used to explain the commands and statements which are also defined according to DIN 66025.
2. Job planning
This "Job planning" Programming Manual is intended for use by technicians with in-depth, comprehensive programming knowledge. By virtue of a special programming language, the SINUMERIK control enables the user to program complex workpiece programs (e.g. for free-form surfaces, channel coordination, ...) and makes programming of complicated operations easy for technologists.
Availability of the described NC language elements
All NC language elements described in the manual are available for the SINUMERIK 840D sl. The availability regarding SINUMERIK 828D can be found in table "Operations: Availability for SINUME
RIK 828D (Page 778)".
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
5
Preface
Job Planning
6 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1

Table of contents

Preface ...................................................................................................................................................... 3
1 Flexible
1.1 Variables
1.1.1 Sy
1.1.2 Predefined user
1.1.3 Predefined user
1.1.4 Definition of us
1.1.
1.1.6 Attribute: Initi
1.1.7 Attribute: Limi
1.1.8 Attribute: Phys
1.1.9 Attribute: Ac
1.1.10 O
1.1.11
1.1.12
1.1.13 D
1.1.14 E
1.1.15 C
1.1.16
1.2
1.2.1 Indirec
1.2.2 Indirec
1.2.3 Indirec
1.2.4 Indirec
NC programming ........................................................................................................................ 17
5 Redefinition of system variables, user variables, and NC language commands (REDEF).........29
verview of definable and redefinable attributes.........................................................................44
Definition and initialization of array variables (DEF, SET, REP) .................................................45
Definition and initialization of array variables (DEF, SET, REP): Further Information.................49
ata types....................................................................................................................................52
xplicit data type conversions (AXTOINT, INTTOAX).................................................................53
heck availability of a variable (ISVAR) ......................................................................................54
Read attribute values / data type (GETVARPHU, GETVARAP, GETVARLIM,
GETVARDFT, GETVARTYP) ......................................................................................................56
Indirec
......................................................................................................................................17
stem variable............................................................................................................................17
variables: Arithmetic parameters (R).................................................................20
variables: Link variables....................................................................................21
er variables (DEF)................................................................................................24
alization value .........................................................................................................32
t values (LLI, ULI)...................................................................................................35
ical unit (PHU) ......................................................................................................37
cess rights (APR, APW, APRP, APWP, APRB, APWB)..........................................39
t programming ...................................................................................................................61
tly programming addresses...............................................................................................61
tly programming G codes..................................................................................................64
tly programming position attributes (GP) ..........................................................................65
tly programming part program lines (EXECSTRING) .......................................................68
1.3 Arithmetic
1.4 Compari
1.5 Prec
1.6 Variabl
1.7 Priority of the operations
1.8 Pos
1.9 String operations
1.9.1 Ty
1.9.2 Ty
1.9.3 Conc
1.9.4 Conv
1.9.5 Determine length
1.9.6 Search for
1.9.7 Selec
1.9.8 Reading and
1.9.9 Formatting a s
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
pe conversion to STRING (AXSTRING) ..................................................................................78
pe conversion from STRING (NUMBER, ISNUMBER, AXNAME) ..........................................79
functions......................................................................................................................69
son and logic operations ................................................................................................71
ision correction on comparison errors (TRUNC) ..................................................................73
e minimum, maximum and range (MINVAL, MAXVAL and BOUND) ..............................74
..............................................................................................................76
sible type conversions ...........................................................................................................77
..........................................................................................................................78
atenation of strings (<<).......................................................................................................81
ersion to lower/upper case letters (TOLOWER, TOUPPER) ..............................................82
of string (STRLEN)..........................................................................................83
character/string in the string (INDEX, RINDEX, MINDEX, MATCH)..........................83
tion of a substring (SUBSTR) .............................................................................................85
writing of individual characters ...............................................................................85
tring (SPRINT) ......................................................................................................87
7
Table of contents
1.10 Program jumps and branches..................................................................................................... 96
1.10.1 Return jump to the start of the program (GOTOS)...................................................................... 96
1.10.2
1.10.3 Program branc
Program jumps to jump markers (GOTOB, GOTOF, GOTO, GOTOC)...................................... 97
h (CASE ... OF ... DEFAULT ...)........................................................................ 100
1.11 R
1.12 C
1.12.1 Conditional st
1.12.2 Continuous
1.12.3 Count loop (F
1.12.4
epeat program section (REPEAT, REPEATB, ENDLABEL, P).............................................. 102
heck structures ....................................................................................................................... 108
atement and branch (IF, ELSE, ENDIF) ............................................................. 110
program loop (LOOP, ENDLOOP)......................................................................... 111
OR ... TO ..., ENDFOR) ...................................................................................... 112
Program loop with condition at start of loop (WHILE, ENDWHILE).......................................... 114
1.12.5 Program loop with condition at the end of the loop (RE
1.12.6 Program ex
1.13
1.14 I
Program coordination (INIT, START, WAITM, WAITMC, WAITE, SETM, CLEARM) .............. 116
nterrupt routine (ASUB)............................................................................................................ 121
1.14.1 Func
1.14.2 Creating an interrupt routine
1.14.3
1.14.4
Assign and start interrupt routine (SETINT, PRIO, BLSYNC) .................................................. 124
Deactivating/reactivating the assignment of an interrupt routine (DISABLE, ENABLE)........... 125
1.14.5 Delete ass
1.14.6
1.14.7
Fast retraction from the contour (SETINT LIFTFAST, ALF) ..................................................... 127
Traversing direction for fast retraction from the contour........................................................... 129
1.14.8 Motion s
1.15 Ax
is replacement, spindle replacement (RELEASE, GET, GETD)........................................... 132
1.16 Transfer axi
1.17 A
ctivate machine data (NEWCONF)......................................................................................... 138
ample with nested check structures ....................................................................... 115
tion of an interrupt routine ................................................................................................. 121
..................................................................................................... 123
ignment of interrupt routine (CLRINT) ..................................................................... 126
equence for interrupt routines ..................................................................................... 132
s to another channel (AXTOCHAN)....................................................................... 137
PEAT, UNTIL) .................................... 115
1.18 Write file (WRITE)
1.19 D
1.20 R
1.21 C
1.22
1.23 R
elete file (DELETE)................................................................................................................. 144
ead lines in the file (READ) .................................................................................................... 146
heck for presence of file (ISFILE)........................................................................................... 148
Read out file information (FILEDATE, FILETIME, FILESIZE, FILESTAT, FILEINFO) ............. 150
oundup (ROUNDUP).............................................................................................................. 153
..................................................................................................................... 139
1.24 Subprogram technique
1.24.1 General information
1.24.1.1 Subprogram
1.24.1.2 Subprogram
1.24.1.3 Nes
1.24.1.4 Searc
ting of subprograms............................................................................................................ 156
h path............................................................................................................................... 157
.............................................................................................................................. 154
names................................................................................................................... 155
1.24.1.5 Formal and ac
1.24.1.6 Parameter trans
1.24.2 Definition of a s
1.24.2.1 Subprogram
1.24.2.2
1.24.2.3
1.24.2.4 Sav
Subprogram with call-by-value parameter transfer (PROC)..................................................... 162
Subprogram with call-by-reference parameter transfer (PROC, VAR)..................................... 163
e modal G functions (SAVE)............................................................................................... 166
1.24.2.5 Suppress si
without parameter transfer ................................................................................... 161
ngle block execution (SBLOF, SBLON) ................................................................. 167
................................................................................................................... 154
tual parameters .................................................................................................. 158
fer .................................................................................................................... 159
ubprogram........................................................................................................ 161
.............................................................................................................. 154
Job Planning
8 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Table of contents
1.24.2.6 Suppress current block display (DISPLOF, DISPLON, ACTBLOCNO).....................................172
1.24.2.7 Identifying subprograms with preparation (PREPRO) ...............................................................175
1.24.2.8 Subprogram return M17
1.24.2.9 RET s
1.24.2.10 P
1.24.3 Subprogram
1.24.3.1 Subprogram
1.24.3.2 Subprogram
ubprogram return .............................................................................................................177
arameterizable subprogram return jump (RET ...) .............................................................178
call.........................................................................................................................184
call without parameter transfer..............................................................................184
call with parameter transfer (EXTERN).................................................................187
1.24.3.3 Number of program repetitions
1.24.3.4 Modal subprogram
1.24.3.5 Indirec
1.24.3.6
Indirect subprogram call with specification of the calling program part (CALL BLOCK ...
t subprogram call (CALL) ................................................................................................193
.............................................................................................................176
(P) ............................................................................................189
call (MCALL) ...............................................................................................191
TO ...) .........................................................................................................................................194
1.24.3.7
1.24.3.8
1.24.3.9 Extend
1.24.3.10 E
1.24.3.11 E
Indirect call of a program programmed in ISO language (ISOCALL)........................................195
Call subprogram with path specification and parameters (PCALL)...........................................196
search path for subprogram calls (CALLPATH)............................................................197
xecute external subprogram (840D sl) (EXTCALL)............................................................198
xecute external subprogram (828D) (EXTCALL) ...............................................................202
1.25 Macro techni
2 File and Program Mana
2.1 Program memory
2.2 Work
3 P
rotection zones.................................................................................................................................... 217
ing memory (CHANDATA, COMPLETE, INITIAL) ............................................................213
3.1 Defining the protec
3.2 Ac
3.3 Che
tivating/deactivating protection zones (CPROT, NPROT).....................................................220
cking for protection zone violation, working area limitation and software limit switches
que (DEFINE ... AS)..............................................................................................205
gement ............................................................................................................. 209
.......................................................................................................................209
tion zones (CPROTDEF, NPROTDEF) .......................................................217
(CALCPOSI)...............................................................................................................................224
4 S
pecial motion commands..................................................................................................................... 229
4.1 Approaching
coded positions (CAC, CIC, CDC, CACP, CACN) ...............................................229
4.2 Spline interpolation (ASPLINE, BSPLINE, CSPLINE,
ENAT, ETAN, PW, SD, PL) .......................................................................................................230
4.3 Spline group (SPLINEPAT
4.4 NC bl
4.5 Poly
4.6 Settable path refe
ock compression (COMPON, COMPCURV, COMPCAD, COMPOF)..............................241
nomial interpolation (POLY, POLYPATH, PO, PL).............................................................244
rence (SPATH, UPATH)................................................................................250
H).....................................................................................................240
BAUTO, BNAT, BTAN, EAUTO,
4.7 Measuri
4.8 Ax
4.9 Spec
4.10
Feedrate reduction with corner deceleration (FENDNORM, G62, G621) .................................267
4.11 P
ng with touch-trigger probe (MEAS, MEAW) ................................................................253
ial measurement (MEASA, MEAWA, MEAC) (option)...........................................................256
ial functions for OEM users (OMA1 ... OMA5, OEMIPO1, OEMIPO2, G810 ... G829).....266
rogrammable end of motion criteria (FINEA, COARSEA, IPOENDA, IPOBRKA,
ADISPOSA)................................................................................................................................268
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
9
Table of contents
5 Coordinate transformations (frames) ..................................................................................................... 271
5.1 Coordinate transformation via frame variables ......................................................................... 271
5.1.1 Predefin
ed frame variable ($P_IFRAME, $P_BFRAME, $P_PFRAME, $P_ACTFRAME)....... 273
5.2 Frame
5.2.1 As
5.2.2 Reading and
5.2.3 Link
5.2.4 Defining new
5.3 Coarse and fine offs
5.4 Ex
5.5 Preset offs
5.6 Frame
5.7 NCU global frames
5.7.1 Channel
5.7.2 Frames
6 Tran
sformations..................................................................................................................................... 299
variables / assigning values to frames........................................................................... 278
signing direct values (axis value, angle, scale) .................................................................... 278
changing frame components (TR, FI, RT, SC, MI).............................................. 280
ing complete frames ........................................................................................................... 282
frames (DEF FRAME) ......................................................................................... 283
ets (CFINE, CTRANS).............................................................................. 284
ternal zero offset ................................................................................................................... 286
et with PRESETON.................................................................................................. 287
calculation from three measuring points in space (MEAFRAME) ................................. 288
.................................................................................................................... 292
-specific frames ($P_CHBFR, $P_UBFR) ................................................................... 293
active in the channel .................................................................................................... 294
6.1 General programming of trans
6.1.1 Orientation mov
6.1.2 Ov
erview of orientation transformation TRAORI....................................................................... 305
6.2 Three, four and fiv
6.2.1 General relationships
6.2.2 Three, four and fiv
6.2.3 Variant
s of orientation programming and initial setting (ORIRESET)....................................... 311
ements for transformations.............................................................................. 301
e axis transformation (TRAORI) .................................................................. 307
of universal tool head............................................................................. 307
e axis transformation (TRAORI) .................................................................. 310
6.2.4 Programming the tool orientation (A..., B
6.2.5 Face milli
6.2.6 Referenc
ng (A4, B4, C4, A5, B5, C5)....................................................................................... 319
e of the orientation axes (ORIWKS, ORIMKS):.......................................................... 321
6.2.7 Programming orientation ax
ORIVIRT1, ORIVIRT2).............................................................................................................. 323
6.2.8
Orientatio
n programming along the peripheral surface of a taper (ORIPLANE,
ORICONCW, ORICONCCW, ORICONTO, ORICONIO).......................................................... 326
6.2.9
Specification
of orientation for two contact points (ORICURVE, PO[XH]=, PO[YH]=,
PO[ZH]=) ................................................................................................................................... 329
formation types ......................................................................... 299
..., C..., LEAD, TILT) ................................................. 313
es (ORIAXES, ORIVECT, ORIEULER, ORIRPY, ORIRPY2,
6.3
6.4 Rotation
6.5 Orientations
Orientation polynomial
s of the tool orientation (ORIROTA, ORIROTR, ORIROTT, ORIROTC, THETA)....... 333
relative to the path ................................................................................................ 336
6.5.1 Orientation types relative to the path
6.5.2 Rotation of the tool orient
s (PO[angle], PO[coordinate])............................................................... 331
........................................................................................ 336
ation relative to the path (ORIPATH, ORIPATHS, angle of
rotation) ..................................................................................................................................... 337
6.5.3
Interpolatio
6.5.4 Smoothing of
6.6 Comp
6.7 Smoothing th
6.8 Kinematic
6.8.1 Milling on turned parts (TRANSMIT):
Job Planning
n of the tool rotation relative to the path (ORIROTC, THETA)................................ 339
orientation characteristic (ORIPATHS A8=, B8=, C8=) ...................................... 341
ression of the orientation (COMPON, COMPCURV, COMPCAD).................................. 342
e orientation characteristic (ORISON, ORISOF) ................................................. 344
transformation .......................................................................................................... 347
........................................................................................ 347
10 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Table of contents
6.8.2 Cylinder surface transformation (TRACYL) ...............................................................................349
6.8.3 Inclined axis (TRAANG).............................................................................................................357
6.8.4 Inc
lined axis programming (G5, G7)..........................................................................................360
6.9 Cartes
ian PTP travel..................................................................................................................362
6.9.1 PTP for TRANSMIT
onstraints when selecting a transformation.............................................................................370
eselecting a transformation (TRAFOOF) ................................................................................371
hained transformations (TRACON, TRAFOOF)......................................................................371
7 K
6.10 C
6.11 D
6.12 C
inematic chains.................................................................................................................................... 375
7.1 Deletion of components (DELOBJ)
7.2 Index determi
8 Collision a
voidance with kinematic chains ............................................................................................. 379
8.1 Check
8.2 Req
uesting a recalculation of the collision model (PROTA)......................................................380
8.3 Setting the protec
8.4 Determining the c
9 Tool
offsets............................................................................................................................................ 385
9.1 Offs
et memory............................................................................................................................385
9.2 Additiv
9.2.1 Selec
9.2.2 Specify
9.2.3 Delete additive offs
for collision pair (COLLPAIR) .........................................................................................379
e offsets...........................................................................................................................388
ting additive offsets (DL) ...................................................................................................388
nation by means of names (NAMETOINT) ..........................................................377
tion zone status (PROTS)..............................................................................382
learance of two protection zones (PROTD)...................................................383
wear and setup values ($TC_SCPxy[t,d], $TC_ECPxy[t,d]).........................................389
ets (DELDL).................................................................................................390
...................................................................................................................366
............................................................................................375
9.3 Special handl
9.3.1 Mirroring of tool lengths
9.3.2 Wear s
9.3.3 Coo
rdinate system of the active machining operation (TOWSTD, TOWMCS, TOWWCS,
ing of tool offsets ..................................................................................................391
.............................................................................................................393
ign evaluation .................................................................................................................394
TOWBCS, TOWTCS, TOWKCS)...............................................................................................395
9.3.4
Tool length a
9.4 Online tool of
9.5 Ac
tivate 3D tool offsets (CUT3DC..., CUT3DF...)......................................................................404
9.5.1 Activating 3
9.5.2 3D tool offset
9.5.3 3D tool offset
9.5.4 3D tool offset
9.5.5 3D tool offset
9.5.6 3D tool offset
9.5.7 3D tool offset
9.6 Tool ori
9.7 Free assignm
9.7.1 Free a
9.7.2 Free a
9.7.3 Free a
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
nd plane change....................................................................................................398
fset (PUTFTOCF, FCTDEF, PUTFTOC, FTOCON, FTOCOF)............................399
D tool offsets (CUT3DC, CUT3DF, CUT3DFS, CUT3DFF, ISD)............................404
peripheral milling, face milling .............................................................................406
Tool shapes and tool data for face milling...........................................................408
Offset on the path, path curvature, insertion depth (CUT3DC, ISD)...................409
Inside/outside corners and intersection procedure (G450/G451) .......................412
3D circumferential milling with limitation surfaces...............................................413
: Taking into consideration a limitation surface (CUT3DCC, CUT3DCCD)..........414
entation (ORIC, ORID, OSOF, OSC, OSS, OSSE, ORIS, OSD, OST).........................418
ent of D numbers, cutting edge numbers.............................................................424
ssignment of D numbers, cutting edge numbers (CE address) ......................................424
ssignment of D numbers: Checking D numbers (CHKDNO)...........................................424
ssignment of D numbers: Rename D numbers (GETDNO, SETDNO)...........................425
11
Table of contents
9.7.4 Free assignment of D numbers: Determine T number to the specified D number
(GETACTTD) ............................................................................................................................ 426
9.7.5 Free ass
ignment of D numbers: Invalidate D numbers (DZERO) ............................................ 427
9.8 Toolholder k
9.9 Tool length
TCOFRX, TCOFRY, TCOFRZ)................................................................................................. 433
9.10 O
9.11
10 Path trav
10.1
nline tool length compensation (TOFFON, TOFFOF)............................................................ 436
Cutting data modification for tools that can be rotated (CUTMOD) .......................................... 439
ersing behavior........................................................................................................................ 445
Tangential control (TANG, TANGON, TANGOF, TLIFT, TANGDEL)....................................... 445
10.2 Feedrate charac
10.3 Accel
10.3.1 Accel
10.3.2
10.3.3
eration behavior................................................................................................................ 457
eration mode (BRISK, BRISKA, SOFT, SOFTA, DRIVE, DRIVEA) ................................ 457
Influence of acceleration on following axes (VELOLIMA, ACCLIMA, JERKLIMA)................... 459
Activation of technology-specific dynamic values (DYNNORM, DYNPOS, DYNROUGH,
DYNSEMIFIN, DYNFINISH) ..................................................................................................... 461
10.4
Traversing wi
10.5 Programmable c
10.6
Program sequence with preprocessing memory (STOPFIFO, STARTFIFO, FIFOCTRL,
STOPRE) .................................................................................................................................. 466
10.7
Program sections that can be conditionally interrupted (DELAYFSTON, DELAYFSTOF)....... 469
10.8 Prevent program pos
inematics ............................................................................................................... 427
compensation for orientable toolholders (TCARR, TCOABS, TCOFR,
teristic (FNORM, FLIN, FCUB, FPO).............................................................. 452
th feedforward control (FFWON, FFWOF) .......................................................... 463
ontour accuracy (CPRECON, CPRECOF)..................................................... 464
ition for SERUPRO (IPTRLOCK, IPTRUNLOCK)................................... 474
10.9
Repositioning to the contour (REPOSA, REPOSL, REPOSQ, REPOSQA, REPOSH,
REPOSHA, DISR, DISPR, RMIBL, RMBBL, RMEBL, RMNBL)............................................... 476
10.10 I
10.10.1 Percentage jerk
10.10.2 Percentage veloc
nfluencing the motion control ................................................................................................... 484
correction (JERKLIM) ..................................................................................... 484
ity correction (VELOLIM)............................................................................... 486
10.10.3 Program example for JE
Programmable contour/orientation tolerance (CTOL, OTOL, ATOL) ....................................... 488
olerance for G0 motion (STOLF) ............................................................................................ 492
lock change behavior with active coupling (CPBC)................................................................ 494
11 A
10.11
10.12 T
10.13 B
xis couplings........................................................................................................................................ 495
11.1 Coupled motion (TRAILON, TRAILOF)
11.2 Curv
11.2.1 Define
11.2.2 Check
11.2.3 Delete
11.2.4
11.2.5
e tables (CTAB)................................................................................................................. 500
curve tables (CTABDEF, CATBEND)............................................................................ 501
for presence of curve table (CTABEXISTS) .................................................................. 507
curve tables (CTABDEL) ............................................................................................... 507
Locking curve tables to prevent deletion and overwriting (CTABLOCK, CTABUNLOCK) ....... 509
Curve tables: Determine table properties (CTABID, CTABISLOCK, CTABMEMTYP,
CTABPERIOD).......................................................................................................................... 510
11.2.6
Read curve table values (CTABTSV, CTABTEV, CTABTSP, CTABTEP, CTABSSV,
CTABSEV, CTAB, CTABINV, CTABTMIN, CTABTMAX)......................................................... 512
RKLIM and VELOLIM......................................................................... 488
..................................................................................... 495
Job Planning
12 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Table of contents
11.2.7 Curve tables: Check use of resources (CTABNO, CTABNOMEM, CTABFNO, CTABSEGID, CTABSEG, CTABFSEG, CTABMSEG, CTABPOLID, CTABPOL,
CTABFPOL, CTABMPOL).........................................................................................................517
Ax
11.3
ial master value coupling (LEADON, LEADOF) ....................................................................518
11.4 Elec
11.4.1 Defining an electronic
11.4.2
11.4.3 Switching-i
11.4.4
11.4.5 Rotational feedrate
11.5 Sy
11.5.1
tronic gear (EG) ..................................................................................................................523
gear (EGDEF) ........................................................................................524
Switch-in the electronic gearbox (EGON, EGONSYN, EGONSYNE).......................................525
n the electronic gearbox (EGOFS, EGOFC) ............................................................529
Deleting the definition of an electronic gear (EGDEL)...............................................................530
(G95) / electronic gear (FPR).....................................................................530
nchronous spindle..................................................................................................................531
Synchronous spindle: Programming (COUPDEF, COUPDEL, COUPON, COUPONC,
COUPOF, COUPOFS, COUPRES, WAITC).............................................................................531
Generic
Master/slave coupling (MASLDEF, MASLDEL, MASLON, MASLOF, MASLOFS) ...................549
12 S
11.6
11.7
ynchronized actions............................................................................................................................. 553
12.1 Definition of a s
13 Oscillation
.............................................................................................................................................. 555
coupling (CP...).............................................................................................................541
ynchronized action ............................................................................................553
13.1 Asynchronous oscillation (OS, OSP1, OSP2, OST1, OST2, OSCTRL, OSNS
OSB) ..........................................................................................................................................555
13.2 Oscillation
14 P
unching and nibbling ........................................................................................................................... 569
14.1 Ac
14.1.1 Punc
tivation, deactivation ..............................................................................................................569
controlled by synchronized actions (OSCILL)..........................................................560
hing and nibbling on or off (SPOF, SON, PON, SONS, PONS, PDELAYON,
PDELAYOF, PUNCHACC) ........................................................................................................569
C, OSE,
14.2
Automatic
14.2.1 Path s
14.2.2 Path s
15 Gri
nding................................................................................................................................................. 581
15.1
Grinding-specific tool monitoring in the part program (TMON, TMOF)......................................581
16 Additional fun
16.1 Ax
is functions (AXNAME, AX, SPI, AXTOSPI, ISAXIS, AXSTRING, MODAXVAL) .................583
16.2 Repl
16.3 Ax
is container (AXCTSWE, AXCTSWED, AXCTSWEC) ..........................................................590
16.4 Wait for valid
16.5 Programmable parameter
16.6 Check
16.7
Interactively call the window from the part program (MMC) ......................................................598
16.8 Program runtime/part c
path segmentation ....................................................................................................574
egmentation for path axes ...............................................................................................577
egmentation for single axes.............................................................................................579
ctions................................................................................................................................ 583
aceable geometry axes (GEOAX)......................................................................................585
axis position (WAITENC) .....................................................................................592
set changeover (SCPARA)..............................................................593
scope of NC language present (STRINGIS)...................................................................594
ounter....................................................................................................600
16.8.1 Program runtime/part count
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
er (overview) ..................................................................................600
13
Table of contents
16.8.2 Program runtime ....................................................................................................................... 600
16.8.3 Workpiece counter .................................................................................................................... 604
16.9 Process
16.10 Alarms
16.11 E
xtended stop and retract (ESR) .............................................................................................. 616
16.11.1 NC-controlled ESR
16.11.1.1
DataShare - output to an external device/file (EXTOPEN, WRITE, EXTCLOSE)...... 605
(SETAL) ........................................................................................................................ 614
.................................................................................................................... 617
NC-controlled retraction (POLF, POLFA, POLFMASK, POLFMLIN) .................................. 617
16.11.1.2 NC-controlled stopping
16.11.2 Driv
e-integrated ESR ................................................................................................................ 622
16.11.2.1 Configuring drive-integrated stoppi
16.11.2.2 Configuring driv
17 Use
r stock removal programs................................................................................................................ 625
17.1 Supporting function
e-integrated retraction (ESRS) ................................................................... 623
s for stock removal..................................................................................... 625
17.2 Generate contour table (CONTP
17.3 Generate coded c
17.4
17.5
17.6 Calc
Determine point of intersection between two contour elements (INTERSEC) ......................... 635
Execute the contour elements of a table block-by-block (EXECTAB)...................................... 637
ulate circle data (CALCDAT) ............................................................................................. 638
17.7 Deac
18 P
rogramming cycles externally.............................................................................................................. 641
18.1 Tec
hnology cycles..................................................................................................................... 641
18.1.1 Introduc
18.1.2 Drilling, centering -
tivate contour preparation (EXECUTE) ............................................................................ 640
tion ............................................................................................................................... 641
ontour table (CONTDCON) .......................................................................... 632
CYCLE81 ................................................................................................... 642
18.1.3 Drilling, counterboring - CY
18.1.4 Reaming -
18.1.5 Deep-hole drilling - CY
18.1.6 Boring -
CYCLE85................................................................................................................. 644
CLE83................................................................................................... 645
CYCLE86..................................................................................................................... 648
18.1.7 Tapping without compensating chuck -
18.1.8 Tapping with
compensating chuck - CYCLE840....................................................................... 652
18.1.9 Thread milling - CYCLE78
18.1.10 F
18.1.11 R
18.1.12 G
18.1.13 C
18.1.14 Face milling - CYCLE61
18.1.15 M
18.1.16 Milling a ci
18.1.17 R
18.1.18 C
reely programmable positions - CYCLE802 ........................................................................... 656
ow of holes - HOLES1............................................................................................................ 657
rid or frame - CYCLE801........................................................................................................ 658
ircle of holes - HOLES2.......................................................................................................... 659
............................................................................................................ 661
illing a rectangular pocket - POCKET3 .................................................................................. 662
rcular pocket - POCKET4......................................................................................... 665
ectangular spigot milling - CYCLE76...................................................................................... 667
ircular spigot milling - CYCLE77............................................................................................. 669
18.1.19 Multiple-edge - CYCLE79
18.1.20 Longitudinal
18.1.21 C
ircumferential slot - SLOT2..................................................................................................... 675
slot - SLOT1.......................................................................................................... 673
18.1.22 Mill open slot - CYCLE899
18.1.23 E
18.1.24 T
18.1.25 E
longated hole - LONGHOLE................................................................................................... 679
hread milling - CYCLE70 ........................................................................................................ 681
ngraving cycle - CYCLE60...................................................................................................... 683
........................................................................................................ 621
ng (ESRS)..................................................................... 622
RON) ..................................................................................... 626
CLE82............................................................................................ 643
CYCLE84 ................................................................... 649
........................................................................................................ 654
......................................................................................................... 671
........................................................................................................ 677
Job Planning
14 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Table of contents
18.1.26 Contour call - CYCLE62.............................................................................................................685
18.1.27 Path milling - CYCLE72 .............................................................................................................685
18.1.28 P
18.1.29 Milling a contour pocket -
18.1.30 S
18.1.31 G
18.1.32 U
18.1.33 Thread turning - CYCLE99
18.1.34 T
18.1.35 C
18.1.36 C
18.1.37 C
18.1.38 S
18.1.39 H
redrilling a contour pocket - CYCLE64....................................................................................688
CYCLE63..........................................................................................689
tock removal - CYCLE951.......................................................................................................692
roove - CYCLE930 ..................................................................................................................694
ndercut forms - CYCLE940 .....................................................................................................696
........................................................................................................699
hread chain - CYCLE98...........................................................................................................702
ut-off - CYCLE92 .....................................................................................................................705
ontour cutting - CYCLE95 .......................................................................................................706
ontour grooving - CYCLE952 ..................................................................................................708
wiveling - CYCLE800...............................................................................................................712
igh Speed Settings - CYCLE832.............................................................................................714
19 Tables
19.1 Operations
19.2 Operations: Availability for
19.3 Currently set language in t
.................................................................................................................................................... 717
..................................................................................................................................717
SINUMERIK 828D ..........................................................................778
he HMI .............................................................................................802
A Appendix.....................................................
A.1 List of abbreviations
G
I
A.2 Doc
lossary ................................................................................................................................................ 813
ndex...................................................................................................................................................... 835
umentation overview............................................................................................................812
...................................................................................................................803
........................................................................................... 803
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
15
Table of contents
Job Planning
16 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1

Flexible NC programming

1.1 Variables

The use of variables, especially in conjunction with arithmetic functions and check structures, enables part programs and cycles to be set up with extremely high levels of flexibility. The system provides three different types of variables.
● System variables
System variables are variables with a fixed predefined meaning; they are defined in the system and made available to the user. They are also read and written by the system software. Example: Machine data
The meaning of a system variable is permanently set by the system. However, minor modifications can be made to the properties by the user in the form of redefinition. See "Redefinition of system variables, user variables, and NC language (Page 29)"
● User variable
User variables are variables whose meaning is not known to the system; they are not evaluated by the system. The meaning is defined exclusively by the user.
User variables are subdivided into:
s
ands (REDEF)
comm
1
– Predefined user variables
Predefined user variables are variables which have already been defined in the system and whose number simply has to be parameterized by the user via specific machine data. The user can make significant changes to the properties of these variables. See "Redefinition of system variables, user variables, and NC language comm
ands (REDEF) (Page 29)".
– User-defined
User-defined variables are variables which are defined exclusively by the user and are not created by the system until runtime. Their number, data type, visibility, and all other properties are defined exclusively by the user.
See "Definition of user variables (DEF) (Page 24)"

1.1.1 System variable

System variables are variables which are predefined in the system and enable access to the current parameter settings of the control, as well as to machine, control, and process states, in part programs and cycles.
variables
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
17
Flexible NC programming
1.1 Variables
Preprocessing variables
Preprocessing variables are system variables that are read and written in the context of preprocessing; in other words, at the point in time at which the part program block in which the system variable is programmed is interpreted. Preprocessing variables do not trigger preprocessing stops.
Main run variables
Main run variables are system variables which are read and written in the context of the main run; in other words at the point in time at which the part program block in which the system variable is programmed is executed. The following are main run variables:
● System variables which can be programmed in synchronized actions (read/write)
● System variables which can be programmed in the part program and trigger preprocessing stops (read/write)
● System variables which can be programmed in the part program and whose value is calculated during preprocessing but not written until the main run (main run synchronized: write only)
Prefix system
In order that they can be specifically identified, the names of system variables are usually preceded by a prefix comprising the $ sign followed by one or two letters and an underscore.
$ + 1st letter Meaning: Data type System variables which are read/written during preprocessing $M Machine data 1) $S Setting data, protection zones 1) $T Tool management data $P Programmed values $C Cycle variables of ISO envelope cycles $O Option data R R-parameters (arithmetic parameters) 2) System variables which are read/written during the main run $$M Machine data 1) $$S Setting data 1) $A Current main run data $V Servo data $R R-parameters (arithmetic parameters) 2)
1)
Whether machine and setting data is treated as preprocessing or main run variables depends on whether they are written with one or two $ characters. The notation is freely selectable for the specific application.
2)
When an R-parameter is used in the part program/cycle as a preprocessing variable, the prefix is omitted, e.g. R10. When it is used in a synchronized action as a main run variable, a $ sign is written as a prefix, e.g. $R10.
Job Planning
18 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Flexible NC programming
1.1 Variables
2nd letter Meaning: Visibility N NCK-global variable (NCK) C Channel-specific variable (Channel) A Axis-specific variable (Axis)
Supplementary conditions
Exceptions in the prefix system
The following system of variables deviate from the prefix system specified above:
● $TC_...: Here, the 2nd letter C does not refer to channel-specific system variables but to toolholder-specific system variables (TC= tool carrier).
● $P_ ...: Channel-specific system variables
Use of machine and setting data in synchronized actions
When machine and setting data is used in synchronized actions, the prefix can be used to define whether the machine or setting data will be read/written synchronous to the preprocessing run or the main run.
References
If the data remains unchanged during machining, it can be read synchronous to the preprocessing run. For this purpose, the machine or setting data prefix is written with a $ sign:
ID=1 WHENEVER $AA_IM[z] < $SA_OSCILL_REVERSE_POS2[Z]–6 DO $AA_OVR[X]=0
If the data changes during machining, it must be read/written synchronous to the main run. For this purpose, the machine or setting data prefix is written with two $ signs:
ID=1 WHENEVER $AA_IM[z] < $$SA_OSCILL_REVERSE_POS2[Z]–6 DO $AA_OVR[X]=0
Note Writing machine data
When writing an item of machine or setting data, it is important to ensure that the access level which is active when the part program/cycle is executed permits write access and that the data is set to take "IMMEDIATE" effect.
A list of the properties of all system variables appears in:
Parameter Manual, System Variables
See also
Variables (Page 17)
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
19
Flexible NC programming
1.1 Variables

1.1.2 Predefined user variables: Arithmetic parameters (R)

Function
Arithmetic parameters or R parameters are predefined user variables with the designation R, defined as an array of the REAL data type. For historical reasons, notation both with array index, e.g.
R[10], and without array index, e.g. R10, is permitted for R parameters.
Syntax
Meaning
When using synchronized actions, the $ sign must be included as a prefix, e.g.
$R10.
When used as a preprocessing variable:
R<n> R[<expression>]
When used as a main run variable:
$R<n> $R[<expression>]
R: Identifier when used as a preprocessing variable, e.g. in the part program $R: Identifier when used as a main run variable, e.g. in synchronized actions
Type: REAL Range of values: For a non-exponential notation:
± (0.000 0001 ... 9999 9999) Note:
A maximum of 8 decimal places are permitted.
For an exponential notation:
± (1*10
-300
... 1*10
+300
)
Note:
Notation: <Mantisse>EX<exponent> e.g. 8.2EX-3 A maximum of 10 characters are permitted including
sign and decimal point.
<n>:
Number of the R parameter Type: INT Range of values: 0 - MAX_INDEX
Note MAX_INDEX is calculated from the parameterized number of R-parameters: MAX_INDEX = (MD28050 $MN_MM_NUM_R_PARAM) - 1
<expression>: Array index
Any expression can be used as an array index, as long as the result of the expression can be converted to the INT data type (INT, REAL, BOOL, CHAR).
Job Planning
20 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Flexible NC programming
1.1 Variables
Example
Assignments to R-parameters and use of R-parameters in mathematical functions:
Program code Comment
R0=3.5678 ; Assignment in preprocessing
R[1]=-37.3 ; Assignment in preprocessing
R3=-7 ; Assignment in preprocessing
$R4=-0.1EX-5 ; Assignment in main run: R4 = -0.1 * 10^-5
$R[6]=1.874EX8 ; Assignment in main run: R6 = 1.874 * 10^8
R7=SIN(25.3) ; Assignment in preprocessing
R[R2]=R10 ; Indirect addressing using R-parameter
R[(R1+R2)*R3]=5 ; Indirect addressing using math. expression
X=(R1+R2) ; Traverse axis X to the position resulting from the
sum of R1 and R2
Z=SQRT(R1*R1+R2*R2) ; Traverse axis Z to the square root position (R1^2 +
R2^2)
See also
Variables (Page 17)

1.1.3 Predefined user variables: Link variables

Function
Link variables can be used in the context of the "NCU-Link" function for cyclic data exchange between NCUs which are linked on a network. They facilitate data-format-specific access to the link variables memory. The link variables memory is defined both in terms of size and data structure on a system-specific basis by the user/machine manufacturer.
Link variables are system-global user variables which can be read and written in part programs and cycles by all NCUs involved in a link if link communication has been configured. Unlike global user variables (GUD), link variables can also be used in synchronized actions.
On systems without an active NCU link, link variables can be used locally on the controller as additional global user variables alongside global user variables (GUD).
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
21
Flexible NC programming
1.1 Variables
Syntax
$A_DLB[<index>] $A_DLW[<index>] $A_DLD[<index>] $A_DLR[<index>]
Meaning
$A_DLB:
$A_DLW:
$A_DLD:
$A_DLR:
<index>:
Link variable for BYTE data format (1 byte) Data type: UINT Range of values: 0 ... 255 Link variable for WORD data format (2 bytes) Data type: INT Range of values: -32768 ... 32767 Link variable for DWORD data format (4 bytes) Data type: INT Range of values: -2147483648 ... 2147483647 Link variable for REAL data format (8 bytes) Data type: REAL Range of values: ±(2.2*10
-308
… 1.8*10
+308
) Address index in bytes, counted from the start of the link variable memory Data type: INT Range of values: 0 - MAX_INDEX
Note MAX_INDEX is calculated from the parameterized size
of the link variables memory: MAX_INDEX = (MD18700 $MN_MM_SIZEOF_LINKVAR_DATA) - 1
Only indices may be programmed, so that the bytes
addressed in the link variables memory are located on a data format limit Index = n * bytes, where n = 0, 1, 2, etc.
$A_DLB[i]: i = 0, 1, 2, ...
– –
$A_DLW[i]: i = 0, 2, 4, ...
$A_DLD[i]: i = 0, 4, 8, ...
$A_DLR[i]: i = 0, 8, 16, ...
Example
An automation system contains 2 NCUs (NCU1 and NCU2). Machine axis AX2 is connected to NCU1. It is traversed as a link axis of NCU2.
NCU1 writes the actual current value ($VA_CURR) of axis AX2 cyclically to the link variables memory. NCU2 reads the actual current value transmitted via link communication cyclically and displays alarm 61000 if the limit value is exceeded.
Job Planning
22 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Flexible NC programming
1.1 Variables
The data structure in the link variables memory is illustrated in the following figure. The actual current value is transmitted in the REAL value.
/LQNYDULDEOHVPHPRU\ 0'01B00B6,=(2)B/,1.9$5B'$7$ 
,QGH[
%<7( %<7( :25' ':25'

':25' ':25'
5($/
NCU1 NCU1 uses link variable $A_DLR[ 16 ] to write the actual current value of axis AX2 to the link variables memory cyclically in the interpolation cycle in a static synchronized action.
Program code
N111 IDS=1 WHENEVER TRUE DO $A_DLR[16]=$VA_CURR[AX2]
NCU2 NCU2 uses link variable $A_DLR[ 16 ] to read the actual current value of axis AX2 from the link variables memory cyclically in the interpolation cycle in a static synchronized action. If the actual current value is greater than 23.0 A, alarm 61000 is displayed.
Program code
N222 IDS=1 WHEN $A_DLR[16] > 23.0 DO SETAL(61000)
See also
Variables (Page 17)
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
23
Flexible NC programming
1.1 Variables

1.1.4 Definition of user variables (DEF)

Function
The DEF command is used to define user-specific variables and assign values to them. To set them apart from system variables, these are called user-defined variables or user variables (user data).
According to the range of validity (in other words, the range in which the variable is visible) there are the following categories of user variable:
● Local user variables (LUD)
Local user variables (LUD) are variables defined in a part program which is not the main program at the time of execution. They are created when the part program is called and deleted at the end of the part program or when the NC is reset. Local user variables can only be accessed within the part program in which they are defined.
● Program-global user variables (PUD)
Program-global user variables (PUD) are user variables defined in a part program used as the main program. They are created when the part program starts up and deleted at the end of the part program or when the NC is reset. It is possible to access PUD in the main program and in all subprograms of the main program.
Syntax
● Global user variables (GUD)
Global user variables (GUD) are NC or channel-global variables which are defined in a data block (SGUD, MGUD, UGUD, GUD4 to GUD9) and are retained following shutdown and restart. GUD can be accessed in all part programs.
User variables must be defined before they can be used (read/write). The following rules must be observed in this context:
● GUD have to be defined in a definition file, e.g. _N_DEF_DIR/_M_SGUD_DEF.
● PUD and LUD have to be defined in a definition section of the part program.
● The data must be defined in a dedicated block.
● Only one data type may be used for each data definition.
● Several variables of the same data type can be defined for each data definition.
LUD and PUD
DEF <type> <phys_unit> <limit values> <name>[<value_1>, <value_2>, <value_3>]=<init_value>
GUD
DEF <range> <pp_stop> <access_rights> <type> <phys_unit> <limit values> <name>[<value_1>, <value_2>, <value_3>]=<init_value>
Job Planning
24 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Flexible NC programming
1.1 Variables
Meaning
DEF: Command for defining GUD, PUD, LUD user variables <range>:
<PP_stop>:
<access rights>:
<type>:
<phys_unit>:
<limit values>:
Range of validity, only relevant for GUD:
NCK: NC-global user variable CHAN: Channel-global user variable
Preprocessing stop, only relevant for GUD (optional)
SYNR: Preprocessing stop when reading SYNW: Preprocessing stop when writing SYNRW: Preprocessing stop when reading/writing
Protection level for reading/writing GUD via part program or OPI (optional)
APRP <protection level>: Read: Part program APWP <protection level>: Write: Part program APRB <protection level>: Read: OPI APWB <protection level>: Write: OPI
<protection level>: Range of values: 0 ... 7 See "Attribute: Access rights (APR, APW, APRP, APWP, APRB,
APWB) (Page 39)" Data type:
INT: Integer with sign REAL: Real number (LONG REAL to IEEE) BOOL: Truth value TRUE (1)/FALSE (0) CHAR: ASCII character STRING[<MaxLength>]: Character string of a defined length AXIS: Axis/spindle identifier FRAME: Geometric data for a static coordinate
transformation See "Data types (Page 52)" Physical unit (optional)
PHU <unit>: Physical unit
See "Attribute: Physical unit (PHU) (Page 37)" Lower/upp
LLI <limit value>: Lower limit value (lower limit) ULI <limit value>: Upper limit value (upper limit)
er limit value (optional)
See "Attribute: Limit values (LLI, ULI) (Page 35)"
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
25
Flexible NC programming
1.1 Variables
<name>
: Name of variable
Note
Maximum 31 characters The first two characters must be a letter and/or an underscore.The $ sign is reserved for system variables and must not be
used.
[<value_1>, <value_2>,
<value_3>]
:
Specification of array sizes for 1- to max. 3-dimensional array variables (optional)
For the Initialization of array variables see "Definition and initialization of array
<init_value>: Initialization value (optional)
variables (DEF, SET, REP) (Page 45)"
See "Attribute: Initialization value (Page 32)" For the Initializa
initialization of array
tion of array variables see "Definition and
variables (DEF, SET, REP) (Page 45)"
Examples
Example 1: Definition of user variables in the data block for machine manufacturers
Program code Comment
%_N_MGUD_DEF ; GUD block: Machine manufacturer
$PATH=/_N_DEF_DIR
DEF CHAN REAL PHU 24 LLI 0 ULI 10 STROM_1, STROM_2
;Description
;Definition of two GUD items: STROM_1, STROM_2
;Range of validity: Throughout the channel
;Data type: REAL
PP stop: Not programmed => default value = no PP stop
;Physical unit: 24 = [A]
;Limit values: Low = 0.0, high = 10.0
;Access rights: Not programmed => default value = 7 = key-operated switch position 0
;Initialization value: Not programmed => default value = 0.0
DEF NCK REAL PHU 13 LLI 10 APWP 3 APRP 3 APWB 0 APRB 2 ZEIT_1=12, ZEIT_2=45
;Description
;Definition of two GUD items: ZEIT_1, ZEIT_2
;Range of validity: Throughout the NCK
;Data type: REAL
PP stop: Not programmed => default value = no PP stop
;Physical unit: 13 = [s]
;Limit values: low = 10.0, high = not programmed => upper definition range limit
Job Planning
26 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Flexible NC programming
1.1 Variables
Program code Comment
;Access rights:
;Part program: Write/read = 3 = end user
;OPI: Write = 0 = Siemens, read = 3 = end user
;Initialization value: ZEIT_1 = 12.0, ZEIT_2 = 45.0
DEF NCK APWP 3 APRP 3 APWB 0 APRB 3 STRING[5] GUD5_NAME = "COUNTER"
;Description
;Definition of one GUD item: GUD5_NAME
;Range of validity: Throughout the NCK
;Data type: STRING, max. 5 characters
PP stop: Not programmed => default value = no PP stop
;Physical unit: Not programmed => default value = 0 = no phys. unit
;Limit values: Not programmed => definition range limits: low = 0, high = 255
;Access rights:
;Part program: Write/read = 3 = end user
;OPI: Write = 0 = Siemens, read = 3 = end user
;Initialization value: "COUNTER"
M30
Example 2: Global program and local user variables (PUD/LUD)
Program code Comment
PROC MAIN ;Main program
DEF INT VAR1 ;PUD definition
...
SUB2 ;Subprogram call
...
M30
Program code Comment
PROC SUB2 ;Subprogram SUB2
DEF INT VAR2 ;LUD DEFINITION
...
IF (VAR1==1) ;Read PUD
VAR1=VAR1+1 ;Read & write PUD
VAR2=1 ;Write LUD
ENDIF
SUB3 ;subprogram call
...
M17
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
27
Flexible NC programming
1.1 Variables
Program code Comment
PROC SUB3 ;Subprogram SUB3
...
IF (VAR1==1) ;Read PUD
VAR1=VAR1+1 ;Read & write PUD
VAR2=1 ;Error: LUD from SUB2 not known
ENDIF
...
M17
Example 3: Definition and use of user variables of data type AXIS
Program code Comment
DEF AXIS ABSCISSA ;1st geometry axis
DEF AXIS SPINDLE ;Spindle
...
IF ISAXIS(1) == FALSE GOTOF CONTINUE
ABSCISSA = $P_AXN1
CONTINUE:
...
SPINDLE=(S1) ;1st spindle
OVRA[SPINDLE]=80 ;Spindle override = 80%
SPINDLE=(S3) ;3rd spindle
Supplementary conditions
Global user variables (GUD)
In the context of the definition of global user variables (GUD), the following machine data has to be taken into account:
No. Identifier: $MN_ Meaning 11140 GUD_AREA_ SAVE_TAB Additional save for GUD blocks 18118 1) MM_NUM_GUD_MODULES Number of GUD files in the active file system 18120 1) MM_NUM_GUD_NAMES_NCK Number of global GUD names 18130 1) MM_NUM_GUD_NAMES_CHAN Number of channel-spec. GUD names 18140 1) MM_NUM_GUD_NAMES_AXIS Number of axis-spec. GUD names 18150 1) MM_GUD_VALUES_MEM Memory location for global GUD values 18660 1) MM_NUM_SYNACT_GUD_REAL Number of configurable GUD of the REAL data type 18661 1) MM_NUM_SYNACT_GUD_INT Number of configurable GUD of the INT data type 18662 1) MM_NUM_SYNACT_GUD_BOOL Number of configurable GUD of the BOOL data type 18663 1) MM_NUM_SYNACT_GUD_AXIS Number of configurable GUD of the AXIS data type 18664 1) MM_NUM_SYNACT_GUD_CHAR Number of configurable GUD of the CHAR data type 18665 1) MM_NUM_SYNACT_GUD_STRING Number of configurable GUD of the STRING data type
1)
For SINUMERIK 828D, MD can only be read!
Job Planning
28 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Flexible NC programming
1.1 Variables
Program-global user variables (PUD)
Note Visibility of program-global user variables (PUD)
Program-global user variables (PUD) defined in the main program will only be visible in subprograms if the following machine data is set:
MD11120 $MN_LUD_EXTENDED_SCOPE = 1
If MD11120 = 0 the program-global user variables defined in the main program will only be visible in the main program.
Cross-channel use of an NCK-global user variable of the AXIS data type
An NCK-global user variable of the
AXIS data type initialized during definition in the data
block with an axis identifier can then only be used in other NC channels if the axis has the same channel axis number in these channels.
If this is not the case, the variable has to be loaded at the start of the part program or, as in the following example, the AXNAME(...) function has to be used.
Program code Comment
DEF NCK STRING[5] ACHSE="X" ;Definition in the data block
...
N100 AX[AXNAME(ACHSE)]=111 G00 ;Use in the part program

1.1.5 Redefinition of system variables, user variables, and NC language commands (REDEF)

Function
The REDEF command can be used to change the attributes of system variables, user variables and NC language commands. A fundamental condition of redefinition is that it has to post-date the corresponding definition.
Multiple attributes cannot be changed simultaneously during redefinition. A separate statement has to be programmed for each attribute to be changed.
If two or more concurrent attribute changes are programmed, the last change is always active.
Job Planning Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
REDEF
29
Flexible NC programming
1.1 Variables
Resetting attribute values
Syntax
The attributes for access rights and initialization time change with default values by reprogramming
REDEF, followed by the name of the variable or the NC
REDEF can be reset to their
language command:
● Access rights: Protection level 7
● Initialization time: No initialization or retention of the current value
Redefinable attributes
See "Overview of definable and redefinable attributes (Page 44)"
Local u
ser va
riables (PUD/LUD)
Redefinitions are not permitted for local user variables (PUD/LUD).
REDEF <name> <PP_stop>
REDEF <name> <phys_unit>
REDEF <name> <limit_values>
REDEF <name> <access_rights>
REDEF <name> <init_time>
REDEF <name> <init_time> <init_value>
Meaning
REDEF <name>
REDEF: Command for redefinition of a certain attribute or to reset the
"Access rights" and/or "Initialization time" attributes of system variables, user variables and NC language commands
<name>: Name of an already defined variable or an NC language
command
<PP stop>:
<phys_unit>:
Preprocessing stop
SYNR: Preprocessing stop when reading SYNW: Preprocessing stop when writing SYNRW: Preprocessing stop when reading/writing
Physical unit
PHU <unit>: Physical unit
See "Attribute: Physical unit (PHU) (Page 37)" Note
Cannot be re
defined for:
System variables Global user data (GUD) of the data types:
FRAME
BOOL, AXIS, STRING,
Job Planning
30 Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Loading...
+ 818 hidden pages