Siemens SINUMERIK 840D sl Programming Manual

Text of the manual

SINUMERIK 840D sl

NC programming Programming Manual Valid for Control system SINUMERIK 840D sl / 840DE sl CNC software version 4.93 12/2019 6FC5398-2EP40-0BA0 Preface Fundamental safety instructions 1 Fundamentals 2 Work preparation 3 Tables 4 Appendix A

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 Digital Industries Postfach 48 48 90026 NÜRNBERG GERMANY Document order number: 6FC5398-2EP40-0BA0 Ⓟ 12/2019 Subject to change Copyright © Siemens AG 2019. All rights reserved

The SINUMERIK documentation is organized into the following categories:

● General documentation/catalogs ● User documentation ● Manufacturer/service documentation Additional information You can find information on the following topics at the following address (https:// support.industry.siemens.com/cs/de/en/view/108464614): ● Ordering documentation/overview of documentation ● Additional links to download documents ● Using documentation online (find and search in manuals/information) If you have any questions regarding the technical documentation (e.g. suggestions, corrections), please send an e-mail to the following address (mailto:[email protected]). mySupport/Documentation At the following address (https://support.industry.siemens.com/My/ww/en/documentation), you can find information on how to create your own individual documentation based on Siemens' content, and adapt it for your own machine documentation. Training At the following address (http://www.siemens.com/sitrain), you can find information about SITRAIN (Siemens training on products, systems and solutions for automation and drives). FAQs You can find Frequently Asked Questions in the Service&Support pages under Product Support (https://support.industry.siemens.com/cs/de/en/ps/faq). SINUMERIK You can find information about SINUMERIK at the following address (http://www.siemens.com/ sinumerik). NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 3

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 of the standard scope. 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. Furthermore, for the sake of clarity, this documentation does not contain all detailed information about all product types and cannot cover every conceivable case of installation, operation or maintenance. Note regarding the General Data Protection Regulation Siemens observes standard data protection principles, in particular the principle of privacy by design. That means that this product does not process / store any personal data, only technical functional data (e.g. time stamps). If a user links this data with other data (e.g. a shift schedule) or stores personal data on the same storage medium (e.g. hard drive) and thus establishes a link to a person or persons, then the user is responsible for ensuring compliance with the relevant data protection regulations. Technical Support Country-specific telephone numbers for technical support are provided on the Internet at the following address (https://support.industry.siemens.com/sc/ww/en/sc/2090) in the "Contact" area. If you have any technical questions, use the online form in the "Support Request" area. Preface NC programming 4 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Information about the structure and contents of the documentation

The documentation for NC programming is divided into two main chapters: 1. Fundamentals The Chapter "Fundamentals" 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. Work preparation The Chapter "Work preparation" 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 the programming of complicated operations easier for technologists. Preface NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 5

Table of contents

Preface .........................................................................................................................................................3 1 Fundamental safety instructions.................................................................................................................23 1.1 General safety instructions.....................................................................................................23 1.2 Warranty and liability for application examples......................................................................24 1.3 Industrial security ...................................................................................................................25 2 Fundamentals.............................................................................................................................................27 2.1 Fundamental Geometrical Principles .....................................................................................27 2.1.1 Workpiece positions...............................................................................................................27 2.1.1.1 Reference system of position specifications ..........................................................................27 2.1.1.2 Cartesian coordinates ............................................................................................................27 2.1.1.3 Polar coordinates ...................................................................................................................29 2.1.1.4 Absolute dimensions..............................................................................................................30 2.1.1.5 Incremental dimension...........................................................................................................32 2.1.2 Working planes ......................................................................................................................33 2.1.3 Zero points and reference points ...........................................................................................34 2.1.4 Coordinate systems ...............................................................................................................36 2.1.4.1 Machine coordinate system (MCS)........................................................................................36 2.1.4.2 Basic coordinate system (BCS) .............................................................................................38 2.1.4.3 Basic zero system (BZS)........................................................................................................39 2.1.4.4 Settable zero system (SZS) ...................................................................................................40 2.1.4.5 Workpiece coordinate system (WCS) ....................................................................................41 2.1.4.6 What is the relationship between the various coordinate systems? ......................................41 2.2 Fundamental Principles of NC Programming.........................................................................42 2.2.1 Name of an NC program........................................................................................................42 2.2.2 Structure and contents of an NC program .............................................................................43 2.2.2.1 Blocks and block components................................................................................................43 2.2.2.2 Block rules..............................................................................................................................46 2.2.2.3 Value assignments.................................................................................................................47 2.2.2.4 Comments..............................................................................................................................47 2.2.2.5 Skipping blocks ......................................................................................................................48 2.3 Creating an NC program........................................................................................................50 2.3.1 Basic procedure .....................................................................................................................50 2.3.2 Available characters...............................................................................................................51 2.3.3 Program header .....................................................................................................................52 2.3.4 Program examples.................................................................................................................53 2.3.4.1 Example 1: First programming steps .....................................................................................53 2.3.4.2 Example 2: NC program for turning .......................................................................................54 2.3.4.3 Example 3: NC program for milling ........................................................................................56 2.4 Tool change ...........................................................................................................................59 2.4.1 Tool change with active tool management.............................................................................60 2.4.1.1 Tool change with active tool management with the function T=location ................................60 2.4.1.2 Tool change with active tool management with M6 ...............................................................62 NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 7

Tool change with deactivated tool management....................................................................64

2.4.2.1 Tool change with deactivated tool management with T number............................................64 2.4.2.2 Tool change with deactivated tool management with M6 ......................................................64 2.4.3 Behavior with faulty T programming.......................................................................................66 2.5 Tool offsets.............................................................................................................................67 2.5.1 Programmed contour and tool path........................................................................................67 2.5.2 Tool length compensation......................................................................................................67 2.5.3 Tool radius compensation......................................................................................................68 2.5.4 Tool compensation memory...................................................................................................69 2.5.5 Tool types...............................................................................................................................70 2.5.5.1 Tool type number and tool groups .........................................................................................70 2.5.5.2 Milling tools ............................................................................................................................71 2.5.5.3 Drills .......................................................................................................................................73 2.5.5.4 Grinding tools.........................................................................................................................74 2.5.5.5 Turning tools ..........................................................................................................................76 2.5.5.6 Special tools...........................................................................................................................78 2.5.6 Activating / deactivating tool offsets (D, D0): .........................................................................80 2.5.7 Suppressing tool offsets (SUPD) ...........................................................................................82 2.5.8 Programmable tool offset (TOFFL, TOFF, TOFFR, TOFFLR):..............................................84 2.6 Spindle motion .......................................................................................................................89 2.6.1 Spindle speed (S), spindle direction of rotation (M3, M4, M5) ...............................................89 2.6.2 Tool cutting speed (SVC).......................................................................................................92 2.6.3 Constant cutting rate (G96/G961/G962, G97/G971/G972, G973, LIMS, SCC).....................98 2.6.4 Switching constant grinding wheel peripheral speed (GWPSON, GWPSOF) on/off: ..........103 2.6.5 Programmable spindle speed limitation (G25, G26) ............................................................104 2.7 Feed control .........................................................................................................................105 2.7.1 Feedrate (G93, G94, G95, F, FGROUP, FL, FGREF).........................................................105 2.7.2 Traverse positioning axes (POS, POSA, POSP, FA, WAITP, WAITMC).............................113 2.7.3 Position-controlled spindle mode (SPCON, SPCOF)...........................................................116 2.7.4 Positioning spindles (SPOS, SPOSA, M19, M70, WAITS) ..................................................117 2.7.5 Feedrate for positioning axes / spindles (FA, FPR, FPRAON, FPRAOF)............................122 2.7.6 Programmable feedrate override (OVR, OVRRAP, OVRA).................................................125 2.7.7 Programmable acceleration compensation (ACC)...............................................................125 2.7.8 Feedrate with handwheel override (FD, FDA)......................................................................127 2.7.9 Feedrate optimization for curved path sections (CFTCP, CFC, CFIN) ................................131 2.7.10 Several feedrate values in one block (F, ST, SR, FMA, STA, SRA)....................................133 2.7.11 Non-modal feedrate (FB) .....................................................................................................136 2.7.12 Tooth feedrate (G95 FZ) ......................................................................................................137 2.8 Geometry settings................................................................................................................143 2.8.1 Settable zero offset (G54 to G57, G505 to G599, G53, G500, SUPA, G153) .....................143 2.8.2 Settable work offset (G54 to G57, G505 to G599, G53, G500, SUPA, G153): Further information ...........................................................................................................................144 2.8.3 Selection of the working plane (G17/G18/G19) ...................................................................145 2.8.4 Dimensions ..........................................................................................................................148 2.8.4.1 Absolute dimensions (G90, AC)...........................................................................................149 2.8.4.2 Incremental dimensions (G91, IC) .......................................................................................151 2.8.4.3 Absolute and incremental dimensions for turning and milling (G90/G91)............................155 2.8.4.4 Absolute dimensions for rotary axes (DC, ACP, ACN) ........................................................156 2.8.4.5 Metric/inch dimension system (G70/G71, G700/G710) .......................................................158 Table of contents NC programming 8 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Channel-specific diameter/radius programming (DIAMON, DIAM90, DIAMOF,

DIAMCYCOF) ......................................................................................................................162 2.8.4.7 Axis-specific diameter/radius programming (DIAMONA, DIAM90A, DIAMOFA, DIACYCOFA, DIAMCHANA, DIAMCHAN, DAC, DIC, RAC, RIC).......................................164 2.8.5 Position of workpiece for turning..........................................................................................168 2.9 Motion commands................................................................................................................170 2.9.1 General information about the travel commands .................................................................170 2.9.2 Travel commands with Cartesian coordinates (G0, G1, G2, G3, X..., Y..., Z...)...................171 2.9.3 Travel commands with polar coordinates.............................................................................173 2.9.3.1 Reference point of the polar coordinates (G110, G111, G112) ...........................................173 2.9.3.2 Travel commands with polar coordinates (G0, G1, G2, G3, AP, RP) ..................................174 2.9.4 Rapid traverse movements ..................................................................................................178 2.9.4.1 Activating rapid traverse (G0) ..............................................................................................178 2.9.4.2 Switch on/off linear interpolation for rapid traverse movements (RTLION, RTLIOF)...........180 2.9.4.3 Adapt tolerances for rapid traverse motion (STOLF, CTOLG0, OTOLG0) ..........................182 2.9.5 Linear interpolation (G1) ......................................................................................................186 2.9.6 Circular interpolation ............................................................................................................188 2.9.6.1 Overview ..............................................................................................................................188 2.9.6.2 Circular interpolation with center point and end point (G2/G3, X... Y... Z..., I... J... K...)......189 2.9.6.3 Circular interpolation with radius and end point (G2/G3, X... Y... Z..., CR)..........................191 2.9.6.4 Circular interpolation with opening angle and end point / center point (G2/G3, X... Y... Z... / I... J... K..., AR).............................................................................................................193 2.9.6.5 Circular interpolation with polar coordinates (G2/G3, AP, RP) ............................................195 2.9.6.6 Circular interpolation with intermediate point and end point (CIP, X... Y... Z..., I1... J1... K1...).....................................................................................................................................197 2.9.6.7 Circular interpolation with tangential transition (CT, X... Y... Z...) ........................................200 2.9.7 Helical interpolation (G2/G3, TURN)....................................................................................204 2.9.8 Involute interpolation (INVCW, INVCCW)............................................................................206 2.9.9 Contour definitions ...............................................................................................................211 2.9.9.1 Contour definition programming...........................................................................................211 2.9.9.2 Contour definitions: One straight line...................................................................................212 2.9.9.3 Contour definitions: Two straight lines .................................................................................214 2.9.9.4 Contour definitions: Three straight lines...............................................................................217 2.9.9.5 Contour definitions: End point programming with angle.......................................................220 2.9.10 Thread cutting ......................................................................................................................221 2.9.10.1 Thread cutting with constant lead (G33, SF)........................................................................221 2.9.10.2 Thread cutting with increasing or decreasing lead (G34, G35)............................................227 2.9.10.3 Programmed run-in and run-out path for G33, G34 and G35 (DITS, DITE) ........................228 2.9.10.4 Fast retraction during thread cutting (LFON, LFOF, DILF, ALF, LFTXT, LFWP, LFPOS, POLF, POLFMASK, POLFMLIN).........................................................................................231 2.9.10.5 Convex thread (G335, G336)...............................................................................................234 2.9.11 Tapping without compensating chuck..................................................................................240 2.9.11.1 Tapping without compensating chuck and retraction motion (G331, G332) ........................240 2.9.11.2 Example: Tapping with G331 / G332 ...................................................................................241 2.9.11.3 Example: Output the programmed drilling speed in the current gear stage.........................241 2.9.11.4 Example: Application of the second gear-stage data block .................................................242 2.9.11.5 Example: Speed is not programmed, the gearbox stage is monitored ................................242 2.9.11.6 Example: Gearbox stage cannot be changed, gearbox stage monitoring ...........................243 2.9.11.7 Example: Programming without SPOS ................................................................................243 2.9.12 Tapping with compensating chuck.......................................................................................244 2.9.12.1 Tapping with compensating check and retraction motion (G63)..........................................244 2.9.13 Chamfer, rounding (CHF, CHR, RND, RNDM, FRC, FRCM) ..............................................245 Table of contents NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 9

Tool radius compensation....................................................................................................251

2.10.1 Tool radius compensation (G40, G41, G42, OFFN) ............................................................251 2.10.2 Approaching and leaving contour (NORM, KONT, KONTC, KONTT) .................................260 2.10.3 Compensation at the outside corners (G450, G451, DISC).................................................268 2.10.4 Smooth approach and retraction..........................................................................................271 2.10.4.1 Approach and retraction (G140 to G143, G147, G148, G247, G248, G347, G348, G340, G341, DISR, DISCL, DISRP, FAD, PM, PR) .......................................................................271 2.10.4.2 Approach and retraction with extended retraction strategies (G460, G461, G462) .............282 2.10.5 Activation/deactivation of collision detection ("bottleneck detection") (CDON, CDOF, CDOF2)................................................................................................................................285 2.10.6 2 1/2 D tool offset (CUT2D, CUT2DD, CUT2DF, CUT2DFD) ..............................................287 2.10.7 Keep tool radius compensation constant (CUTCONON, CUTCONOF)...............................289 2.10.8 Tools with a relevant cutting edge position ..........................................................................291 2.11 Path action ...........................................................................................................................293 2.11.1 Exact stop (G60, G9, G601, G602, G603)...........................................................................293 2.11.2 Continuous-path mode (G64, G641, G642, G643, G644, G645, ADIS, ADISPOS) ............295 2.12 Coordinate transformations (frames) ...................................................................................305 2.12.1 Frames .................................................................................................................................305 2.12.2 Frame instructions................................................................................................................307 2.12.3 Programmable work offset (TRANS, ATRANS)...................................................................310 2.12.4 Programmable work offset (G58, G59) ................................................................................314 2.12.5 Programmable rotation (ROT, AROT, RPL).........................................................................316 2.12.6 Programmable frame rotations with solid angles (ROTS, AROTS, CROTS).......................322 2.12.7 Programmable scaling factor (SCALE, ASCALE)................................................................325 2.12.8 Programmable mirroring (MIRROR, AMIRROR) .................................................................328 2.12.9 Frame generation according to tool orientation (TOFRAME, TOROT, PAROT):.................333 2.12.10 Deselect frame (G53, G153, SUPA, G500) .........................................................................335 2.12.11 Programming: Deselecting overlays axis-specifically (CORROF) .......................................336 2.12.12 Deselecting additive work offsets (DRFROF) ......................................................................339 2.12.13 Grinding-specific work offsets (GFRAME0, GFRAME1 ... GFRAME100)............................340 2.13 Auxiliary function outputs .....................................................................................................342 2.13.1 M functions...........................................................................................................................344 2.14 Supplementary commands ..................................................................................................348 2.14.1 Output messages (MSG) .....................................................................................................348 2.14.2 Writing string in OPI variable (WRTPR)...............................................................................349 2.14.3 Working area limitation.........................................................................................................351 2.14.3.1 Working area limitation in BCS (G25/G26, WALIMON, WALIMOF) ....................................351 2.14.3.2 Working area limitation in WCS/SZS (WALCS0 ... WALCS10) ...........................................354 2.14.4 Reference point approach (G74)..........................................................................................357 2.14.5 Approaching a fixed point (G75) ..........................................................................................358 2.14.6 Travel to fixed stop (FXS, FXST, FXSW).............................................................................362 2.14.7 Dwell time (G4) ....................................................................................................................367 2.14.8 Internal preprocessing stop..................................................................................................369 2.15 Other information .................................................................................................................370 2.15.1 Axes .....................................................................................................................................370 2.15.1.1 Main axes/Geometry axes ...................................................................................................370 2.15.1.2 Special axes.........................................................................................................................372 2.15.1.3 Main spindle, master spindle................................................................................................372 2.15.1.4 Machine axes.......................................................................................................................372 Table of contents NC programming 10 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Channel axes .......................................................................................................................373

2.15.1.6 Path axes .............................................................................................................................373 2.15.1.7 Positioning axes...................................................................................................................373 2.15.1.8 Synchronized axes...............................................................................................................374 2.15.1.9 Command axes....................................................................................................................375 2.15.1.10 PLC axes..............................................................................................................................375 2.15.1.11 Link axes..............................................................................................................................375 2.15.1.12 Lead link axes ......................................................................................................................377 2.15.2 From travel command to machine movement......................................................................379 2.15.3 Path calculation....................................................................................................................379 2.15.4 Addresses ............................................................................................................................380 2.15.5 Names..................................................................................................................................382 2.15.6 Constants.............................................................................................................................384 2.15.7 Operators and arithmetic functions .....................................................................................385 3 Work preparation......................................................................................................................................389 3.1 Flexible NC programming ....................................................................................................389 3.1.1 Variables ..............................................................................................................................389 3.1.1.1 System data .........................................................................................................................390 3.1.1.2 Predefined user variables: Channel-specific arithmetic parameters (R)..............................392 3.1.1.3 Predefined user variables: Global arithmetic parameters (RG) ...........................................393 3.1.1.4 Predefined user variables: Link variables ............................................................................395 3.1.1.5 Definition of user variables (DEF) ........................................................................................397 3.1.1.6 Redefinition of system data, user data, and NC commands (REDEF) ................................402 3.1.1.7 Attribute: Initialization value .................................................................................................406 3.1.1.8 Attribute: Limit values (LLI, ULI)...........................................................................................408 3.1.1.9 Attribute: Physical unit (PHU)...............................................................................................410 3.1.1.10 Attribute: Access rights (APR, APW, APRP, APWP, APRB, APWB)...................................412 3.1.1.11 Overview of definable and redefinable attributes.................................................................416 3.1.1.12 Definition and initialization of array variables (DEF, SET, REP)..........................................417 3.1.1.13 Data types............................................................................................................................423 3.1.1.14 Variable minimum, maximum and range (MINVAL, MAXVAL and BOUND) .......................424 3.1.1.15 Check availability of a variable (ISVAR)...............................................................................425 3.1.1.16 Reading attribute values / data type (GETVARPHU, GETVARAP, GETVARLIM, GETVARDIM, GETVARDFT, GETVARTYP).......................................................................427 3.1.1.17 Possible type conversions....................................................................................................432 3.1.2 Indirect programming ...........................................................................................................433 3.1.2.1 Indirectly programming addresses.......................................................................................433 3.1.2.2 Indirectly programming G commands ..................................................................................435 3.1.2.3 Indirectly programming position attributes (GP)...................................................................436 3.1.2.4 Indirectly programming part program lines (EXECSTRING)................................................439 3.1.3 Instructions...........................................................................................................................440 3.1.3.1 Arithmetic functions..............................................................................................................440 3.1.3.2 Comparison and logic operations.........................................................................................442 3.1.3.3 Priority of the operations ......................................................................................................444 3.1.3.4 Precision correction on comparison errors (TRUNC)...........................................................444 3.1.3.5 Roundup (ROUNDUP).........................................................................................................446 3.1.4 String operations..................................................................................................................447 3.1.4.1 Type conversion to STRING (AXSTRING) ..........................................................................448 3.1.4.2 Type conversion from STRING (NUMBER, ISNUMBER, AXNAME)...................................448 3.1.4.3 Concatenation of strings (<<)...............................................................................................449 3.1.4.4 Conversion to lower/upper case letters (TOLOWER, TOUPPER).......................................450 Table of contents NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 11

Determine length of string (STRLEN) ..................................................................................451

3.1.4.6 Search for character/string in the string (INDEX, RINDEX, MINDEX, MATCH) ..................452 3.1.4.7 Selection of a substring (SUBSTR)......................................................................................453 3.1.4.8 Reading and writing of individual characters........................................................................454 3.1.4.9 Formatting a string (SPRINT)...............................................................................................455 3.1.5 Program jumps and branches..............................................................................................463 3.1.5.1 Return jump to the start of the program (GOTOS)...............................................................463 3.1.5.2 Program jumps to jump markers (GOTOB, GOTOF, GOTO, GOTOC)...............................464 3.1.5.3 Program branch (CASE ... OF ... DEFAULT ...)...................................................................467 3.1.6 Repeat program section (REPEAT, REPEATB, ENDLABEL, P).........................................468 3.1.7 Check structures ..................................................................................................................474 3.1.7.1 Conditional statement and branch (IF, ELSE, ENDIF).........................................................476 3.1.7.2 Continuous program loop (LOOP, ENDLOOP)....................................................................477 3.1.7.3 Count loop (FOR ... TO ..., ENDFOR)..................................................................................478 3.1.7.4 Program loop with condition at start of loop (WHILE, ENDWHILE) .....................................479 3.1.7.5 Program loop with condition at the end of the loop (REPEAT, UNTIL)................................480 3.1.7.6 Program example with nested check structures ..................................................................481 3.1.8 Cross-channel program coordination (INIT, START, WAITM, WAITMC, WAITE, SETM, CLEARM).............................................................................................................................481 3.1.9 Macro technique (DEFINE ... AS) ........................................................................................487 3.2 Subprogram technique.........................................................................................................490 3.2.1 General information..............................................................................................................490 3.2.1.1 Subprogram .........................................................................................................................490 3.2.1.2 Subprogram names..............................................................................................................491 3.2.1.3 Nesting of subprograms.......................................................................................................492 3.2.1.4 Search path..........................................................................................................................493 3.2.1.5 Formal and actual parameters .............................................................................................493 3.2.1.6 Parameter transfer ...............................................................................................................494 3.2.2 Definition of a subprogram...................................................................................................496 3.2.2.1 Subprogram without parameter transfer ..............................................................................496 3.2.2.2 Subprogram with call-by-value parameter transfer (PROC) ................................................496 3.2.2.3 Subprogram with call-by-reference parameter transfer (PROC, VAR) ................................498 3.2.2.4 Save modal G functions (SAVE)..........................................................................................500 3.2.2.5 Suppress single block execution (SBLOF, SBLON) ............................................................501 3.2.2.6 Suppress current block display (DISPLOF, DISPLON, ACTBLOCNO) ...............................506 3.2.2.7 Identifying subprograms with preparation (PREPRO)..........................................................509 3.2.2.8 Subprogram return M17.......................................................................................................510 3.2.2.9 RET subprogram return .......................................................................................................511 3.2.2.10 Parameterizable subprogram return jump (RET ...).............................................................512 3.2.2.11 Parameterizable subprogram return jump (RETB ...)...........................................................518 3.2.3 Subprogram call...................................................................................................................522 3.2.3.1 Subprogram call without parameter transfer........................................................................522 3.2.3.2 Subprogram call with parameter transfer (EXTERN)...........................................................524 3.2.3.3 Number of program repetitions (P).......................................................................................526 3.2.3.4 Modal subprogram call (MCALL) .........................................................................................527 3.2.3.5 Indirect subprogram call (CALL) ..........................................................................................529 3.2.3.6 Indirect subprogram call with specification of the calling program part (CALL BLOCK ... TO ...)...................................................................................................................................530 3.2.3.7 Indirect call of a program programmed in ISO language (ISOCALL)...................................531 3.2.3.8 Call subprogram with path specification and parameters (PCALL)......................................532 3.2.3.9 Extend search path for subprogram calls (CALLPATH).......................................................533 3.2.3.10 Execute external subroutine (EXTCALL) .............................................................................534 Table of contents NC programming 12 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Interrupt routine (ASUB).......................................................................................................539

3.3.1 Function of an interrupt routine ............................................................................................539 3.3.2 Creating an interrupt routine ................................................................................................540 3.3.3 Assign and start interrupt routine (SETINT, PRIO, BLSYNC)..............................................540 3.3.4 Deactivating/reactivating the assignment of an interrupt routine (DISABLE, ENABLE).......543 3.3.5 Delete assignment of interrupt routine (CLRINT).................................................................543 3.3.6 Fast retraction from the contour (SETINT LIFTFAST, ALF).................................................544 3.3.7 Traversing direction for fast retraction from the contour .....................................................546 3.3.8 Motion sequence for interrupt routines.................................................................................549 3.4 File and Program Management............................................................................................551 3.4.1 Program memory .................................................................................................................551 3.4.1.1 Program memory in the NCK...............................................................................................551 3.4.1.2 External program memory....................................................................................................553 3.4.1.3 Addressing program memory files .......................................................................................554 3.4.1.4 Search path for subprogram call..........................................................................................559 3.4.1.5 Interrogating the path and file name ....................................................................................560 3.4.2 Working memory (CHANDATA, COMPLETE, INITIAL).......................................................561 3.5 File handling.........................................................................................................................565 3.5.1 Write file (WRITE) ................................................................................................................565 3.5.2 Delete file (DELETE)............................................................................................................568 3.5.3 Read lines in the file (READ) ...............................................................................................569 3.5.4 Check for presence of file (ISFILE)......................................................................................571 3.5.5 Read out file information (FILEDATE, FILETIME, FILESIZE, FILESTAT, FILEINFO).........572 3.6 Protection zones ..................................................................................................................575 3.6.1 Defining protection zones (CPROTDEF, NPROTDEF)........................................................575 3.6.2 Activating/deactivating protection zones (CPROT, NPROT) ...............................................578 3.6.3 Checking for protection zone violation, working area limitation and software limit switches (CALCPOSI)..........................................................................................................582 3.7 Special motion commands...................................................................................................592 3.7.1 Approaching coded positions (CAC, CIC, CDC, CACP, CACN)..........................................592 3.7.2 Spline interpolation (ASPLINE, BSPLINE, CSPLINE, BAUTO, BNAT, BTAN, EAUTO, ENAT, ETAN, PW, SD, PL)..................................................................................................592 3.7.3 Spline group (SPLINEPATH) ...............................................................................................603 3.7.4 Activating/deactivating NC block compression (COMPON, COMPCURV, COMPCAD, COMPSURF, COMPOF)......................................................................................................604 3.7.5 Polynomial interpolation (POLY, POLYPATH, PO, PL) .......................................................605 3.7.6 Settable path reference (SPATH, UPATH) ..........................................................................610 3.7.7 Channel-specific measuring (MEAS, MEAW)......................................................................612 3.7.8 Axis-specific measurement (MEASA, MEAWA, MEAC) (option).........................................615 3.7.9 Special functions for OEM users (OMA1 ... OMA5, OEMIPO1, OEMIPO2, G810 ... G829)....623 3.7.10 Feedrate reduction with corner deceleration (FENDNORM, G62, G621) ...........................624 3.7.11 Programmable end of motion criteria (FINEA, COARSEA, IPOENDA, IPOBRKA, ADISPOSA)..........................................................................................................................625 3.8 Coordinate transformations (frames) ...................................................................................628 3.8.1 Coordinate transformation via frame variables ....................................................................628 3.8.1.1 Predefined frame variable ($P_CHBFRAME, $P_IFRAME, $P_PFRAME, $P_ACTFRAME)..................................................................................................................630 3.8.2 Value assignments to frames...............................................................................................633 3.8.2.1 Assigning direct values (axis value, angle, scale)................................................................633 Table of contents NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 13

Reading and changing frame components (TR, FI, RT, SC, MI) .........................................635

3.8.2.3 Calculating with frames........................................................................................................636 3.8.2.4 Definition of frame variables (DEF FRAME) ........................................................................638 3.8.3 Coarse and fine offsets (CTRANS, CFINE) .........................................................................639 3.8.4 External zero offset ($AA_ETRANS)....................................................................................640 3.8.5 Set actual value with loss of the referencing status (PRESETON)......................................641 3.8.6 Set actual value without loss of the referencing status (PRESETONS)...............................643 3.8.7 Frame calculation from three measuring points in space (MEAFRAME).............................644 3.8.8 Global frames.......................................................................................................................647 3.8.8.1 Channel-specific frames ($P_CHBFR, $P_UBFR)...............................................................648 3.8.8.2 Frames active in the channel ...............................................................................................649 3.9 Transformations ...................................................................................................................654 3.9.1 General programming of transformation types.....................................................................654 3.9.1.1 Orientation movements for transformations.........................................................................656 3.9.1.2 Overview of orientation transformation TRAORI..................................................................660 3.9.2 Three, four and five axis transformation (TRAORI)..............................................................662 3.9.2.1 General relationships of universal tool head........................................................................662 3.9.2.2 Three, four and five axis transformation (TRAORI)..............................................................664 3.9.2.3 Variants of orientation programming and initial setting (ORIRESET) ..................................666 3.9.2.4 Programming the tool orientation (A..., B..., C..., LEAD, TILT) ............................................667 3.9.2.5 Face milling (A4, B4, C4, A5, B5, C5)..................................................................................673 3.9.2.6 Reference of the orientation axes (ORIWKS, ORIMKS):.....................................................674 3.9.2.7 Programming orientation axes (ORIAXES, ORIVECT, ORIEULER, ORIRPY, ORIRPY2, ORIVIRT1, ORIVIRT2).........................................................................................................676 3.9.2.8 Orientation programming along the peripheral surface of a taper (ORIPLANE, ORICONCW, ORICONCCW, ORICONTO, ORICONIO) .....................................................678 3.9.2.9 Specification of orientation for two contact points (ORICURVE, PO[XH]=, PO[YH]=, PO[ZH]=)..............................................................................................................................681 3.9.3 Orientation polynomials (PO[angle], PO[coordinate]) ..........................................................683 3.9.4 Rotations of the tool orientation (ORIROTA, ORIROTR, ORIROTT, ORIROTC, THETA)....685 3.9.5 Orientations relative to the path ...........................................................................................687 3.9.5.1 Orientation types relative to the path ...................................................................................687 3.9.5.2 Rotation of the tool orientation relative to the path (ORIPATH, ORIPATHS, angle of rotation)................................................................................................................................688 3.9.5.3 Interpolation of the tool rotation relative to the path (ORIROTC, THETA) ...........................690 3.9.5.4 Smoothing of orientation characteristic (ORIPATHS A8=, B8=, C8=)..................................692 3.9.6 Compression of the orientation (COMPON, COMPCURV, COMPCAD, COMPSURF).......693 3.9.7 Compression of the orientation (COMPCAD, COMPSURF)................................................696 3.9.8 Activating/deactivating the orientation characteristic (ORISON, ORISOF)..........................698 3.9.9 Kinematic transformation .....................................................................................................699 3.9.9.1 Activate face end transformation (TRANSMIT)....................................................................699 3.9.9.2 Activate cylinder surface transformation (TRACYL).............................................................700 3.9.9.3 Activating an oblique angle transformation with programmable angle (TRAANG) ..............703 3.9.9.4 Oblique plunge-cutting on grinding machines (G5, G7).......................................................704 3.9.10 Activate concatenated transformation (TRACON) ...............................................................705 3.9.11 Cartesian PTP travel............................................................................................................707 3.9.11.1 Activating/deactivating Cartesian PTP travel (PTP, PTPG0, PTPWOC, CP) ......................707 3.9.11.2 Specify the position of the joints (STAT)..............................................................................708 3.9.11.3 Specify the sign of the axis angle (TU) ................................................................................712 3.9.11.4 Example 1: PTP travel of a 6-axis robot with ROBX transformation....................................715 3.9.11.5 Example 2: PTP travel for generic 5-axis transformation.....................................................716 3.9.11.6 Example 3: PTPG0 and TRANSMIT....................................................................................717 Table of contents NC programming 14 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Constraints when selecting a transformation .......................................................................718

3.9.13 Deselecting a transformation (TRAFOOF)...........................................................................719 3.10 Kinematic chains..................................................................................................................721 3.10.1 Deletion of components (DELOBJ)......................................................................................721 3.10.2 Index determination by means of names (NAMETOINT).....................................................724 3.11 Collision avoidance with kinematic chains ...........................................................................725 3.11.1 Check for collision pair (COLLPAIR)....................................................................................725 3.11.2 Request recalculation of the machine model of the collision avoidance (PROTA) ..............726 3.11.3 Setting the protection zone status (PROTS)........................................................................727 3.11.4 Determining the clearance of two protection zones (PROTD) .............................................727 3.12 Transformation with kinematic chains..................................................................................730 3.12.1 Activating a transformation (TRAFOON)..............................................................................730 3.12.2 Modifying the orientation transformation after the machine measurement (CORRTRAFO) ....................................................................................................................731 3.13 Tool offsets...........................................................................................................................739 3.13.1 Offset memory......................................................................................................................739 3.13.2 Additive offsets.....................................................................................................................741 3.13.2.1 Selecting additive offsets (DL) .............................................................................................741 3.13.2.2 Specify wear and setup values ($TC_SCPxy[t,d], $TC_ECPxy[t,d])....................................743 3.13.2.3 Delete additive offsets (DELDL)...........................................................................................743 3.13.3 Special handling of tool offsets ............................................................................................744 3.13.3.1 Mirroring of tool lengths........................................................................................................746 3.13.3.2 Wear sign evaluation............................................................................................................746 3.13.3.3 Coordinate system of the active machining operation (TOWSTD, TOWMCS, TOWWCS, TOWBCS, TOWTCS, TOWKCS).........................................................................................747 3.13.3.4 Tool length and plane change..............................................................................................750 3.13.4 Online tool offset ..................................................................................................................751 3.13.4.1 Defining a polynomial function (FCTDEF)............................................................................751 3.13.4.2 Write online tool offset continuously (PUTFTOCF)..............................................................752 3.13.4.3 Write online tool offset, discrete (PUTFTOC).......................................................................753 3.13.4.4 Activate/deactivate online tool offset (FTOCON/FTOCOF) .................................................754 3.13.5 3D tool radius compensation................................................................................................754 3.13.5.1 Selecting 3D tool radius compensation for 3D circumferential milling (CUT3DC, CUT3DCD, ISD)...................................................................................................................754 3.13.5.2 Selecting 3D tool radius compensation for the 3D face milling (CUT3DF, CUT3DFS, CUT3DFF, CUT3DFD).........................................................................................................759 3.13.5.3 3D circumferential milling taking into account a limitation surface (CUT3DCC, CUT3DCCD) ........................................................................................................................765 3.13.6 Tool orientation (ORIC, ORID, OSOF, OSC, OSS, OSSE, ORIS, OSD, OST) ...................769 3.13.7 Free assignment of D numbers, cutting edge numbers .......................................................775 3.13.7.1 Free assignment of D numbers, cutting edge numbers (CE address).................................775 3.13.7.2 Free assignment of D numbers: Checking D numbers (CHKDNO) .....................................775 3.13.7.3 Free assignment of D numbers: Rename D numbers (GETDNO, SETDNO)......................775 3.13.7.4 Free assignment of D numbers: Determine T number to the specified D number (GETACTTD) .......................................................................................................................776 3.13.7.5 Free assignment of D numbers: Invalidate D numbers (DZERO)........................................777 3.13.8 Toolholder kinematics ..........................................................................................................777 3.13.9 Tool length compensation for orientable toolholders (TCARR, TCOABS, TCOFR, TCOFRX, TCOFRY, TCOFRZ)............................................................................................783 3.13.10 Modifying the orientable tool carrier according to the machine measurement (CORRTC)....785 Table of contents NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 15

Online tool length compensation (TOFFON, TOFFOF) .......................................................788

3.13.12 Modification of the offset data for rotatable tools .................................................................791 3.13.12.1 Calculating orientations (ORISOLH) ....................................................................................791 3.13.12.2 Activating the modification of the offset data for rotatable tools (CUTMOD, CUTMODK)....800 3.13.13 Working with tool environments ...........................................................................................807 3.13.13.1 Save tool environment (TOOLENV).....................................................................................807 3.13.13.2 Delete tool environment (DELTOOLENV)............................................................................810 3.13.13.3 Read T, D and DL number (GETTENV)...............................................................................811 3.13.13.4 Read information about the saved tool environments ($P_TOOLENVN, ($P_TOOLENV)....812 3.13.13.5 Read tool lengths and/or tool length components (GETTCOR)...........................................812 3.13.13.6 Change tool components (SETTCOR).................................................................................818 3.13.14 Read the assignment of the tool lengths L1, L2, L3 to the coordinate axes (LENTOAX) ....830 3.14 Path traversing behavior ......................................................................................................834 3.14.1 Feedrate characteristic (FNORM, FLIN, FCUB, FPO).........................................................834 3.14.2 Acceleration behavior...........................................................................................................839 3.14.2.1 Acceleration mode (BRISK, BRISKA, SOFT, SOFTA, DRIVE, DRIVEA)............................839 3.14.2.2 Influence of acceleration on following axes (VELOLIMA, ACCLIMA, JERKLIMA)...............841 3.14.2.3 Activation of technology-specific dynamic values (DYNNORM, DYNPOS, DYNROUGH, DYNSEMIFIN, DYNFINISH, DYNPREC).............................................................................842 3.14.3 Traversing with feedforward control (FFWON, FFWOF)......................................................844 3.14.4 Programmable contour accuracy (CPRECON, CPRECOF) ................................................844 3.14.5 Program sequence with preprocessing memory (STOPFIFO, STARTFIFO, FIFOCTRL, STOPRE) ............................................................................................................................846 3.14.6 Defining a stop delay range (DELAYFSTON, DELAYFSTOF) ............................................848 3.14.7 Prevent program position for SERUPRO (IPTRLOCK, IPTRUNLOCK) ..............................850 3.14.8 Repositioning to the contour (REPOSA, REPOSL, REPOSQ, REPOSQA, REPOSH, REPOSHA, DISR, DISPR, RMIBL, RMBBL, RMEBL, RMNBL) .........................................852 3.14.9 Influencing the motion control ..............................................................................................861 3.14.9.1 Adapting maximum axis jerk (JERKLIM)..............................................................................861 3.14.9.2 Adapting the maximum axis velocity or spindle speed (VELOLIM)......................................862 3.14.10 Programming contour/orientation tolerance (CTOL, OTOL, ATOL).....................................864 3.14.11 Block change behavior with active coupling (CPBC) ...........................................................868 3.15 Axis functions.......................................................................................................................870 3.15.1 Axis replacement, spindle replacement (RELEASE, GET, GETD)......................................870 3.15.2 Transfer axis to another channel (AXTOCHAN) ..................................................................874 3.15.3 Axis functions (AXNAME, AX, SPI, AXTOSPI, ISAXIS, AXSTRING, MODAXVAL) ............875 3.15.4 Replaceable geometry axes (GEOAX) ................................................................................877 3.15.5 Axis container (AXCTSWE, AXCTSWED, AXCTSWEC).....................................................882 3.15.6 Wait for valid axis position (WAITENC)................................................................................883 3.15.7 Programmable parameter set changeover (SCPARA) ........................................................885 3.15.8 Activate/deactivate adaptation (CADAPTON, CADAPTOF) ................................................886 3.15.9 Adapting the FIR jerk filter to the dynamic mode (CALCFIR) ..............................................888 3.16 Axis couplings ......................................................................................................................891 3.16.1 Coupled motion (TRAILON, TRAILOF)................................................................................891 3.16.2 Curve tables (CTAB)............................................................................................................895 3.16.2.1 Define curve tables (CTABDEF, CATBEND).......................................................................895 3.16.2.2 Check for presence of curve table (CTABEXISTS)..............................................................901 3.16.2.3 Delete curve tables (CTABDEL) ..........................................................................................902 3.16.2.4 Locking curve tables to prevent deletion and overwriting (CTABLOCK, CTABUNLOCK)....903 3.16.2.5 Curve tables: Determine table properties (CTABID, CTABISLOCK, CTABMEMTYP, CTABPERIOD).....................................................................................................................904 Table of contents NC programming 16 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Read curve table values (CTABTSV, CTABTEV, CTABTSP, CTABTEP, CTABSSV,

CTABSEV, CTAB, CTABINV, CTABTMIN, CTABTMAX)....................................................905 3.16.2.7 Curve tables: Check use of resources (CTABNO, CTABNOMEM, CTABFNO, CTABSEGID, CTABSEG, CTABFSEG, CTABMSEG, CTABPOLID, CTABPOL, CTABFPOL, CTABMPOL) ...................................................................................................910 3.16.3 Axial master value coupling (LEADON, LEADOF)...............................................................911 3.16.4 Electronic gear (EG).............................................................................................................917 3.16.4.1 Defining an electronic gear (EGDEF)...................................................................................917 3.16.4.2 Switch-in the electronic gearbox (EGON, EGONSYN, EGONSYNE)..................................918 3.16.4.3 Switching-in the electronic gearbox (EGOFS, EGOFC).......................................................921 3.16.4.4 Deleting the definition of an electronic gear (EGDEL) .........................................................922 3.16.4.5 Rotational feedrate (G95) / electronic gear (FPR) ...............................................................922 3.16.5 Synchronous spindle............................................................................................................923 3.16.5.1 Synchronous spindle: Programming (COUPDEF, COUPDEL, COUPON, COUPONC, COUPOF, COUPOFS, COUPRES, WAITC) .......................................................................923 3.16.6 Generic coupling (CP...).......................................................................................................933 3.16.7 Tangential control.................................................................................................................940 3.16.7.1 Defining coupling (TANG) ....................................................................................................940 3.16.7.2 Activating intermediate block generation (TLIFT) ................................................................942 3.16.7.3 Activating the coupling (TANGON) ......................................................................................943 3.16.7.4 Deactivating the coupling (TANGOF)...................................................................................945 3.16.7.5 Deleting a coupling (TANGDEL) ..........................................................................................945 3.16.8 Master/slave coupling (MASLDEF, MASLDEL, MASLON, MASLOF, MASLOFS)..............947 3.17 Synchronized actions...........................................................................................................950 3.17.1 Definition of a synchronized action ......................................................................................950 3.18 Oscillation.............................................................................................................................951 3.18.1 Asynchronous oscillation (OS, OSP1, OSP2, OST1, OST2, OSCTRL, OSNSC, OSE, OSB) ....................................................................................................................................951 3.18.2 Oscillation controlled by synchronized actions (OSCILL) ....................................................955 3.19 Punching and nibbling..........................................................................................................963 3.19.1 Activation/deactivation .........................................................................................................963 3.19.1.1 Activate/deactivate punching and nibbling (SPOF, SON, PON, SONS, PONS, PDELAYON, PDELAYOF, PUNCHACC).............................................................................963 3.19.2 Automatic path segmentation...............................................................................................968 3.19.2.1 Path segmentation for path axes .........................................................................................970 3.19.2.2 Path segmentation for single axes.......................................................................................972 3.20 Grinding................................................................................................................................974 3.20.1 Activate/deactivate grinding-specific tool monitoring (TMON, TMOF) .................................974 3.21 Extended stop and retract (ESR) .........................................................................................975 3.21.1 NC-controlled ESR...............................................................................................................976 3.21.1.1 NC-controlled retraction (POLF, POLFA, POLFMASK, POLFMLIN)...................................976 3.21.1.2 NC-controlled stopping.........................................................................................................979 3.21.2 Drive-integrated ESR ...........................................................................................................980 3.21.2.1 Configuring drive-integrated stopping (ESRS).....................................................................980 3.21.2.2 Configuring drive-integrated retraction (ESRS)....................................................................981 3.22 Program runtime/part counter ..............................................................................................983 3.22.1 Program runtime ..................................................................................................................983 3.22.2 Workpiece counter ...............................................................................................................986 3.23 Additional functions..............................................................................................................988 Table of contents NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 17

Activate machine data (NEWCONF)....................................................................................988

3.23.2 Check scope of NC language present (STRINGIS).............................................................989 3.23.3 Interactively call the window from the part program (MMC).................................................992 3.23.4 Process DataShare - Output to an external device/file (EXTOPEN, WRITE, EXTCLOSE):........................................................................................................................997 3.23.5 Alarms (SETAL) .................................................................................................................1001 3.23.6 Define blank (WORKPIECE)..............................................................................................1002 3.23.7 Switch language mode (G290, G291)................................................................................1006 3.24 User stock removal programs ............................................................................................1009 3.24.1 Supporting functions for stock removal..............................................................................1009 3.24.2 Generate contour table (CONTPRON) ..............................................................................1009 3.24.3 Generate coded contour table (CONTDCON) ...................................................................1015 3.24.4 Determine point of intersection between two contour elements (INTERSEC)...................1019 3.24.5 Execute the contour elements of a table block-by-block (EXECTAB)................................1020 3.24.6 Calculate circle data (CALCDAT).......................................................................................1021 3.24.7 Deactivate contour preparation (EXECUTE)......................................................................1023 3.25 Programming cycles externally ..........................................................................................1024 3.25.1 Technology cycles..............................................................................................................1024 3.25.1.1 Introduction ........................................................................................................................1024 3.25.1.2 Technology-specific overview ............................................................................................1025 3.25.1.3 HOLES1 – row position pattern..........................................................................................1027 3.25.1.4 HOLES2 – circle or pitch circle position pattern.................................................................1027 3.25.1.5 POCKET3 – rectangular pocket.........................................................................................1029 3.25.1.6 POCKET4 – circular pocket ...............................................................................................1032 3.25.1.7 SLOT1 - longitudinal slot....................................................................................................1034 3.25.1.8 SLOT2 - circumferential slot...............................................................................................1037 3.25.1.9 LONGHOLE - elongated hole ............................................................................................1039 3.25.1.10 CYCLE60 – engraving........................................................................................................1041 3.25.1.11 CYCLE61 - Face milling.....................................................................................................1044 3.25.1.12 CYCLE62 - contour call......................................................................................................1046 3.25.1.13 CYCLE63 – contour pocket milling / contour pocket residual material / contour spigot milling / contour spigot residual material............................................................................1046 3.25.1.14 CYCLE64 - Predrilling contour pocket ...............................................................................1049 3.25.1.15 CYCLE70 - thread milling...................................................................................................1051 3.25.1.16 CYCLE72 - Path milling .....................................................................................................1052 3.25.1.17 CYCLE76 – rectangular spigot...........................................................................................1055 3.25.1.18 CYCLE77 – circular spigot .................................................................................................1058 3.25.1.19 CYCLE78 - Drill thread milling ...........................................................................................1060 3.25.1.20 CYCLE79 - multi-edge .......................................................................................................1062 3.25.1.21 CYCLE81 - drilling, centering.............................................................................................1064 3.25.1.22 CYCLE82 - drilling, counterboring......................................................................................1065 3.25.1.23 CYCLE83 – deep-hole drilling 1.........................................................................................1068 3.25.1.24 CYCLE84 - tapping without compensating chuck..............................................................1071 3.25.1.25 CYCLE85 - reaming...........................................................................................................1074 3.25.1.26 CYCLE86 - boring..............................................................................................................1075 3.25.1.27 CYCLE92 - cut-off..............................................................................................................1076 3.25.1.28 CYCLE95 - contour cutting ................................................................................................1078 3.25.1.29 CYCLE98 - thread chain ....................................................................................................1080 3.25.1.30 CYCLE99 - thread turning..................................................................................................1084 3.25.1.31 CYCLE435 - Set dresser coordinate system .....................................................................1089 3.25.1.32 CYCLE495 - form-truing.....................................................................................................1089 Table of contents NC programming 18 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

CYCLE782 - adjust to load.................................................................................................1091

3.25.1.34 CYCLE800 – swivel plane / swivel tool / align tool.............................................................1094 3.25.1.35 CYCLE801 – grid or frame position pattern .......................................................................1097 3.25.1.36 CYCLE802 - arbitrary positions..........................................................................................1099 3.25.1.37 CYCLE830 - deep-hole drilling 2........................................................................................1101 3.25.1.38 CYCLE832 - High-Speed Settings.....................................................................................1107 3.25.1.39 CYCLE840 - tapping with compensating chuck.................................................................1110 3.25.1.40 CYCLE899 – open slot.......................................................................................................1113 3.25.1.41 CYCLE930 - groove...........................................................................................................1116 3.25.1.42 CYCLE940 – undercut form E and F / undercut thread .....................................................1118 3.25.1.43 CYCLE951 - stock removal................................................................................................1121 3.25.1.44 CYCLE952 – stock removal / residual stock removal / plunge cutting / residual plunge cutting / plunge turning / residual plunge turning ...............................................................1124 3.25.1.45 CYCLE4071 - longitudinal grinding with infeed at the reversal point .................................1130 3.25.1.46 CYCLE4072 - longitudinal grinding with infeed at the reversal point and cancel signal ....1132 3.25.1.47 CYCLE4073 - longitudinal grinding with continuous infeed ...............................................1136 3.25.1.48 CYCLE4074 - longitudinal grinding with continuous infeed and cancel signal...................1137 3.25.1.49 CYCLE4075 - surface grinding with infeed at the reversal point........................................1140 3.25.1.50 CYCLE4077 - surface grinding with infeed at the reversal point and cancel signal...........1143 3.25.1.51 CYCLE4078 - surface grinding with continuous infeed......................................................1147 3.25.1.52 CYCLE4079 - surface grinding with intermittent infeed .....................................................1149 3.25.1.53 GROUP_BEGIN - beginning of program block ..................................................................1152 3.25.1.54 GROUP_END - end of program block................................................................................1152 3.25.1.55 GROUP_ADDEND - End of trial cut addition .....................................................................1153 3.25.1.56 Supplementary conditions..................................................................................................1153 3.25.2 Measuring cycles ...............................................................................................................1154 3.25.3 Overview of measuring cycle parameters..........................................................................1155 3.25.3.1 CYCLE973 measuring cycle parameters...........................................................................1155 3.25.3.2 CYCLE974 measuring cycle parameters...........................................................................1158 3.25.3.3 CYCLE994 measuring cycle parameters...........................................................................1160 3.25.3.4 CYCLE976 measuring cycle parameters...........................................................................1163 3.25.3.5 CYCLE978 measuring cycle parameters...........................................................................1165 3.25.3.6 CYCLE998 measuring cycle parameters...........................................................................1168 3.25.3.7 CYCLE977 measuring cycle parameters...........................................................................1171 3.25.3.8 CYCLE961 measuring cycle parameters...........................................................................1175 3.25.3.9 CYCLE979 measuring cycle parameters...........................................................................1177 3.25.3.10 CYCLE997 measuring cycle parameters...........................................................................1180 3.25.3.11 CYCLE995 measuring cycle parameters...........................................................................1183 3.25.3.12 CYCLE996 measuring cycle parameters...........................................................................1184 3.25.3.13 CYCLE9960 measuring cycle parameters.........................................................................1187 3.25.3.14 CYCLE982 measuring cycle parameters...........................................................................1189 3.25.3.15 CYCLE971 measuring cycle parameters...........................................................................1191 3.25.3.16 CYCLE150 measuring cycle parameters...........................................................................1194 4 Tables.....................................................................................................................................................1197 4.1 Operations..........................................................................................................................1197 4.2 Addresses ..........................................................................................................................1235 4.2.1 Address letters ...................................................................................................................1235 4.2.2 Fixed addresses.................................................................................................................1236 4.2.3 Settable addresses ............................................................................................................1240 4.3 G commands......................................................................................................................1247 Table of contents NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 19

G group 1: Modally valid motion commands......................................................................1247

4.3.3 G group 2: Non-modally valid motion, dwell time...............................................................1248 4.3.4 G group 3: Programmable frame, working area limitation and pole programming.............1248 4.3.5 G group 4: FIFO.................................................................................................................1249 4.3.6 G group 6: Plane selection.................................................................................................1249 4.3.7 G group 7: Tool radius compensation................................................................................1249 4.3.8 G group 8: Settable work offset..........................................................................................1250 4.3.9 G group 9: Frame and tool offset suppression...................................................................1250 4.3.10 G group 10: Exact stop - continuous-path mode................................................................1250 4.3.11 G group 11: Exact stop, non-modal ...................................................................................1251 4.3.12 G group 12: Block change criteria at exact stop (G60/G9) ................................................1251 4.3.13 G group 13: Workpiece measuring inch/metric..................................................................1251 4.3.14 G group 14: Workpiece measuring absolute/incremental ..................................................1252 4.3.15 G group 15: Feed type .......................................................................................................1252 4.3.16 G group 16: Feedrate override at inside and outside curvature.........................................1253 4.3.17 G group 17: Approach and retraction response, tool offset ...............................................1253 4.3.18 G group 18: Corner behavior, tool offset............................................................................1253 4.3.19 G group 19: Curve transition at beginning of spline...........................................................1253 4.3.20 G group 20: Curve transition at end of spline.....................................................................1254 4.3.21 G group 21: Acceleration profile.........................................................................................1254 4.3.22 G group 22: Tool offset type...............................................................................................1254 4.3.23 G group 23: Collision monitoring at inside contours...........................................................1255 4.3.24 G group 24: Precontrol.......................................................................................................1255 4.3.25 G group 25: Tool orientation reference ..............................................................................1255 4.3.26 G group 26: Repositioning mode for REPOS (modal) .......................................................1255 4.3.27 G group 27: Tool offset for change in orientation at outside corners .................................1256 4.3.28 G group 28: Working area limitation...................................................................................1256 4.3.29 G group 29: Radius/diameter programming.......................................................................1256 4.3.30 G group 30: NC block compression ...................................................................................1256 4.3.31 G group 31: OEM G commands.........................................................................................1257 4.3.32 G group 32: OEM G commands.........................................................................................1257 4.3.33 G group 33: Settable fine tool offset...................................................................................1258 4.3.34 G group 34: Tool orientation smoothing.............................................................................1258 4.3.35 G group 35: Punching and nibbling....................................................................................1258 4.3.36 G group 36: Punching with delay .......................................................................................1258 4.3.37 G group 37: Feedrate profile..............................................................................................1259 4.3.38 G group 38: Assignment of fast inputs/outputs for punching/nibbling................................1259 4.3.39 G group 39: Programmable contour accuracy ...................................................................1259 4.3.40 G group 40: Tool radius compensation constant ...............................................................1259 4.3.41 G group 41: Interruptible thread cutting .............................................................................1259 4.3.42 G group 42: Tool carrier.....................................................................................................1260 4.3.43 G group 43: SAR approach direction .................................................................................1260 4.3.44 G group 44: SAR path segmentation .................................................................................1260 4.3.45 G group 45: Path reference for FGROUP axes .................................................................1260 4.3.46 G group 46: Plane selection for fast retraction...................................................................1261 4.3.47 G group 47: Mode switchover for external NC code ..........................................................1261 4.3.48 G group 48: Approach and retraction response with tool radius compensation.................1261 4.3.49 G group 49: Point-to-point motion......................................................................................1261 4.3.50 G group 50: Orientation programming ...............................................................................1262 4.3.51 G group 51: Interpolation type for orientation programming ..............................................1262 4.3.52 G group 52: Frame rotation in relation to workpiece..........................................................1263 Table of contents NC programming 20 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

G group 53: Frame rotation in relation to tool ....................................................................1263

4.3.54 G group 54: Vector rotation for polynomial programming ..................................................1263 4.3.55 G group 55: Rapid traverse with/without linear interpolation..............................................1264 4.3.56 G group 56: Taking into account tool wear ........................................................................1264 4.3.57 G group 57: Corner deceleration........................................................................................1264 4.3.58 G group 59: Dynamic response mode for path interpolation..............................................1264 4.3.59 G group 60: Working area limitation...................................................................................1265 4.3.60 G group 61: Tool orientation smoothing.............................................................................1265 4.3.61 G group 62: Repositioning mode for REPOS (non-modal) ................................................1265 4.3.62 G group 64: Grinding frames..............................................................................................1266 4.4 Predefined procedures.......................................................................................................1267 4.5 Predefined procedures in synchronized actions ................................................................1288 4.6 Predefined functions ..........................................................................................................1290 4.7 Currently set language in the HMI......................................................................................1303 A Appendix.................................................................................................................................................1305 A.1 List of abbreviations ...........................................................................................................1305 A.2 Documentation overview....................................................................................................1314 Index.......................................................................................................................................................1315 Table of contents NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 21

Fundamental safety instructions

1 1.1 General safety instructions WARNING Danger to life if the safety instructions and residual risks are not observed If the safety instructions and residual risks in the associated hardware documentation are not observed, accidents involving severe injuries or death can occur. ● Observe the safety instructions given in the hardware documentation. ● Consider the residual risks for the risk evaluation. WARNING Malfunctions of the machine as a result of incorrect or changed parameter settings As a result of incorrect or changed parameterization, machines can malfunction, which in turn can lead to injuries or death. ● Protect the parameterization against unauthorized access. ● Handle possible malfunctions by taking suitable measures, e.g. emergency stop or emergency off. NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 23

Warranty and liability for application examples

Application examples are not binding and do not claim to be complete regarding configuration, equipment or any eventuality which may arise. Application examples do not represent specific customer solutions, but are only intended to provide support for typical tasks. As the user you yourself are responsible for ensuring that the products described are operated correctly. Application examples do not relieve you of your responsibility for safe handling when using, installing, operating and maintaining the equipment. Fundamental safety instructions 1.2 Warranty and liability for application examples NC programming 24 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Siemens provides products and solutions with industrial security functions that support the

secure operation of plants, systems, machines and networks. In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Products and solutions from Siemens constitute one element of such a concept. Customers are responsible for preventing unauthorized access to their plants, systems, machines and networks. Such systems, machines and components should only be connected to an enterprise network or the Internet if and to the extent such a connection is necessary and only when appropriate security measures (e.g. using firewalls and/or network segmentation) are in place. For additional information on industrial security measures that can be implemented, please visit: Industrial security (https://www.siemens.com/industrialsecurity) Siemens’ products and solutions undergo continuous development to make them more secure. Siemens strongly recommends that product updates are applied as soon as they become available, and that only the latest product versions are used. Use of product versions that are no longer supported, and failure to apply the latest updates may increase customer’s exposure to cyber threats. To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed at: Industrial security (https://www.siemens.com/industrialsecurity) Further information is provided on the Internet: Industrial Security Configuration Manual (https://support.industry.siemens.com/cs/ww/en/ view/108862708) Fundamental safety instructions 1.3 Industrial security NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 25

Unsafe operating states resulting from software manipulation

Software manipulations, e.g. viruses, Trojans, or worms, can cause unsafe operating states in your system that may lead to death, serious injury, and property damage. ● Keep the software up to date. ● Incorporate the automation and drive components into a holistic, state-of-the-art industrial security concept for the installation or machine. ● Make sure that you include all installed products into the holistic industrial security concept. ● Protect files stored on exchangeable storage media from malicious software by with suitable protection measures, e.g. virus scanners. ● On completion of commissioning, check all security-related settings. ● Protect the drive against unauthorized changes by activating the "Know-how protection" converter function. Fundamental safety instructions 1.3 Industrial security NC programming 26 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Fundamental Geometrical Principles

2.1.1 Workpiece positions 2.1.1.1 Reference system of position specifications In order that the machine or the control can work with the positions specified in the NC program, these position specifications have to be made in a reference system that can be transferred to the directions of motion of the machine axes. Cartesian (i.e. clockwise, perpendicular) coordinate systems in accordance with DIN 66217 are used as workpiece coordinate system for machine tools. = = ; < < ; : r r r The workpiece zero (W) is the origin of the workpiece coordinate system. 2.1.1.2 Cartesian coordinates The axes in the coordinate system are assigned dimensions. In this way, it is possible to clearly describe every point in the coordinate system, and therefore every workpiece position based on the direction (X, Y and Z) and three numerical values. The workpiece zero always has the coordinates X0, Y0 and Z0. NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 27

Position specifications in the form of Cartesian coordinates

To simplify things, we will only consider one plane of the coordinate system in the following example, the X/Y plane: 3 3 3 3       < < = ; ;   Points P1 to P4 have the following coordinates: Position Coordinates P1 X100 Y50 P2 X-50 Y100 P3 X-105 Y-115 P4 X70 Y-75 Example: Workpiece positions for turning With lathes, one plane is sufficient to describe the contour: š š š     3 3 3 3 ; = Fundamentals 2.1 Fundamental Geometrical Principles NC programming 28 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Points P1 to P4 have the following coordinates:

Position Coordinates P1 X25 Z-7.5 P2 X40 Z-15 P3 X40 Z-25 P4 X60 Z-35 Example: Workpiece positions for milling For milling, the feed depth must also be described, i.e. the third coordinate (in this case Z) must also be assigned a numerical value. 3 3 3 3 3 3          < ; < = Points P1 to P3 have the following coordinates: Position Coordinates P1 X10 Y45 Z-5 P2 X30 Y60 Z-20 P3 X45 Y20 Z-15 2.1.1.3 Polar coordinates Polar coordinates can be used instead of Cartesian coordinates to describe workpiece positions. This is useful when a workpiece or part of a workpiece has been dimensioned with radius and angle. The point from which the dimensioning starts is called the "pole". Position specifications in the form of polar coordinates Polar coordinates are made up of the polar radius and the polar angle. The polar radius is the distance between the pole and the position. Fundamentals 2.1 Fundamental Geometrical Principles NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 29

The polar angle is the angle between the polar radius and the horizontal axis of the working

plane. Negative polar angles are in the clockwise direction, positive polar angles in the counterclockwise direction. Example 3ROH    r r < ; 3 3  Points P1 and P2 can then be described – with reference to the pole – as follows: Position Polar coordinates P1 RP=100 AP=30 P2 RP=60 AP=75 RP: Polar radius AP: Polar angle 2.1.1.4 Absolute dimensions Position specifications in absolute dimensions With absolute dimensions, all the position specifications refer to the currently valid zero point. Applied to tool movement this means: the position, to which the tool is to travel. Fundamentals 2.1 Fundamental Geometrical Principles NC programming 30 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

In absolute dimensions, the following position specifications result for points P1 to P4:

Position Position specification in absolute dimensions P1 X25 Z-7.5 P2 X40 Z-15 P3 X40 Z-25 P4 X60 Z-35 Example: Milling       < ; 3 3 3 Fundamentals 2.1 Fundamental Geometrical Principles NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 31

In absolute dimensions, the following position specifications result for points P1 to P3:

Position Position specification in absolute dimensions P1 X20 Y35 P2 X50 Y60 P3 X70 Y20 2.1.1.5 Incremental dimension Position specifications in incremental dimensions In production drawings, the dimensions often do not refer to a zero point, but rather to another workpiece point. So that these dimensions do not have to be converted, they can be specified in incremental dimensions. In this method of dimensional notation, a position specification refers to the previous point. Applied to tool movement this means: The incremental dimensions describe the distance the tool is to travel. Example: Turning š š š     3 3 3 3 ; = In incremental dimensions, the following position specifications are obtained for points P2 to P4: Position Position specification in incremental dimensions The specification refers to: P2 X15 Z-7.5 P1 P3 Z-10 P2 P4 X20 Z-10 P3 Note With DIAMOF or DIAM90 (Page 162) active, the set distance in incremental dimensions (G91) is programmed as a radius dimension. Fundamentals 2.1 Fundamental Geometrical Principles NC programming 32 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

The position specifications for points P1 to P3 in incremental dimensions are:

      < ; 3 3 3 In incremental dimensions, the following position specifications are obtained for points P1 to P3: Position Position specification in incremental di‐ mensions The specification refers to: P1 X20 Y35 Zero point P2 X30 Y20 P1 P3 X20 Y-35 P2 2.1.2 Working planes An NC program requires information about the machining plane. Because only then can the control correctly take into account the tool offset values, for example. The specification of the machining plane is also required for certain types of circular-path programming and polar coordinates. The machining plane is specified in the Cartesian workpiece coordinate system used as basis using two coordinate axes. The third coordinate axis is perpendicular to this machining plane and determines the infeed direction of the tool (e.g. for 2D machining). Fundamentals 2.1 Fundamental Geometrical Principles NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 33

Machining planes for turning/milling

< = ; * * * Machining planes for turning = ; < * * * Machining planes for milling Activating a machining plane The machining planes are activated in the NC program using G commands G17, G18 and G19. The relationship is defined as follows: G command Machining plane Abscissa Ordinate Applicate ≙ infeed direction G17 X/Y X Y Z G18 Z/X Z X Y G19 Y/Z Y Z X 2.1.3 Zero points and reference points Various zero points and reference points are defined on an NC machine: Zero points M Machine zero The machine zero defines the machine coordinate system (MCS). All other reference points refer to the machine zero. W Workpiece zero = program zero The workpiece zero defines the workpiece coordinate system in relation to the machine zero. A Blocking point Can be the same as the workpiece zero (only for lathes). Fundamentals 2.1 Fundamental Geometrical Principles NC programming 34 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Position defined by output cam and measuring system. The distance to the machine

zero M must be known so that the axis position at this point can be set exactly to this value. B Starting point Can be defined by the program. The 1st tool starts machining here. T Toolholder reference point Is on the toolholder. By entering the tool lengths, the control calculates the distance between the tool tip and the toolholder reference point. N Tool change point Zero points and reference points for turning 0 : $ 5 % 1 ; = Zero points for milling : : 0 < ; Fundamentals 2.1 Fundamental Geometrical Principles NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 35

A distinction is made between the following coordinate systems:

● Machine coordinate system (MCS) (Page 36) with the machine zero M ● Basic coordinate system (BCS) (Page 38) ● Basic zero system (BZS) (Page 39) ● Settable zero system (SZS) (Page 40) ● Workpiece coordinate system (WCS) (Page 41) with the workpiece zero W 2.1.4.1 Machine coordinate system (MCS) The machine coordinate system comprises all the physically existing machine axes. Reference points and tool and pallet changing points (fixed machine points) are defined in the machine coordinate system. If programming is performed directly in the machine coordinate system (possible with some G commands), then the physical axes of the machine are directly addressed. Any workpiece clamping that is present is not taken into account. Note If there are various machine coordinate systems (e.g. 5-axis transformation), then an internal transformation is used to map the machine kinematics on the coordinate system in which the programming is performed. Three-finger rule The orientation of the coordinate system relative to the machine depends on the machine type. The axis directions follow the so-called "three-finger rule" of the right hand (according to DIN 66217). Seen from in front of the machine, the middle finger of the right hand points in the opposite direction to the infeed of the main spindle. Therefore: ● the thumb points in the +X direction ● the index finger points in the +Y direction ● the middle finger points in the +Z direction Fundamentals 2.1 Fundamental Geometrical Principles NC programming 36 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Rotary motion around the coordinate axes X, Y and Z are designated A, B and C. The direction

of rotation is obtained from the direction of the rotary motion when looking in the positive direction of the coordinate axis: Direction of the rotary motion Direction of rotation clockwise positive counter-clockwise negative r % $ = ; < r r &       X, Y, Z Vertical coordinate axes arranged on top of one another A, B, C Rotary axes, rotating around X, Y, Z Fundamentals 2.1 Fundamental Geometrical Principles NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 37

Position of the coordinate system in different machine types

The position of the coordinate system resulting from the "three-finger rule" can have a different orientation for different machine types, which are shown in the following two examples: 0 = < ; Vertical 3-axis milling machine < % 0 ; = Horizontal 4-axis milling machine 2.1.4.2 Basic coordinate system (BCS) The basic coordinate system (BCS) consists of three mutually perpendicular axes (geometry axes) as well as other special axes, which are not interrelated geometrically. Machine tools without kinematics transformation BCS and MCS always coincide when the BCS can be mapped onto the MCS without kinematics transformation (e.g. 5-axis transformation, TRANSMIT/TRACYL/TRAANG). On such machines, machine axes and geometry axes can have the same names. 0&6 %&6 < 0 ; = Fundamentals 2.1 Fundamental Geometrical Principles NC programming 38 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Machine tools with kinematic transformation

BCS and MCS do not coincide when the BCS is mapped onto the MCS with kinematics transformation (e.g. 5-axis transformation, TRANSMIT/TRACYL/TRAANG). On such machines the machine axes and geometry axes must have different names. 0&6 %&6 <0&6 ;0&6 =0&6 <%&6 ;%&6 =%&6 .LQHPDWLFWUDQVIRUPDWLRQ Machine kinematics The workpiece is always programmed in a two- or three-dimensional, right-angled coordinate system (WCS). However, such workpieces are being programmed ever more frequently on machine tools with rotary axes or linear axes not perpendicular to one another. Kinematic transformation is used to represent coordinates programmed in the workpiece coordinate system (rectangular) in real machine axis motion. 2.1.4.3 Basic zero system (BZS) The basic zero system (BZS) is derived from the basic coordinate system through the basic offset. %&6 %=6 %DVLFRIIVHW < ; = < ; = Fundamentals 2.1 Fundamental Geometrical Principles NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 39

The basic offset describes the coordinate transformation between BCS and BZS. It can be

used, for example, to define the palette zero. The basic offset comprises: ● External work offset ● DRF offset ● Overlaid movement ● Chained system frames ● Chained basic frames 2.1.4.4 Settable zero system (SZS) Settable work offset The "settable zero system" (SZS) is obtained from the basic zero system (BZS) as a result of the settable work offset. Settable work offsets are activated in the NC program with the G commands G54 ... G57 and G505 ... G599. %=6 6=6 6HWWDEOHZRUNRIIVHW < ; = < ; = If no programmable coordinate transformations (frames) are active, then the "settable zero system" is the workpiece coordinate system (WCS). Fundamentals 2.1 Fundamental Geometrical Principles NC programming 40 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Programmable coordinate transformations (frames)

Sometimes it is useful or necessary within an NC program, to move the originally selected workpiece coordinate system (or the "settable zero system") to another position and, if required, to rotate it, mirror it and/or scale it. This is performed using programmable coordinate transformations (frames) (Page 305). Note Programmable coordinate transformations (frames) always refer to the "settable zero system". 2.1.4.5 Workpiece coordinate system (WCS) The geometry of a workpiece is described in the workpiece coordinate system (WCS). In other words, the data in the NC program refers to the workpiece coordinate system. The workpiece coordinate system is always a Cartesian coordinate system and assigned to a specific workpiece. 2.1.4.6 What is the relationship between the various coordinate systems? The following example should help clarify the relationships between the various coordinate systems:       0 = < ; ① A kinematic transformation is not active. This means that the machine coordinate system and the basic coordinate system coincide. ② The basic zero system (BZS) with the pallet zero are obtained from the basic offset. ③ The settable work offset G54 or G55 specifies the "settable zero system" (SZS) for workpiece 1 or workpiece 2 respectively. ④ The workpiece coordinate system (WCS) results from the programmable coordinate transfor‐ mation. Fundamentals 2.1 Fundamental Geometrical Principles NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 41

Fundamental Principles of NC Programming

Note DIN 66025 is the guideline for NC programming. 2.2.1 Name of an NC program Rules Each NC program must be assigned a program name (identifier) when it is created. The program name can be chosen freely providing the following rules are observed: ● Permissible characters: – Letters: A ... Z, a ... z – Numbers: 0 ... 9 – Underscore: _ ● The first two characters should either be two letters or an underscore followed by a letter. Note If this condition is satisfied, then an NC program can be called as subprogram from another program just by specifying the program name. However, if the program name starts with digits, the subprogram call is then only possible via the CALL statement. ● Maximum length: 24 characters Note Uppercase/lowercase letters The SINUMERIK NC language does not distinguish between uppercase and lowercase letters. Note Impermissible program names To avoid problems with Windows applications, the following program names may not be used: ● CON, PRN, AUX, NUL ● COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9 ● LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9 Further restrictions, see "Names (Page 382)". Fundamentals 2.2 Fundamental Principles of NC Programming NC programming 42 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

The program name assigned when the program is created is extended within the control with

the addition of a prefix and a suffix: ● Prefix: _N_ ● Suffix: – Main programs: _MPF – Subprograms: _SPF Files in punch tape format Externally created program files that are read via the V.24 interface must be present in punch tape format. The following additional rules apply for the program name of a file in punch tape format: ● First character: % ● Then a four-character file extension: _xxx Examples: ● %_N_SHAFT123_MPF ● %Flange3_MPF 2.2.2 Structure and contents of an NC program 2.2.2.1 Blocks and block components Blocks An NC program consists of a sequence of NC blocks. Each block contains the data for executing a step in the workpiece machining. Block components NC blocks consist of the following components: ● Commands (statements) according to DIN 66025 ● Elements of the NC high-level language Commands according to DIN 66025 The commands according to DIN 66025 consist of an address character and a digit or sequence of digits representing an arithmetic value. Address character (address) Fundamentals 2.2 Fundamental Principles of NC Programming NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 43

The address character (generally a letter) defines the meaning of the command.

Examples: Address character Meaning G G command (preparatory function) X Position data for the X axis S Spindle speed Digit sequence The digit sequence is the value assigned to the address character. The sequence of digits can contain a sign and decimal point. The sign always appears between the address letter and the sequence of digits. Positive signs (+) and leading zeros (0) do not have to be specified. %ORFN $GGUHVV 'LJLWVHTXHQFH $GGUHVV 'LJLWVHTXHQFH $GGUHVV 'LJLWVHTXHQFH * ; 6 Elements of the NC high-level language As the command set according to DIN 66025 is no longer adequate for programming complex machining sequences in modern machine tools, it has been extended by the elements of the NC high-level language. Fundamentals 2.2 Fundamental Principles of NC Programming NC programming 44 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

These include, for example:

● Commands of the NC high-level language In contrast to the commands according to DIN 66025, the commands of the NC high-level language consist of several address letters, e.g. – OVR for speed override – SPOS for spindle positioning ● Identifiers (defined names) for: – System variables – User-defined variables – Subprograms – Keywords – Jump markers – Macros Note An identifier must be unique and cannot be used for different objects. ● Comparison operators ● Logic operators ● Arithmetic functions ● Control structures Effectiveness of commands Commands are either modal or non-modal: ● Modal Modal commands retain their validity with the programmed value (in all following blocks) until: – A new value is programmed under the same command. – A command is programmed that revokes the effect of the previously valid command ● Non-modal Non-modal commands only apply to the block in which they were programmed. End of program The last block in the execution sequence contains a special word for the end of program: M2, M17 or M30. Fundamentals 2.2 Fundamental Principles of NC Programming NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 45

Start of block

NC blocks can be identified at the start of the block by block numbers. These consist of the character "N" and a positive integer, e.g. N40 ... The order of the block numbers is arbitrary, however, block numbers in rising order are recommended. Note Block numbers must be unique within a program in order to achieve an unambiguous result when searching. End of block A block ends with the character LF (LINE FEED = new line). Note The LF character does not have to be written. It is generated automatically by the line change. Block length A block can contain a maximum of 512 characters (including the comment and end-of-block character LF). Note Three blocks of up to 66 characters each are normally displayed in the current block display on the screen. Comments are also displayed. Messages are displayed in a separate message window. Order of the statements In order to keep the block structure as clear as possible, the statements in a block should be arranged in the following order: N… G… X… Y… Z… F… S… T… D… M… H… Address Meaning N Address of block number G Preparatory function X,Y,Z Positional data F Feedrate S Speed Fundamentals 2.2 Fundamental Principles of NC Programming NC programming 46 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Tool offset number

M Additional function H Auxiliary function Note Certain addresses can be used repeatedly within a block, e.g. G…, M…, H… 2.2.2.3 Value assignments Values can be assigned to the addresses. The following rules apply: ● An "=" sign must be inserted between the address and the value if: – The address comprises more than one letter. – The value includes more than one constant. The "=" sign can be omitted if the address is a single letter and the value consists of only one constant. ● Signs are permitted. ● Separators are permitted after the address letter. Examples: X10 Value assignment (10) to address X, "=" not required X1=10 Value assignment (10) to address (X) with numeric extension (1), "=" required X=10*(5+SIN(37.5)) Value assignment by means of a numeric expression, "=" required Note A numeric extension must always be followed by one of the special characters "=", "(", "[", ")", "]", ",", or an operator, in order to distinguish an address with numeric extension from an address letter with a value. 2.2.2.4 Comments To make an NC program easier to understand, comments can be added to the NC blocks. A comment is at the end of a block and is separated from the program section of the NC block by a semicolon (";"). Fundamentals 2.2 Fundamental Principles of NC Programming NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 47

N10 G1 F100 X10 Y20

; Comment to explain the NC block Example 2: Program code Comment N10 ; Company G&S, order no. 12A71 N20 ; Program written by H. Smith, Dept. TV 4 on November 21, 1994 N50 ; Section no. 12, housing for submersible pump type TP23A Note Comments are stored and appear in the current block display when the program is running. 2.2.2.5 Skipping blocks NC blocks, which are not to be executed every time the program runs, can be skipped and not processed. This function is used when testing and/or running-in new programs, for example. Skip blocks Blocks to be skipped are indicated in the part program by the character "/" before the block number. Several consecutive blocks can also be skipped. The instructions in the skipped blocks are not executed and the program resumes with the next block that is not skipped. Example: 1 1 1 1 1 1 1 1 1 1 1 1 Fundamentals 2.2 Fundamental Principles of NC Programming NC programming 48 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

; Is executed

/N20 … ; Skipped N30 … ; Is executed /N40 … ; Skipped /N50 … ; Skipped /N60 … ; Skipped N70 … ; Is executed ... Skip levels Blocks can be assigned to skip levels (max. 10), which can be activated via the user interface or the PLC user program. The assignment is made in the NC program using a forward slash, followed by the number of the skip level. Only one skip level can be specified for each block. Example: Program code Comment / ... ; Block is skipped (1st skip level) /0 ... ; Block is skipped (1st skip level) /1 N010... ; Block is skipped (2nd skip level) /2 N020... ; Block is skipped (3rd skip level) ... /7 N100... ; Block is skipped (8th skip level) /8 N080... ; Block is skipped (9th skip level) /9 N090... ; Block is skipped (10th skip level) Note The levels to be skipped can only be changed when the control system is in the STOP/reset state. Note The number of skip levels that can be used depends on a display machine data. Note Skipping blocks also remains active during block searches. Note System and user variables can also be used in conditional jumps in order to control program execution. Fundamentals 2.2 Fundamental Principles of NC Programming NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 49

Creating an NC program

2.3.1 Basic procedure The programming of the individual operation steps in the NC language generally represents only a small proportion of the work in the development of an NC program. Programming of the actual instructions should be preceded by the planning and preparation of the operation steps. The more accurately you plan in advance how the NC program is to be structured and organized, the faster and easier it will be to produce a complete program, which is clear and free of errors. Clearly structured programs are especially advantageous when changes have to be made later. As every part is not identical, it does not make sense to create every program in the same way. However, the following procedure has shown itself to be suitable in the most cases. Procedure 1. Prepare the workpiece drawing – Define the workpiece zero – Draw the coordinate system – Calculate any missing coordinates 2. Define the machining sequence – Which tools are used when and for the machining of which contours? – In which order will the individual elements of the workpiece be machined? – Which individual elements are repeated (possibly also rotated) and should be stored in a subroutine? – Are there contour sections in other part programs or subroutines that could be used for the current workpiece? – Where are zero offsets, rotating, mirroring and scaling useful or necessary (frame concept)? Fundamentals 2.3 Creating an NC program NC programming 50 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

3. Create a machining plan

Define all machining operations step-by-step, e.g. – Rapid traverse movements for positioning – Tool change – Define the machining plane – Retraction for checking – Switch spindle, coolant on/off – Call up tool data – Feed – Path correction – Approaching the contour – Retraction from the contour – etc. 4. Compile machining steps in the programming language – Write each individual step as an NC block (or NC blocks). 5. Combine the individual steps into a program 2.3.2 Available characters The following characters are available for writing NC programs: ● Uppercase characters: A, B, C, D, E, F, G, H, I, J, K, L, M, N,(O),P, Q, R, S, T, U, V, W, X, Y, Z ● Lowercase characters: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z ● Numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ● Special characters: See the table below. Special characters Meaning % Program start character (used only for writing programs on an external PC) ( For bracketing parameters or expressions ) For bracketing parameters or expressions [ For bracketing addresses or indexes ] For bracketing addresses or indexes < Less than > Greater than : Main block, end of label, chain operator = Assignment, part of equation Fundamentals 2.3 Creating an NC program NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 51

Division, block suppression

* Multiplication + Addition - Subtraction, minus sign " Double quotation marks, identifier for character string ' Single quotation marks, identifier for special numerical values: hexadecimal, binary $ System variable identifiers s_ Underscore, belonging to letters ? Reserved ! Reserved . Decimal point , Comma, parameter separator ; Comment start & Format character, same effect as space character LF End of block Tab character Separator Blank Separator (blank) Note Take care to differentiate between the letter "O" and the digit "0". Note No distinction is made between uppercase and lowercase characters (exception: tool call). Note Non-printable special characters are treated like blanks. 2.3.3 Program header The NC blocks that are placed in front of the actual motion blocks for the machining of the workpiece contour are called the program header. The program header contains information/statements regarding: ● Tool change ● Tool offsets ● Spindle motion ● Feed control ● Geometry settings (zero offset, selection of the working plane) Fundamentals 2.3 Creating an NC program NC programming 52 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Program header for turning

The following example shows the typical structure of an NC program header for turning: Program code Comment N10 G0 G153 X200 Z500 T0 D0 ; Retract toolholder before tool turret is ro- tated. N20 T5 ; Swing in tool 5. N30 D1 ; Activate cutting edge data set of the tool. N40 G96 S300 LIMS=3000 M4 M8 ; Constant cutting rate (Vc) = 300 m/min, speed limitation = 3000 rpm, direction of rotation counterclockwise, cooling on. N50 DIAMON ; X axis will be programmed in the diameter. N60 G54 G18 G0 X82 Z0.2 ; Call zero offset and working plane, approach starting position. ... Program header for milling The following example shows the typical structure of an NC program header for milling: Program code Comment N10 T="SF12" ; Alternative: T123 N20 M6 ; Trigger tool change. N30 D1 ; Activate cutting edge data set of the tool. N40 G54 G17 ; Zero offset and working plane. N50 G0 X0 Y0 Z2 S2000 M3 M8 ; Approach to the workpiece, spindle and cool- ant on. ... If tool orientation / coordinate transformation is being used, any transformations still active should be deleted at the start of the program: Program code Comment N10 CYCLE800() ; Resetting of the swiveled plane N20 TRAFOOF ; Resetting of TRAORI, TRANSMIT, TRACYL, ... ... 2.3.4 Program examples 2.3.4.1 Example 1: First programming steps Program example 1 is to be used to perform and test the first programming steps. Fundamentals 2.3 Creating an NC program NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 53

1. Create a new part program (name)

2. Edit the part program 3. Select the part program 4. Activate single block 5. Start the part program. Note In order that the program can run on the machine, the machine data must have been appropriately set (→ see machine manufacturer's data!). Note When testing a program, alarms can occur, which must first be reset. NC program Program code Comment N10 MSG ("THIS IS MY NC PROGRAM") ; Message "THIS IS MY NC PROGRAM" dis- played in the alarm line. N20 F200 S900 T1 D2 M3 ; Feedrate, spindle, tool, tool off- set, spindle clockwise. N30 G0 X100 Y100 ; Approach position in rapid traverse. N40 G1 X150 ; Rectangle with feedrate, straight line in X. N50 Y120 ; Straight line in Y. N60 X100 ; Straight line in X. N70 Y100 ; Straight line in Y. N80 G0 X0 Y0 ; Retraction in rapid traverse. N100 M30 ; End of block. 2.3.4.2 Example 2: NC program for turning Program example 2 is intended for machining a workpiece on a lathe. It contains radius programming and tool radius compensation. Fundamentals 2.3 Creating an NC program NC programming 54 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Dimension drawing of the workpiece

5 5 5 5 5 r           š š š  š ; = NC program Program code Comment N5 G0 G53 X280 Z380 D0 ; Starting point. N10 TRANS X0 Z250 ; Work offset. N15 LIMS=4000 ; Speed limitation (G96). N20 G96 S250 M3 ; Select constant cutting rate. N25 G90 T1 D1 M8 ; Select tool selection and offset. N30 G0 G42 X-1.5 Z1 ; Set tool with tool radius compensation. N35 G1 X0 Z0 F0.25 N40 G3 X16 Z-4 I0 K-10 ; Turn radius 10. N45 G1 Z-12 N50 G2 X22 Z-15 CR=3 ; Turn radius 3. N55 G1 X24 N60 G3 X30 Z-18 I0 K-3 ; Turn radius 3. N65 G1 Z-20 N70 X35 Z-40 N75 Z-57 N80 G2 X41 Z-60 CR=3 ; Turn radius 3. N85 G1 X46 N90 X52 Z-63 Fundamentals 2.3 Creating an NC program NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 55

N95 G0 G40 G97 X100 Z50 M9

; Deselect tool radius compensation and approach tool change location. N100 T2 D2 ; Call tool and select offset. N105 G96 S210 M3 ; Select constant cutting rate. N110 G0 G42 X50 Z-60 M8 ; Set tool with tool radius compensation. N115 G1 Z-70 F0.12 ; Turn diameter 50. N120 G2 X50 Z-80 I6.245 K-5 ; Turn radius 8. N125 G0 G40 X100 Z50 M9 ; Retract tool and deselect tool radius compen- sation. N130 G0 G53 X280 Z380 D0 M5 ; Approach tool change location. N135 M30 ; End of program 2.3.4.3 Example 3: NC program for milling Program example 3 is intended for machining a workpiece on a vertical milling machine. It contains surface and side milling as well as drilling. Dimension drawing of the workpiece Side view     ෘ ෘ Fundamentals 2.3 Creating an NC program NC programming 56 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

; Preselection of the tool with name

PF60. N20 M6 ; Load the tool into the spindle. N30 S2000 M3 M8 ; Speed, direction of rotation, cooling on. N40 G90 G64 G54 G17 G0 X-72 Y-72 ; Basic settings of the geometry and ap- proach starting point. N50 G0 Z2 ; Z axis to safety clearance. N60 G450 CFTCP ; Behavior with active G41/G42. N70 G1 Z-10 F3000 ; Milling tool to machining depth with feedrate = 3000 mm/min. N80 G1 G41 X-40 ; Activation of the milling tool radius compensation. N90 G1 X-40 Y30 RND=10 F1200 ; Travel to the contour with feedrate = 1200 mm/min. N100 G1 X40 Y30 CHR=10 N110 G1 X40 Y-30 N120 G1 X-41 Y-30 Fundamentals 2.3 Creating an NC program NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 57

N130 G1 G40 Y-72 F3000

; Deselection of the milling tool radius compensation. N140 G0 Z200 M5 M9 ; Retraction of the milling tool, spin- dle + cooling off. N150 T="SF10" ; Preselection of the tool with name SF10. N160 M6 ; Load the tool into the spindle. N170 S2800 M3 M8 ; Speed, direction of rotation, cooling on. N180 G90 G64 G54 G17 G0 X0 Y0 ; Basic settings for the geometry and approach starting point. N190 G0 Z2 N200 POCKET4(2,0,1,-5,15,0,0,0,0,0,800,1300,0,21,5,,,2,0.5) ; Call pocket milling cycle. N210 G0 Z200 M5 M9 ; Retraction of the milling tool, spin- dle + cooling off. N220 T="ZB6" ; Call 6 mm centering drill. N230 M6 N240 S5000 M3 M8 N250 G90 G60 G54 G17 X25 Y0 ; Exact stop G60 for exact positioning. N260 G0 Z2 N270 MCALL CYCLE82(2,0,1,-2.6,,0) ; Modal call of the drilling cycle. N280 POSITION: ; Jump mark for repetition. N290 HOLES2(0,0,25,0,45,6) ; Position pattern for drilling. N300 ENDLABEL: ; End delimiter for repetition. N310 MCALL ; Reset modal call. N320 G0 Z200 M5 M9 N330 T="SPB5" ; Call D 5 mm drill. N340 M6 N350 S2600 M3 M8 N360 G90 G60 G54 G17 X25 Y0 N370 MCALL CYCLE82(2,0,1,-13.5,,0) ; Modal call of the drilling cycle. N380 REPEAT POSITION ; Repetition of the position descrip- tion from centering. N390 MCALL ; Resetting of the drilling cycle. N400 G0 Z200 M5 M9 N410 M30 ; End of program. Fundamentals 2.3 Creating an NC program NC programming 58 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Tool change method

Note The type of tool change mechanism is specified by the machine OEM during the commissioning. Tool changing on turning machines with tool turrets In turret magazines on turning machines, the tool change, that is the search for and change of the tool, is called with the T command only. Tool changing for machine tools with chain, rotary-plate or plane magazines     ① Spindle ② Gripper ③ Magazine (here: chain magazine) ④ Change position for spindle In chain, rotary-plate and plane magazines, a tool change normally takes place in two stages: 1. The tool is sought in the magazine with the T command. 2. The tool is then loaded into the spindle with the M command. Fundamentals 2.4 Tool change NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 59

Programming of the tool change when tool management is active / not active

Programming of the tool change when tool management is active / not active differs from programming of the tool change with deactivated tool management. Both variants are therefore described: → Tool change with active tool management (Page 60) → Tool change with deactivated tool management (Page 64) Programming of the working plane The appropriate machining plane (Page 33) has to be programmed for the tool change (initial state: G18). This ensures that the tool length compensation is assigned to the correct axis. Activation of the tool offset The tool change activates the tool offset values stored under a D number (Page 80). 2.4.1 Tool change with active tool management Tool management The "Tool management" function ensures that at any given time the correct tool is in the correct location and that the data assigned to the tool are up to date. It also allows fast tool changes and avoids both scrap by monitoring the tool service life and machine downtimes by considering replacement tools. Tool name On a machine tool with active tool management, the tools must be assigned a name and number for clear identification (e.g. "Drill", "3"). The tool can then be called with the tool name, e.g. T="Drill" Note The tool name may not contain any special characters. 2.4.1.1 Tool change with active tool management with the function T=location A direct tool change takes place if the function T=location is programmed. Application For turning machines with circular magazine. Fundamentals 2.4 Tool change NC programming 60 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Selecting a tool

T= T= T= T= Deselecting a tool T0 Meaning T=: Command for tool change and activating the tool offset The following specifications are possible: : Number of the magazine location : Name of tool Note: The correct notation (uppercase/lowercase) must be used when pro‐ gramming a tool name. : Spindle number as address extension Note: The possibility of programming a spindle number as an address extension depends on the configuration of the machine (→ see machine manufacturer's specifications). T0: Tool deselection (magazine location unoccupied) Note If the selected magazine location is not occupied in a tool magazine, the command acts as for T0. The selection of the unoccupied magazine location can be used to position the empty location. Example A circular magazine has locations 1 to 12 with the following tool assignment: Location Tool Internal T number Status 1 Drill, duplo no. = 1 T15 Disabled 2 Not occupied 3 Drill, duplo no. = 2 T10 Enabled 4 Drill, duplo no. = 3 T1 Active 5 ... 12 Not occupied Fundamentals 2.4 Tool change NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 61

The following tool call is programmed in the NC program:

N10 T=1 The call is processed as follows: 1. Magazine location 1 is considered and the tool identifier determined. 2. The tool management recognizes that this tool is blocked and therefore cannot be used. 3. A tool search for T="drill" is initiated in accordance with the set search strategy: "Find the active tool; or select the one with the next highest duplo number." 4. The following usable tool is then found: "Drill", duplo no. 3 (at magazine location 4) This completes the tool selection process and the tool change is initiated. Note If the "Select the first available tool from the group" search strategy is employed, the order of the groups is not defined. In this case, T10 or T1 is selected. When the search strategy "Take the first tool with "active" status from the group" is applied, T1 is loaded. 2.4.1.2 Tool change with active tool management with M6 The tool is selected when the T command is programmed. The tool only becomes active with M6 (including tool offset). Application For machine tools with chain, rotary-plate or plane magazines. Fundamentals 2.4 Tool change NC programming 62 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Selecting a tool

T= T= T= T= Tool change M6 Deselecting a tool T0 Meaning T=: Address for the tool selection The following specifications are possible: : Number of the magazine location : Name of tool Note: The correct notation (uppercase/lowercase) must be used when pro‐ gramming a tool name. : Spindle number as address extension Note: The possibility of programming a spindle number as an address extension depends on the configuration of the machine (→ see machine manufacturer's specifications). M6: M function for the tool change (according to DIN 66025) M6 activates the selected tool (T…) and the tool offset (D...). T0: Tool deselection (magazine location unoccupied) Example Program code Comment N10 T=1 M6 ; Loading of the tool from magazine location 1. N20 D1 ; Selection of tool length compensation. N30 G1 X10 ... ; Machining with tool T=1. ... N70 T="Drill" ; Preselection of the tool with name "Drill". N80 ... ; Machining with tool T=1. ... N100 M6 ; Loading of the drill. N140 D1 G1 X10 ... ; Machining with drill. ... Fundamentals 2.4 Tool change NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 63

Tool change with deactivated tool management

2.4.2.1 Tool change with deactivated tool management with T number A direct tool change takes place if the T number is programmed. Application For turning machines with circular magazine. Syntax Selecting a tool T T= T= Deselecting a tool T0 T0= Meaning T: Address for tool selection including tool change and activation of the tool offset : Spindle number as address extension Note: The possibility of programming a spindle number as an address extension depends on the configuration of the machine (→ see machine manufacturer's specifications). : Number of the tool Range of val‐ ues: 0 ... 32000 T0: Deselecting the active tool Example Program code Comment N10, T1, D1 ; Loading of tool T1 and activation of the tool offset D1. ... N70 T0 ; Deselect tool T1. ... 2.4.2.2 Tool change with deactivated tool management with M6 The tool is selected when the T command is programmed. The tool only becomes active with M6 (including tool offset). Fundamentals 2.4 Tool change NC programming 64 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

For machine tools with chain, rotary-plate or plane magazines.

Syntax Selecting a tool T T= T= Tool change M6 Deselecting a tool T0 T0= Meaning T: Address for the tool selection : Spindle number as address extension Note: The possibility of programming a spindle number as an address extension depends on the configuration of the machine (→ see machine manufacturer's specifications). : Number of the tool Range of val‐ ues: 0 ... 32000 M6: M function for the tool change (according to DIN 66025) M6 activates the selected tool (T…) and the tool offset (D...). T0: Deselecting the active tool Example Program code Comment N10 T1 M6 ; Loading of tool T1. N20 D1 ; Selection of tool length compensation. N30 G1 X10 ... ; Machining with T1. ... N70 T5 ; Preselection of tool T5. N80 ... ; Machining with T1. ... N100 M6 ; Loading of tool T5. N110 D1 G1 X10 ... ; Machining with tool T5 ... Fundamentals 2.4 Tool change NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 65

Behavior with faulty T programming

The behavior with faulty T programming depends on the configuration of the machine: MD22562 TOOL_CHANGE_ERROR_MODE Bit Value Meaning 7 0 Basic setting! With the T programming, a check is made immediately as to whether the NC recogni‐ zes the T number. If not, an alarm is triggered. 1 The programmed T number will only be checked following D selection. If the NC does not recognize the tool number, an alarm is issued during D selection. This response is desirable if, for example, tool programming is also intended to achieve positioning and the tool data is not necessarily available (circular magazine). Fundamentals 2.4 Tool change NC programming 66 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Programmed contour and tool path

Workpiece dimensions are programmed directly (e.g. according to the production drawing). Therefore, tool data, such as milling tool diameter, cutting edge position of the turning tool (counterclockwise/clockwise turning tool) and tool length, does not have to be taken into consideration when creating the program. The control corrects the travel path When machining a workpiece, the tool paths are controlled according to the tool geometry so that the programmed contour can be created with any tool. So that the control can calculate the tool paths, the tool data must be entered in the tool compensation memory of the control. Only the required tool (T...) and the required offset data record (D...) are called via the NC program. While the program is being processed, the control fetches the offset data it requires from the tool offset memory, and corrects the tool path individually for different tools: 3URJUDPPHGFRQWRXU :RUNSLHFH &RUUHFWHG 7RROSDWK 2.5.2 Tool length compensation The tool length compensation compensates for the differences in length between the tools used. The tool length is the distance between the tool carrier reference point and the tool tip: Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 67

Tool carrier reference point

P Tool tip This length is measured and entered in the tool compensation memory of the control together with definable wear values. From this data, the control calculates the traversing movements in the infeed direction. Note The correction value of the tool length depends on the spatial orientation of the tool. 2.5.3 Tool radius compensation The contour and tool path are not identical. The milling tool or cutting edge center point must travel along a path corresponding to the tool radius that is equidistant from the contour (tool center point path). To do this, while executing the program, the control shifts the programmed tool center point path – based on the radius of the active tool (tool offset memory) – so that the tool cutting edge traverses precisely along the programmed contour. (TXLGLVWDQW (TXLGLVWDQW 6 5 R Tool radius S Cutting edge center point The tool radius compensation is described in detail in the "Tool radius compensation (Page 251)" Chapter. Fundamentals 2.5 Tool offsets NC programming 68 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

2 1/2 D tool offset (CUT2D, CUT2DD, CUT2DF, CUT2DFD) (Page 287)

2.5.4 Tool compensation memory The following data must be available in the tool offset memory of the control system for each tool edge: ● Tool type ● Cutting edge position ● Tool geometry variables (length, radius) These data are entered as tool parameters (max. 25). Which parameters are required for a tool depends on the tool type. Any tool parameters that are not required must be set to "zero" (corresponds to the default setting of the system). Note Values that have been entered once in the offset memory are included in the processing at each tool call. Tool type The tool type (drill, milling or turning tool) determines which geometry data are necessary and how they are calculated. Cutting edge position The cutting edge position describes the position of the tool tip in relation to the cutting edge center point. The cutting edge position together with the cutting edge radius is required for the calculation of the tool radius compensation for turning tools (tool type 5xx) (Page 76). Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 69

Tool geometry variables (length, radius)

/ 5 7 T Tool carrier reference point R Tool radius L Tool length The tool geometry variables consist of several components (geometry, wear). The control computes the components to a resulting size (e.g. total length 1, total radius). The relevant overall dimension becomes operative when the offset memory is activated. How these values are calculated in the axes is determined by the tool type and the current plane (G17/G18/G19). 2.5.5 Tool types 2.5.5.1 Tool type number and tool groups Each tool type is assigned a unique 3-digit number. The assignment of the tool to one of the following technologies or tool groups is realized using the first digit (the hundreds position): Tool type Tool group 1xy Milling tools (Page 71) 2xy Drills (Page 73) 3xy Reserved 4xy Grinding tools (Page 74) 5xy Turning tools (Page 76) 6xy Reserved 7xy Special tools (Page 78) Fundamentals 2.5 Tool offsets NC programming 70 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

The following tool types are available in the "Milling tools" group:

100 Milling tool according to CLDATA (Cutter Location Data) 110 Ball end mill 111 Cylindrical die-sinking milling cutter 120 End milling cutter without corner rounding 121 End mill with corner rounding 130 Angle head cutter without corner rounding 131 Angle head mill with corner rounding 140 Facing tool 145 Thread cutter 150 Side mill 151 Saw 155 Bevel cutter (without corner rounding) 156 Bevel cutter with corner rounding 157 Tapered die milling tool 160 Drill and thread milling cutter Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 71

The following diagrams provide an overview of which milling tool parameters are entered in the

compensation memory:    5 / // / 7 7 ① Tool ② Tool holder ③ Tool adapter T Adapter reference point (for inserted tool = tool carrier reference point) T' Tool carrier reference point L1 Geometry - length 1 L1' Adapter dimension - length 1 L1 + L1' Total length L1 R Radius Tool parameters Meaning $TC_DP1 Tool type 1xy $TC_DP3 Geometry - length 1 $TC_DP6 Geometry - radius $TC_DP21 Adapter dimension - length 1 ● Wear values corresponding to the requirements. ● Other values should be set to 0. Fundamentals 2.5 Tool offsets NC programming 72 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Tool carrier reference point

T' Tool carrier reference point L1 Geometry - length 1 R Tool radius L1' Base dimension - length 1 L2' Base dimension - length 2 L3' Base dimension - length 3 Tool parameters Meaning $TC_DP1 Tool type $TC_DP3 Geometry - length 1 $TC_DP6 Geometry - radius $TC_DP21 Base dimension - length 1 $TC_DP22 Base dimension - length 2 $TC_DP23 Base dimension - length 3 ● Wear values corresponding to the requirements. ● Other values should be set to 0. 2.5.5.3 Drills The following tool types are available in the "Drills" group: No. Tool type 200 Twist drill 205 Drill 210 Boring bar Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 73

Tap regular thread

241 Tap fine thread 242 Tap Whitworth thread 250 Reamer Tool parameters The following diagram provides an overview of which drill tool parameters are entered in the compensation memory: / 7 T Tool carrier reference point L1 Length 1 Tool parameters Meaning $TC_DP1 Tool type $TC_DP3 Geometry - length 1 ● Wear values corresponding to the requirements. ● Other values should be set to 0. 2.5.5.4 Grinding tools The following tool types are available in the "Grinding tools" group: 400 Surface grinding wheel 401 Surface grinding wheel with monitoring 402 Surface grinding wheel without monitoring without base dimension (TOOLMAN) 403 Surface grinding wheel with monitoring without base dimension for grinding wheel periph‐ eral speed GWPS 410 Facing wheel 411 Facing wheel (TOOLMAN) with monitoring 412 Facing wheel (TOOLMAN) without monitoring 413 Facing wheel with monitoring without base dimension for grinding wheel peripheral speed GWPS 490 Dresser Fundamentals 2.5 Tool offsets NC programming 74 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

The following diagram provides an overview of which grinding tool parameters are entered in

the compensation memory: ˞ 7 7 / / 5 / / T Tool carrier reference point T' Tool holder reference point L1 Geometry - length 1 L1' Base dimension - length 1 L2 Geometry - length 2 L2' Base dimension - length 2 R Radius α Angle of inclined wheel Cutting edge-specific parameters Meaning $TC_DP1 Tool type 4xy $TC_DP2 Cutting edge position $TC_DP3 Geometry length 1 $TC_DP4 Geometry length 2 $TC_DP6 Radius $TC_DP21 Base dimension length 1 $TC_DP22 Base dimension length 2 ● Wear values corresponding to the requirements. ● Set other values to 0. Tool-specific parameters Meaning $TC_TPG1 Spindle number $TC_TPG2 Chaining rule 1) $TC_TPG3 Minimum wheel radius Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 75

Minimum wheel width

$TC_TPG5 Actual wheel width $TC_TPG6 Maximum speed $TC_TPG7 Maximum circumferential velocity $TC_TPG8 Angle of inclined wheel $TC_TPG9 Parameter number for radius calculation $TC_TPG_DRSPATH Directory path to the dressing program $TC_TPG_DRSPROG Dressing program name 1) The geometry length compensations, wear and base dimension can be chained for the left and right tool nose radius compensation. This means that the length compensations for the left cutting edge are changed so that the values are also automatically entered for the right cutting edge, and vice versa. 2.5.5.5 Turning tools The following tool types are available in the "Turning tools" group: 500 Roughing tool 510 Finishing tool 520 Plunge cutter 530 Parting tool 540 Threading tool 550 Button tool / forming tool (TOOLMAN) 560 Rotary drill (ECOCUT) 580 Probe with cutting edge position parameters Fundamentals 2.5 Tool offsets NC programming 76 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

The following diagram provides an overview of which turning tool parameters are entered in the

compensation memory:  5 3 6         / / 7 *;= / 7 / / ; = ① Cutting edge position (1 ... 9) for machining behind the turning center P Tool tip S Cutting edge center point R Cutting edge radius T Tool carrier reference point T' Tool holder reference point L1 Geometry - length 1 L2 Geometry - length 2 L1' Base dimension - length 1 L2' Base dimension - length 2 L3' Base dimension - length 3 Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 77

Cutting edge position

$TC_DP3 Geometry - length 1 $TC_DP4 Geometry - length 2 $TC_DP6 Geometry - radius (cutting edge radius) $TC_DP21 Base dimension - length 1 $TC_DP22 Base dimension - length 2 $TC_DP23 Base dimension - length 3 ● Wear values corresponding to the requirements. ● Set other values to 0. 2.5.5.6 Special tools The following tool types are available in the "Special tools" group: 700 Slotting saw 710 3D probe 711 Edge probe 712 Mono probe 713 L probe 714 Star probe 725 Calibration tool 730 Stop 731 Spindle sleeves 732 End support Fundamentals 2.5 Tool offsets NC programming 78 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

The following diagram provides an overview of which tool parameters for "Slotting saw" tool

type are entered in the compensation memory: 7 E / N G / / G / EN T' Tool carrier reference point L1 Geometry - length 1 L2 Geometry - length 2 d Diameter b Slot width k Projection Tool parameters Meaning $TC_DP1 Tool type $TC_DP3 Geometry - length 1 $TC_DP4 Geometry - length 2 $TC_DP6 Diameter $TC_DP7 Slot width $TC_DP8 Projection $TC_DP21 Base dimension length 1 $TC_DP22 Base dimension length 2 $TC_DP23 Base dimension length 3 ● Wear values corresponding to the requirements. ● Other values should be set to 0. Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 79

Activating / deactivating tool offsets (D, D0):

Cutting edges 1 to 8 of a tool (with active tool management 12) can be assigned different tool offset data blocks (e.g. different correction values for the left and right cutting edges of a grooving tool). The offset data (including the data for the tool length compensation) of a special cutting edge is activated by calling the D number. When D0 is programmed, offsets for the tool have no effect. A tool radius compensation must also be activated by G41/G42. Note Tool length compensations take immediate effect when the D number is programmed. If no D number is programmed, the default setting defined by the machine data is active for a tool change (→ see machine manufacturer's specifications). Syntax D X... Y... Z... G41/G42 X... Y... Z... G40 D0 Meaning D: Address for activating an offset data block for the active tool The tool length compensation is applied with the first programmed traverse of the associated length compensation axis. Notice: A tool length compensation can also take effect without D programming, if the auto‐ matic activation of a tool edge has been configured for the tool change (→ see ma‐ chine manufacturer's specifications). : The tool offset data block to be activated is specified via the D number. The type of D programming depends on the configuration of the machine (→ see information provided by the machine manufacturer). There are the following options: ● D number = cutting edge number D numbers ranging from 1 to max. 12 are available for every tool T (without TOOLMAN) or T="Name" (with TOOLMAN). These D numbers are assigned di‐ rectly to the tool cutting edges. An offset data set ($TC_DPx[,]) is assigned to each D number (= cutting edge number). ● Free selection of D numbers The D numbers can be freely assigned to the cutting edge numbers of a tool. A machine data specifies the upper limit for the D numbers that may be used. Range of values: 0 ... 32000 D0: Deactivating the offset data block for the active tool Fundamentals 2.5 Tool offsets NC programming 80 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Command for activating the tool radius compensation with machining direction left of

the contour G42: Command for activating the tool radius compensation with machining direction right of the contour G40: Command for deactivating the tool radius compensation Additional information on G40/G41/G42 is provided in the section "Tool radius compensation (Page 251)". Examples Example 1: Tool change with T command (turning) Program code Comment N10, T1, D1 ; Load tool T1 and activate tool offset data block D1 of T1. N11 G0 X... Z... ; The tool length compensations are applied. N50, T4, D2 ; Load tool T4 and activate tool offset data block D2 of T4. ... N70 G0 Z... D1 ; Activate other cutting edge D1 for tool T4. Example 2: Different correction values for the left and right cutting edges of a grooving tool 3DUWSURJUDP    ; = 17 1*;= 1*'; 1'=  1 1 1    ① Plunge turning tool (T2) ② Cutting edge D1 ③ Cutting edge D6 See also Tool radius compensation (Page 68) Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 81

Change in the tool offset data

In the standard setting, a change in the tool offset data takes only effect the next time the T or D number is programmed. The following machine data can be used to specify that entered tool offset data are activated immediately: MD9440 $MM_ACTIVATE_SEL_USER WARNING Risk of collision If MD9440 is set, tool offsets resulting from changes in tool offset data during the part program stop, are applied when the part program is continued. 2.5.7 Suppressing tool offsets (SUPD) The SUPD instruction allows you to suppress the tool offsets block by block. Tool offset deselection with D0 provides the benefit that the tool offset data are retained with SUPD. As a result, the tool offset data need not be reactivated by programming the D number. SUPD is only used to suppress the tool length compensation, e.g. in part program blocks in which the zero point shall be included in calculation instead of the tool length. It is not recommended to use it with active G41/G42 for additional suppression of the tool radius compensations. Syntax D X... Y... Z... X... Y... Z... SUPD ... D0 Meaning SUPD: G command for deactivating the offset data block for the active tool in the active block Effectiveness: Non-modal Constraints ● SUPD shall only be used in linear blocks. ● SUPD cannot be used in synchronized actions. Fundamentals 2.5 Tool offsets NC programming 82 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

SUPD may not be used in conjunction with the following functions:

– 3D tool radius compensation for 3D face milling (CUT3DFxx) – Curve tables (CTAB) ● The use of SUPD with active tool radius compensation (G41/G42) is possible, but not recommended. To activate the function nevertheless, the following setting data must be set to "0": SD42480 $SC_STOP_CUTCOM_STOPRE = 0 This prevents that the program is interrupted with active G41/G42. Example When traversing, the tool length shall be suppressed in the subprogram SUB_SUP. Part program Program code Comment ... N300 $P_UIFR[1]=CTRANS(X,1000,Y,400,Z,-120) N310 T="BALL_D3" N320 M6 N330 TRAFOOF N340 G54 G0 Z49 D1 N350 G0 X1100 Y500 C0 A0 N360 SUB_SUP ; Calling the subroutine. N370 G0 X1200 N380 M30 Subprogram with D0 Program code Comment N10 PROC SUB_SUP N20 DEF INT NUMBER N30 NUMBER=$P_TOOL N40 G0 Z49 D0 ; Deselection of the tool offsets N50 D=NUMBER ; Reselection of tool offsets. N60 RET Subprogram with SUPD Program code Comment N10 PROC SUB_SUP N40 G0 Z49 SUPD ; Suppression of tool offsets in the active block. N60 RET Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 83

Programmable tool offset (TOFFL, TOFF, TOFFR, TOFFLR):

Based on the TOFFx addresses, the user can modify the effective tool length and the effective tool radius in the NC program, without changing the tool offset data stored in the compensation memory. These programmed offsets are deleted again at the end of the program. Syntax Tool length offset TOFFL= TOFFL[1]= TOFFL[2]= TOFFL[3]= TOFF[]= The tool length can be changed simultaneously in all three components. However, commands of the TOFFL/TOFFL[1..3] group and commands of the TOFF[] group may not be used simultaneously in one block. Similarly TOFFL and TOFFL[1] may not be written simultaneously in one block. If all three tool length components are not programmed in one block, the components not programmed remain unchanged. In this way, it is possible to build up offsets for several components block-by-block. However, this only applies as long as the tool components have been modified only with either TOFFL or TOFF. Changing the programming version from TOFFL to TOFF or vice versa deletes any previously programmed tool length offsets (see example 3). Tool radius offset TOFFR= Simultaneous tool length offset and tool radius offset TOFFLR= Meaning TOFFL: Correction of the effective tool length TOFFL can be programmed with or without index: TOFFL=... The programmed offset value is applied in the same direction as the tool length component L1 stored in the compensation memory. The TOFFL and TOFFL[1] instructions have an identical effect. TOFFL[1]=... TOFFL[2]=... TOFFL[3]=... The programmed offset value is effective in the same direction as the tool length components L1, L2 and L3 stored in the offset memory. Note: How these tool length compensation values are calculated in the axes is determined by the tool type and the current working plane (G17/G18/G19). Fundamentals 2.5 Tool offsets NC programming 84 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Correction of the tool length in the component parallel to the specified geometry axis

TOFF is applied in the direction of the tool length component which is effective with non- rotated tool (orientable tool carrier or orientation transformation) parallel to the geometry axis specified in the index. Note: A frame does not influence the assignment of the programmed values to the tool length components. This means that the workpiece coordinate system (WCS) is not used to assign the tool length components to the geometry axes, but rather the tool coordinate system in the basic tool position. : Identifier of the geometry axis TOFFR: Correction of the effective tool radius TOFFR changes the effective tool radius with active tool radius compensation by the programmed offset value. TOFFLR: Correction of the effective tool length in the component L1 and the effective tool radius Note: For tools with corner rounding (types 111, 121, 131 and 156), TOFFLR also corrects the corner radius. : Offset value Type: REAL Examples Example 1: Positive tool length offset The active tool is a drill with length L1 = 100 mm. The active plane is G17. This means that the drill points in the Z direction. The effective drill length is to be increased by 1 mm. The following variants are available for programming this tool length offset: ● TOFFL=1 ● TOFFL[1]=1 ● TOFF[Z]=1 Example 2: Negative tool length offset The active tool is a drill with length L1 = 100 mm. The active plane is G18. This means that the drill points in the Y direction. The effective drill length is to be decreased by 1 mm. The following variants are available for programming this tool length offset: ● TOFFL=-1 ● TOFFL[1]=-1 ● TOFF[Y]=1 Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 85

Example 3: Change of programming version from TOFFL to TOFF

The active tool is a milling tool. The active plane is G17. Program code Comment N10 TOFFL[1]=3 TOFFL[3]=5 ; Effective offsets: L1=3, L2=0, L3=5 N20 TOFFL[2]=4 ; Effective offsets: L1=3, L2=4, L3=5 N30 TOFF[Z]=1.3 ; Effective offsets: L1=0, L2=0, L3=1.3 Example 4: Assignment of the offset values after a plane change Program code Comment N10 $TC_DP1[1,1]=120 N20 $TC_DP3[1,1]= 100 ; Tool length L1=100 mm. N30 T1 D1 G17 N40 TOFF[Z]=1.0 ; Offset in Z direction (corresponds to L1 for G17). N50 G0 X0 Y0 Z0 ; Machine axis position X0 Y0 Z101 N60 G18 G0 X0 Y0 Z0 ; Machine axis position X0 Y100 Z1. N70 G17 N80 TOFFL=1.0 ; Offset in L1 direction (corresponds to Z for G17). N90 G0 X0 Y0 Z0 ; Machine axis position X0 Y0 Z101. N100 G18 G0 X0 Y0 Z0 ; Machine axis position X0 Y101 Z0. In this example, the offset of 1 mm in the Z axis is retained when changing to G18 in block N60; the effective tool length in the Y axis is the unchanged tool length of 100 mm. However, in block N100, the offset is effective in the Y axis when changing to G18 as it was assigned to tool length L1 in the programming, and this length component is effective in the Y axis with G18. Example 5: Simultaneous tool length offset and tool radius offset a, end milling cutter without corner rounding (tool type 120): Program code Comment ... TOFFLR=0.1 ; Effective offsets: ; Tool length offset (L1) = 5 ; Tool radius offset = 5 ... b, end mill with corner rounding (tool type 121): Program code Comment ... TOFFLR=0.1 ; Effective offsets: ; Tool length offset (L1) = 0.1 ; Tool radius offset = 0.1 ; Offset corner radius = 0.1 ... Fundamentals 2.5 Tool offsets NC programming 86 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Tool length offsets

Depending on the type of programming, programmed tool length offsets are assigned either to the tool length components L1, L2 and L3 (TOFFL) stored in the compensation memory or to the geometry axes (TOFF). The programmed offsets are treated accordingly for a plane change (G17/G18/G19 ↔ G17/G18/G19): ● If the offset values are assigned to the tool length components, the directions in which the programmed offsets apply are replaced accordingly. ● If the offset values are assigned to the geometry axes, a plane change does not affect the assignment in relation to the coordinate axes. The following setting data is evaluated when assigning the programmed offset values to the tool length components: SD42940 $SC_TOOL_LENGTH_CONST (change of tool length components on change of planes). SD42950 $SC_TOOL_LENGTH_TYPE (assignment of the tool length offset independent of tool type). If this setting data has valid values not equal to 0, then these have priority over the contents of G group 6 (plane selection G17/G18/G19) or the tool type ($TC_DP1[, ]) contained in the tool data. This means that this setting data affects the evaluation of the offsets in the same way as the tool length components L1 to L3. Tool radius offset The TOFFR address has almost the same effect as the OFFN (Page 251) address. There is only a difference with active peripheral curve transformation (TRACYL) and active slot side compensation. In this case, the tool radius is affected by OFFN with a negative sign, but by TOFFR with a positive sign. OFFN and TOFFR can be effective simultaneously. They then generally have an additive effect (except for slot side compensation). Tool change All offset values are retained during a tool change (cutting edge change). This means that they are also effective for the new tool (new cutting edge). System variables for reading the current offset values The currently effective offsets can be read with the following system variables: System variable Meaning $P_TOFFL [] with 0 ≤ n ≤ 3 Reads the current offset value of TOFFL (for n = 0) or TOFFL[1...3] (for n = 1, 2, 3) in the preprocessing context. $P_TOFF [] Reads the current offset value of TOFF[] in the preprocessing context. $P_TOFFR Reads the current offset value of TOFFR in the preprocessing context. $P_TOFFCR Reads the current offset value of the corner radius in the preprocessing context. Fundamentals 2.5 Tool offsets NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 87

with 0 ≤ n ≤ 3

Reads the current offset value of TOFFL (for n = 0) or TOFFL[1...3] (for n = 1, 2, 3) in the main run context (synchronized actions). $AC_TOFF[] Reads the current offset value of TOFF[] in the main run con‐ text (synchronized actions). $AC_TOFFR Reads the current offset value of TOFFR in the main run context (synchronized actions). $AC_TOFFCR Reads the current offset value of the corner radius in the main run con‐ text (synchronized actions). Note The system variables $AC_TOFFL, $AC_TOFF, AC_TOFFR and AAC_TOFFCR trigger an automatic preprocessing stop when reading from the preprocessing context (NC program). Applications The "Programmable tool offset" function is especially interesting for ball mills and milling tools with corner radii as these are often calculated in the CAM system to the ball center instead of the ball tip. However, the tool tip is generally measured when the tool is measured, and stored as tool length in the compensation memory. For the 3D tool radius compensation with a ball mill it is advantageous to correct the tool length and radius by the same value simultaneously. The TOFFLR address is available to the user for this purpose. Fundamentals 2.5 Tool offsets NC programming 88 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Spindle speed (S), spindle direction of rotation (M3, M4, M5)

The spindle speed and direction of rotation values set the spindle in rotary motion and provide the conditions for chip removal. ; ; ; = Other spindles may be available in addition to the main spindle (e.g. the counterspindle or an actuated tool on turning machines). As a rule, the main spindle is declared the master spindle in the machine data. This assignment can be changed using an NC command. Syntax S... / S=... M3 / M=3 M4 / M=4 M5 / M=5 SETMS(< n>) ... SETMS Meaning S…: Spindle speed in rpm for the master spindle S=...: Spindle speed in rpm for spindle Note: The speed specified with S0=… applies to the master spindle. Fundamentals 2.6 Spindle motion NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 89

Direction of spindle rotation clockwise for master spindle

M=3: Spindle direction of rotation clockwise for spindle M4: Direction of spindle rotation counter-clockwise for master spindle M=4: Spindle direction of rotation counter-clockwise for spindle M5: Spindle stop for master spindle M=5: Spindle stop for spindle SETMS(): Set spindle as master spindle SETMS: If SETMS is programmed without a spindle name, the configured master spindle is used instead. Note Up to three S-values can be programmed per NC block, e.g.: S... S2=... S3=... Note SETMS must be in a separate block. Example S1 is the master spindle, S2 is the second spindle. The part is to be machined from two sides. To do this, it is necessary to divide the operations into steps. After the cut-off point, the synchronizing device (S2) takes over machining of the workpiece after the cut off. To do this, this spindle S2 is defined as the master spindle to which G95 then applies. 6 6 Program code Comment N10 S300 M3 ; Speed and direction of rotation for drive spindle = pre- set master spindle. ... ; Machining of the right-hand workpiece side. N100 SETMS(2) ; S2 is now the master spindle. N110 S400 G95 F… ; Speed for new master spindle. ... ; Machining of the left-hand workpiece side. Fundamentals 2.6 Spindle motion NC programming 90 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

; Switching back to master spindle S1.

Further information Interpretation of the S value for the master spindle If function G331 or G332 is active in G group 1 (modally valid motion commands), the programmed S-value will always be interpreted as the speed in rpm. Otherwise, the interpretation of the S-value will depend upon G group 15 (feedrate type): If G96, G961 or G962 is active, the S-value is interpreted as a constant cutting rate in m/min; otherwise, it is interpreted as a speed in rpm. Changing from G96/G961/G962 to G331/G332 sets the value of the constant cutting rate to zero; changing from G331/G332 to a function within the G group 1 other than G331/G332 sets the speed value to zero. The corresponding S-values have to be reprogrammed if required. Preset M commands M3, M4, M5 In a block with axis commands, functions M3, M4, M5 are activated before the axis movements commence (basic setting on the control). Example: Program code Comment N10 G1 F500 X70 Y20 S270 M3 ; The spindle ramps up to 270 rpm and the move- ments then executed in X and Y. N100 G0 Z150 M5 ; Spindle stop before the retraction movement in Z. Note Machine data can be used to set when axis movements should be executed; either once the spindle has powered up to the setpoint speed, or immediately after the programmed switching operations have been traversed. Working with multiple spindles Five spindles (master spindle plus four additional spindles) can be available in one channel at the same time. One of the spindles is defined in machine data as the master spindle. Special functions such as thread cutting, tapping, revolutional feedrate, and dwell time apply to this spindle. For the remaining spindles (e.g. a second spindle and an actuated tool) the numbers corresponding to the speed and the direction of rotation / spindle stop must be specified. Example: Program code Comment N10 S300 M3 S2=780 M2=4 ; Master spindle: 300 rpm, CW rotation 2nd spindle: 780 rpm, CCW rotation Programmable switchover of master spindle Fundamentals 2.6 Spindle motion NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 91

The SETMS() command can be used in the NC program to define any spindle as the

master spindle. SETMS must be in a separate block. Example: Program code Comment N10 SETMS (2) ; Spindle 2 is now the master spindle. Note The speed specified with S..., along with the functions programmed with M3, M4, M5, now apply to the newly declared master spindle. If SETMS is programmed without a spindle name, the master spindle programmed in the machine data is used instead. 2.6.2 Tool cutting speed (SVC) As an alternative to the spindle speed, the tool cutting speed, which is more commonly used in practice, can be programmed for milling operations.    ① Spindle speed ② Tool radius ③ Tool cutting speed The control uses the radius of the active tool to calculate the effective spindle speed from the programmed tool cutting speed: S = (SVC * 1000) / (RT * 2π) with: S: Spindle speed in rpm SVC: Tool cutting speed in m/min or ft/min RT: Radius of the active tool in mm The tool type ($TC_DP1) of the active tool is not taken into account. Fundamentals 2.6 Spindle motion NC programming 92 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

The programmed tool cutting speed is independent of path feedrate F and G function group 15

(feedrate type). The direction of rotation and the spindle start are implemented via M3 and M4, and the spindle stop via M5. A change to the tool radius data in the offset memory will be applied the next time a tool offset is selected or the next time the active offset data is updated. Changing the tool or selecting/deselecting a tool offset data set generates a recalculation of the effective spindle speed. Requirements Programming of the tool cutting speed requires: ● The geometric ratios of a rotating tool (milling cutter or drilling tool) ● An active tool offset data set Syntax T... D... SVC[]= ... S... M3/M4 Meaning SVC: Keyword for programming of the tool cutting speed []: Number of spindle This address extension specifies which spindle the programmed cutting speed is to be applied for. In the absence of an address extension, the rate is always applied to the master spindle. Note: A separate cutting speed can be preset for each spindle. Note: Programming SVC without an address extension requires that the master spin‐ dle has the active tool. If the master spindle changes, the user will need to select a tool accordingly. : Value of tool cutting speed Unit: m/min (for G71/G710) or ft/min (for G70/G700) T... D...: The tool radius must be established in the block with SVC. Thus, a correspond‐ ing tool including tool offset data block must either be active or selected in the block. There is no fixed sequence for SVC and T/D selection during program‐ ming in the same block. S... M3/M4: Programming of the spindle speed will effect deselection of the tool cutting speed. Note: Switching between SVC programming and S programming is possible at any time, even while the spindle is rotating. In each case, the value that is not active is deleted. Fundamentals 2.6 Spindle motion NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 93

SVC programming is not possible if the following spindle feedrate movements are active:

● Constant cutting speed: G96/G961/G962 S... (Page 98) ● Constant grinding wheel peripheral speed: SUG (Page 103) ● Position spindle: SPOS/SPOSA/M19 (Page 117) ● ; Switch master spindle over to axis mode: M70 (Page 117) Conversely, programming one of these functions will effect a deselection of SVC (tool cutting speed). Note Maximum tool speed System variable $TC_TP_MAX_VELO[] can be used to preset a maximum tool speed (spindle speed). If no speed limit has been defined, there will be no monitoring. Note The tool paths of "standard tools" generated, e.g. using CAD systems which already take the tool radius into account and only contain the deviation from the standard tool in the tool nose radius, are not supported in conjunction with SVC programming. Examples The following shall apply to all examples: Tool carrier = spindle (for standard milling) Example 1: Milling cutter 6 mm radius Program code Comment N10 G0 X10 T1 D1 ; Selection of milling tool with, e.g. $TC_DP6[1,1] = 6 (tool radius = 6 mm) N20 SVC=100 M3 ; Cutting speed = 100 m/min ⇒ Resulting spindle speed: S = (100 m/min * 1000) / (6.0 mm * 2 * 3.14) = 2653.93 rpm N30 G1 X50 G95 FZ=0.03 ; SVC and tooth feedrate ... Example 2: Tool selection and SVC in the same block Program code Comment N10 G0 X20 N20 T1 D1 SVC=100 ; Tool and offset data set selection together with SVC in block (no specific sequence). N30 X30 M3 ; Spindle start with CW direction of rotation, cut- ting speed 100 m/min Fundamentals 2.6 Spindle motion NC programming 94 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

N40 G1 X20 F0.3 G95

; SVC and revolutional feedrate Example 3: Defining cutting speeds for two spindles Program code Comment N10 SVC[3]=100 M6 T1 D1 N20 SVC[5]=200 ; The tool radius of the active tool offset is the same for both spindles. The effective speed is dif- ferent for spindle 3 and spindle 5. Example 4: Assumptions: Master or tool change is determined by the tool carrier: MD20124 $MC_TOOL_MANAGEMENT_TOOL CARRIER > 1 In the event of a tool change the old tool offset is retained. A tool offset for the new tool is only activated when D is programmed: MD20270 $MC_CUTTING_EDGE_DEFAULT = - 2 Program code Comment N10 $TC_MPP1[9998,1]=2 ; Magazine location is tool carrier N11 $TC_MPP5[9998,1]=1 ; Magazine location is tool carrier 1 N12 $TC_MPP_SP[9998,1]=3 ; Tool carrier 1 is assigned to spindle 3 N20 $TC_MPP1[9998,2]=2 ; Magazine location is tool carrier N21 $TC_MPP5[9998,2]=4 ; Magazine location is tool carrier 4 N22 $TC_MPP_SP[9998,2]=6 ; Tool carrier 4 is assigned to spindle 6 N30 $TC_TP2[2]="WZ2" N31 $TC_DP6[2,1]=5.0 ; Radius = 5.0 mm of T2, offset D1 N40 $TC_TP2[8]="WZ8" N41 $TC_DP6[8,1]=9.0 ; Radius = 9.0 mm of T8, offset D1 N42 $TC_DP6[8,4]=7.0 ; Radius = 7.0 mm of T8, offset D4 ... N100 SETMTH(1) ; Set master tool carrier number N110 T="WZ2" M6 D1 ; Tool T2 is loaded and offset D1 is activated. N120 G1 G94 F1000 M3=3 SVC=100 ; S3 = (100 m/min * 1000) / (5.0 mm * 2 * 3.14) = 3184.71 rpm N130 SETMTH(4) ; Set master tool carrier number N140 T="WZ8" ; Corresponds to T8="WZ8" N150 M6 ; Corresponds to M4=6 Tool "WZ8" is in the master tool carrier, but because MD20270=–2, the old tool offset remains active. N160 SVC=50 ; S3 = (50 m/min * 1000) / (5.0 mm * 2 * 3.14) = 1592.36 rpm The offset applied to tool carrier 1 is still active and as- signed to spindle 3. N170 D4 ; Offset D4 of the new tool "WZ8" becomes active (in tool carrier 4). Fundamentals 2.6 Spindle motion NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 95

; S6 = (300 m/min * 1000) / (7.0 mm * 2 * 3.14) = 6824.39 rpm

Spindle 6 is assigned to tool carrier 4. Example 5: Assumptions: Spindles are tool carriers at the same time: MD20124 $MC_TOOL_MANAGEMENT_TOOL CARRIER = 0 In the event of a tool change, tool offset data set D4 is selected automatically: MD20270 $MC_CUTTING_EDGE_DEFAULT = 4 Program code Comment N10 $TC_MPP1[9998,1]=2 ; Magazine location is tool carrier N11 $TC_MPP5[9998,1]=1 ; Magazine location is tool carrier 1 = spindle 1 N20 $TC_MPP1[9998,2]=2 ; Magazine location is tool carrier N21 $TC_MPP5[9998,2]=3 ; Magazine location is tool carrier 3 = spindle 3 N30 $TC_TP2[2]="WZ2" N31 $TC_DP6[2,1]=5.0 ; Radius = 5.0 mm of T2, offset D1 N40 $TC_TP2[8]="WZ8" N41 $TC_DP6[8,1]=9.0 ; Radius = 9.0 mm of T8, offset D1 N42 $TC_DP6[8,4]=7.0 ; Radius = 7.0 mm of T8, offset D4 ... N100 SETMS(1) ; Spindle 1 = master spindle N110 T="WZ2" M6 D1 ; Tool T2 is loaded and offset D1 is activated. N120 G1 G94 F1000 M3 SVC=100 ; S1 = (100 m/min * 1000) / (5.0 mm * 2 * 3.14) = 3184.71 rpm N200 SETMS(3) ; Spindle 3 = master spindle N210 M4 SVC=150 ; S3 = (150 m/min * 1000) / (5.0 mm * 2 * 3.14) = 4777.07 rpm Refers to tool offset D1 of T="WZ2", S1 continues to turn at previous speed. N220 T="WZ8" ; Corresponds to T8="WZ8" N230 M4 SVC=200 ; S3 = (200 m/min * 1000) / (5.0 mm * 2 * 3.14) = 6369.43 rpm Refers to tool offset D1 of T="WZ2". N240 M6 ; Corresponds to M3=6 Tool "WZ8" is in the master spindle, tool offset D4 of the new tool becomes active. N250 SVC=50 ; S3 = (50 m/min * 1000) / (7.0 mm * 2 * 3.14) = 1137.40 rpm Offset D4 on master spindle is active. N260 D1 ; Offset D1 of new tool "WZ8" active. N270 SVC[1]=300 ; S1 = (300 m/min * 1000) / (9.0 mm * 2 * 3.14) = 5307.86 rpm S3 = (50 m/min * 1000) / (9.0 mm * 2 * 3.14) = 884.64 rpm ... Further information Tool radius Fundamentals 2.6 Spindle motion NC programming 96 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

The following tool offset data (associated with the active tool) affect the tool radius when:

● $TC_DP6 (radius - geometry) ● $TC_DP15 (radius - wear) ● $TC_SCPx6 (offset for $TC_DP6) ● $TC_ECPx6 (offset for $TC_DP6) The following are not taken into account: ● Online radius compensation ● Allowance on the programmed contour (OFFN) Tool radius compensation (G41/G42) Although tool radius compensation (G41/G42) and SVC both relate to the tool radius, they are not functionally linked and are independent of one another. Tapping without compensating chuck (G331, G332) SVC programming is also possible in conjunction with G331 or G332. Synchronized actions SVC cannot be programmed from synchronized actions. Reading the cutting speed and the spindle speed programming variant The cutting speed of a spindle and the speed programming variant (spindle speed S or tool cutting speed SVC) can be read using system variables: ● With preprocessing stop in the part program via system variables: $AC_SVC[] Effective cutting speed when the current main run block for spindle with number was preprocessed. $AC_S_TYPE[] Effective spindle speed programming variant when the cur‐ rent main run block for spindle with number was pre‐ processed. Value: Meaning: 1 Spindle speed S in rpm 2 Tool cutting speed SVC in m/min or ft/min ● Without preprocessing stop in the part program via system variables: $P_SVC[] Programmed cutting speed for spindle $P_S_TYPE[] Programmed spindle speed programming variant for spindle Value: Meaning: 1 Spindle speed S in rpm 2 Tool cutting speed SVC in m/min or ft/min Fundamentals 2.6 Spindle motion NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 97

Constant cutting rate (G96/G961/G962, G97/G971/G972, G973, LIMS, SCC)

If the "Constant cutting speed" function is active, the spindle speed is modified as a function of the respective workpiece diameter so that the cutting speed S in m/min or ft/min remains constant at the tool edge.    ① Constant cutting rate ② Increased spindle speed ③ Reduced spindle speed This results in the following advantages: ● Uniformity and consequently improved surface quality of turned parts ● Machining with less wear on tools Syntax Activating/deactivating constant cutting speed for the master spindle: G96/G961/G962 S... ... G97/G971/G972/G973 Speed limitation for the master spindle: LIMS= LIMS[]= Other reference axis for G96/G961/G962: SCC[] Note SCC[] can be programmed together with G96/G961/G962 or separately. Fundamentals 2.6 Spindle motion NC programming 98 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Revolutional feedrate (as for G95 (Page 105)) and constant cutting speed

G95 is activated automatically with G96. If G95 has not been activated previously, a new feedrate value F... has to be specified when G96 is called. G961: Linear feedrate (as for G94 (Page 105)) and constant cutting speed G962: Linear feedrate or revolutional feedrate and constant cutting speed S...: In conjunction with G96, G961 or G962, S... is not interpreted as a spindle speed but rather as a cutting speed. The cutting speed is always applied to the master spindle. Unit: m/min (for G71/G710) or ft/min (for G70/G700) Range of values: 0.1 m/min to 9999 9999.9 m/min G97: Revolutional feedrate and constant spindle speed (constant cutting speed OFF) G971: Linear feedrate and constant spindle speed (constant cutting speed OFF) G972: Linear feedrate or revolutional feedrate and constant spindle speed (constant cutting speed OFF) G973: Revolutional feedrate without spindle speed limitation and constant spindle speed (G97 without LIMS for ISO mode) Note: After G97 (or G971 ... G973), S... is again interpreted as a spindle speed in rpm. In the absence of a new spindle speed being specified, the last speed set with G96 (respec‐ tively G961 or G962) is retained. LIMS: Speed limitation for the master spindle (only applied if G96/G961/G97 active) On machines with selectable master spindles, limitations of differing values can be programmed for up to four spindles within one block. : Number of spindle : Spindle speed upper limit in rpm SCC: If any of the G96/G961/G962 functions are active, SCC[] can be used to assign any geometry axis as a reference axis. Note If G96/G961/G962 is selected for the first time, a constant cutting speed S... must be entered; if G96/G961/G962 is selected again, the entry is optional. Note The speed limitation programmed with LIMS must not exceed the speed limit programmed with G26 or defined in the setting data. Note The reference axis for G96/G961/G962 must be a geometry axis assigned to the channel at the time when SCC[] is programmed. SCC[] can also be programmed when any of the G96/G961/G962 functions are active. Fundamentals 2.6 Spindle motion NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 99

Example 1: Activating the constant cutting speed with speed limitation

Program code Comment N10 SETMS (3) N20 G96 S100 LIMS=2500 ; Constant cutting speed = 100 m/min, max. speed = 2500 rpm ... N60 G96 G90 X0 Z10 F8 S100 LIMS=444 ; Max. speed = 444 rpm Example 2: Defining speed limitation for four spindles Speed limitations are defined for spindle 1 (master spindle) and spindles 2, 3, and 4: Program code N10 LIMS=300 LIMS[2]=450 LIMS[3]=800 LIMS[4]=1500 ... Example 3: Y-axis assignment for face cutting with X axis Program code Comment N10 G18 LIMS=3000 T1 D1 ; Speed limitation at 3000 rpm N20 G0 X100 Z200 N30 Z100 N40 G96 S20 M3 ; Constant cutting speed = 20 m/min, is dependent upon X axis. N50 G0 X80 N60 G1 F1.2 X34 ; Face cutting in X at 1.2 mm/revolution. N70 G0 G94 X100 N80 Z80 N100 T2 D1 N110 G96 S40 SCC[Y] ; Y axis is assigned to G96 and G96 is activated (can be achieved in a single block). Constant cutting speed = 40 m/min, is dependent upon X axis. ... N140 Y30 N150 G01 F1.2 Y=27 ; Plunge-cutting in Y, feedrate F = 1.2 mm/revolution. N160 G97 ; Constant cutting speed off. N170 G0 Y100 Further information Calculation of the spindle speed Fundamentals 2.6 Spindle motion NC programming 100 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Other Control Unit Manuals