Page 1
Preface Fundamental safety instructions Fundamentals SINUMERIK Work preparation SINUMERIK 840D sl NC programming Tables Appendix Programming Manual Valid for Control system SINUMERIK 840D sl / 840DE sl CNC software version 4.93 12/2019 6FC5398-2EP40-0BA0...
Page 2
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.
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).
Page 4
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).
Preface 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.
Table of contents Preface .................................3 Fundamental safety instructions.........................23 General safety instructions.....................23 Warranty and liability for application examples ..............24 Industrial security ........................25 Fundamentals.............................27 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...
Page 8
Table of contents 2.4.2 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 Tool offsets..........................67 2.5.1 Programmed contour and tool path..................67 2.5.2 Tool length compensation ......................67...
Page 9
Table of contents 2.8.4.6 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 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...
Page 10
Table of contents 2.10 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...
Page 11
Table of contents 2.15.1.5 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...
Page 12
Table of contents 3.1.4.5 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...
Page 13
Table of contents 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...
Page 14
Table of contents 3.8.2.2 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...
Page 15
Table of contents 3.9.12 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...
Page 16
Table of contents 3.13.11 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...
Page 18
Table of contents 3.23.1 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...
Page 20
Table of contents 4.3.1 G commands........................1247 4.3.2 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...
Page 21
Table of contents 4.3.53 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...
Fundamental safety instructions 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. ●...
Fundamental safety instructions 1.2 Warranty and liability for application examples 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.
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.
Page 26
Fundamental safety instructions 1.3 Industrial security WARNING 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. ●...
Fundamentals 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.
Page 28
Fundamentals 2.1 Fundamental Geometrical Principles 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: Points P1 to P4 have the following coordinates: Position Coordinates X100 Y50...
Fundamentals 2.1 Fundamental Geometrical Principles Points P1 to P4 have the following coordinates: Position Coordinates X25 Z-7.5 X40 Z-15 X40 Z-25 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.
Fundamentals 2.1 Fundamental Geometrical Principles 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 Points P1 and P2 can then be described – with reference to the pole – as follows: Position Polar coordinates RP=100 AP=30...
Page 31
Fundamentals 2.1 Fundamental Geometrical Principles Example: Turning In absolute dimensions, the following position specifications result for points P1 to P4: Position Position specification in absolute dimensions X25 Z-7.5 X40 Z-15 X40 Z-25 X60 Z-35 Example: Milling NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Fundamentals 2.1 Fundamental Geometrical Principles In absolute dimensions, the following position specifications result for points P1 to P3: Position Position specification in absolute dimensions X20 Y35 X50 Y60 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.
Fundamentals 2.1 Fundamental Geometrical Principles Example: Milling The position specifications for points P1 to P3 in incremental dimensions are: In incremental dimensions, the following position specifications are obtained for points P1 to P3: Position Position specification in incremental di‐ The specification refers to: mensions X20 Y35 Zero point...
Fundamentals 2.1 Fundamental Geometrical Principles 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...
Page 35
Fundamentals 2.1 Fundamental Geometrical Principles Reference points Reference point 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.
Fundamentals 2.1 Fundamental Geometrical Principles 2.1.4 Coordinate systems 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) ●...
Page 37
Fundamentals 2.1 Fundamental Geometrical Principles 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...
Fundamentals 2.1 Fundamental Geometrical Principles 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: Vertical 3-axis milling machine Horizontal 4-axis milling machine 2.1.4.2...
Fundamentals 2.1 Fundamental Geometrical Principles 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. Machine kinematics The workpiece is always programmed in a two- or three-dimensional, right-angled coordinate system (WCS).
Fundamentals 2.1 Fundamental Geometrical Principles Basic offset 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 ●...
Fundamentals 2.1 Fundamental Geometrical Principles 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).
Fundamentals 2.2 Fundamental Principles of NC Programming 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: ●...
Fundamentals 2.2 Fundamental Principles of NC Programming Control-internal extensions 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 –...
Page 44
Fundamentals 2.2 Fundamental Principles of NC Programming The address character (generally a letter) defines the meaning of the command. Examples: Address character Meaning G command (preparatory function) Position data for the X axis 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.
Page 45
Fundamentals 2.2 Fundamental Principles of NC Programming 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. –...
Fundamentals 2.2 Fundamental Principles of NC Programming 2.2.2.2 Block rules 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.
Fundamentals 2.2 Fundamental Principles of NC Programming Tool Tool offset number Additional function 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: ●...
Fundamentals 2.2 Fundamental Principles of NC Programming Example 1: Program code Comment N10 G1 F100 X10 Y20 ; Comment to explain the NC block Example 2: Program code Comment ; Company G&S, order no. 12A71 ; Program written by H. Smith, Dept. TV 4 on November 21, 1994 ;...
Page 49
Fundamentals 2.2 Fundamental Principles of NC Programming Program code Comment N10 … ; 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.
Fundamentals 2.3 Creating an NC program 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.
Fundamentals 2.3 Creating an NC program 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 –...
Fundamentals 2.3 Creating an NC program Special characters Meaning 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 Underscore, belonging to letters Reserved Reserved Decimal point...
Fundamentals 2.3 Creating an NC program 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.
Fundamentals 2.3 Creating an NC program Procedure 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 (→...
Page 55
Fundamentals 2.3 Creating an NC program Dimension drawing of the workpiece 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 ;...
Page 57
Fundamentals 2.3 Creating an NC program Top view NC program Program code Comment N10 T="PF60" ; Preselection of the tool with name PF60. N20 M6 ; Load the tool into the spindle. N30 S2000 M3 M8 ; Speed, direction of rotation, cooling N40 G90 G64 G54 G17 G0 X-72 Y-72 ;...
Page 58
Fundamentals 2.3 Creating an NC program Program code Comment 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" ;...
Fundamentals 2.4 Tool change Tool change 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.
Fundamentals 2.4 Tool change 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: →...
Page 61
Fundamentals 2.4 Tool change Syntax Selecting a tool T=<No> T=<Name> T<n>=<No> T<n>=<Name> Deselecting a tool Meaning Command for tool change and activating the tool offset The following specifications are possible: Number of the magazine location <No>: Name of tool <name>: Note: The correct notation (uppercase/lowercase) must be used when pro‐...
Fundamentals 2.4 Tool change ① Magazine/location number ⑫ 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.
Page 63
Fundamentals 2.4 Tool change Syntax Selecting a tool T=<No> T=<Name> T<n>=<No> T<n>=<Name> Tool change Deselecting a tool Meaning Address for the tool selection The following specifications are possible: Number of the magazine location <No>: Name of tool <name>: Note: The correct notation (uppercase/lowercase) must be used when pro‐ gramming a tool name.
Fundamentals 2.4 Tool change 2.4.2 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<No>...
Page 65
Fundamentals 2.4 Tool change Application For machine tools with chain, rotary-plate or plane magazines. Syntax Selecting a tool T<No> T=<No> T<n>=<No> Tool change Deselecting a tool T0=<No> Meaning Address for the tool selection Spindle number as address extension <n>: Note: The possibility of programming a spindle number as an address extension depends on the configuration of the machine (→...
Fundamentals 2.4 Tool change 2.4.3 Behavior with faulty T programming The behavior with faulty T programming depends on the configuration of the machine: MD22562 TOOL_CHANGE_ERROR_MODE Value Meaning Basic setting! With the T programming, a check is made immediately as to whether the NC recogni‐ zes the T number.
Fundamentals 2.5 Tool offsets Tool offsets 2.5.1 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.
Fundamentals 2.5 Tool offsets Tool carrier reference point 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.
Fundamentals 2.5 Tool offsets See also 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: ●...
Fundamentals 2.5 Tool offsets Tool geometry variables (length, radius) Tool carrier reference point Tool radius 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.
Fundamentals 2.5 Tool offsets 2.5.5.2 Milling tools The following tool types are available in the "Milling tools" group: Milling tool according to CLDATA (Cutter Location Data) Ball end mill Cylindrical die-sinking milling cutter End milling cutter without corner rounding End mill with corner rounding Angle head cutter without corner rounding Angle head mill with corner rounding Facing tool...
Page 72
Fundamentals 2.5 Tool offsets Tool parameters The following diagrams provide an overview of which milling tool parameters are entered in the compensation memory: ① Tool ② Tool holder ③ Tool adapter Adapter reference point (for inserted tool = tool carrier reference point) Tool carrier reference point Geometry - length 1 Adapter dimension - length 1...
Fundamentals 2.5 Tool offsets Tool type Center drill Countersink Counterbore Tap regular thread Tap fine thread Tap Whitworth thread Reamer Tool parameters The following diagram provides an overview of which drill tool parameters are entered in the compensation memory: Tool carrier reference point Length 1 Tool parameters Meaning...
Page 75
Fundamentals 2.5 Tool offsets Tool parameters The following diagram provides an overview of which grinding tool parameters are entered in the compensation memory: Tool carrier reference point Tool holder reference point Geometry - length 1 Base dimension - length 1 Geometry - length 2 Base dimension - length 2 Radius...
Fundamentals 2.5 Tool offsets Tool-specific parameters Meaning $TC_TPG4 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 The geometry length compensations, wear and base dimension can be chained for the left and right...
Page 77
Fundamentals 2.5 Tool offsets Tool parameters The following diagram provides an overview of which turning tool parameters are entered in the compensation memory: ① Cutting edge position (1 ... 9) for machining behind the turning center Tool tip Cutting edge center point Cutting edge radius Tool carrier reference point Tool holder reference point...
Fundamentals 2.5 Tool offsets Tool parameters Meaning $TC_DP1 Tool type $TC_DP2 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 ●...
Page 79
Fundamentals 2.5 Tool offsets Tool parameters The following diagram provides an overview of which tool parameters for "Slotting saw" tool type are entered in the compensation memory: Tool carrier reference point Geometry - length 1 Geometry - length 2 Diameter Slot width Projection Tool parameters...
Fundamentals 2.5 Tool offsets 2.5.6 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).
Page 81
Fundamentals 2.5 Tool offsets Command for activating the tool radius compensation with machining direction left of G41: the contour Command for activating the tool radius compensation with machining direction right G42: of the contour Command for deactivating the tool radius compensation G40: Additional information on G40/G41/G42 is provided in the section "Tool radius compensation (Page 251)".
Fundamentals 2.5 Tool offsets Further information 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...
Page 83
Fundamentals 2.5 Tool offsets ● 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.
Fundamentals 2.5 Tool offsets 2.5.8 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.
Page 85
Fundamentals 2.5 Tool offsets Correction of the tool length in the component parallel to the specified geometry axis TOFF: 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.
Page 86
Fundamentals 2.5 Tool offsets 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 ;...
Page 87
Fundamentals 2.5 Tool offsets Further information 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 ↔...
Page 88
Fundamentals 2.5 Tool offsets System variable Meaning $AC_TOFFL[<n>] 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). with 0 ≤ n ≤ 3 $AC_TOFF[<GeoAx>] Reads the current offset value of TOFF[<GeoAx>] in the main run con‐...
Fundamentals 2.6 Spindle motion Spindle motion 2.6.1 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).
Page 90
Fundamentals 2.6 Spindle motion Direction of spindle rotation clockwise for master spindle Spindle direction of rotation clockwise for spindle <n> M<n>=3: Direction of spindle rotation counter-clockwise for master spindle Spindle direction of rotation counter-clockwise for spindle <n> M<n>=4: Spindle stop for master spindle Spindle stop for spindle <n>...
Page 91
Fundamentals 2.6 Spindle motion Program code Comment N160 SETMS ; 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.
Fundamentals 2.6 Spindle motion The SETMS(<n>) 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.
Page 93
Fundamentals 2.6 Spindle motion 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.
Page 94
Fundamentals 2.6 Spindle motion Note 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) ●...
Page 95
Fundamentals 2.6 Spindle motion Program code Comment 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.
Page 96
Fundamentals 2.6 Spindle motion Program code Comment N180 SVC=300 ; 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...
Page 97
Fundamentals 2.6 Spindle motion 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: ●...
Fundamentals 2.6 Spindle motion 2.6.3 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.
Page 99
Fundamentals 2.6 Spindle motion Meaning Revolutional feedrate (as for G95 (Page 105)) and constant cutting speed G96: 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. Linear feedrate (as for G94 (Page 105)) and constant cutting speed G961: Linear feedrate or revolutional feedrate and constant cutting speed...
Page 101
Fundamentals 2.6 Spindle motion The SZS position of the face axis (radius) is the basis for calculating the spindle speed from the programmed cutting rate. Note Frames between WCS and SZS (e.g. programmable frames such as SCALE, TRANS or ROT) are taken into account in the calculation of the spindle speed and can bring about a change in speed (for example, if there is a change in the effective diameter in the case of SCALE).
Page 102
Fundamentals 2.6 Spindle motion If any of the G96/G961/G962 functions are active, SCC[<axis>] can be used to assign any geometry axis as a reference axis. If the reference axis changes, which will in turn affect the TCP (tool center point) reference position for the constant cutting rate, the resulting spindle speed will be reached via the set braking or acceleration ramp.
Fundamentals 2.6 Spindle motion Program code Comment N30 G0 Z51 N35 SCC[Y] ; Reference axis for G96 is Y, reduction of spindle speed (Y30). N40 G1 F1.2 Y25 ; Face cutting in Y at 1.2 mm/revolution. 2.6.4 Switching constant grinding wheel peripheral speed (GWPSON, GWPSOF) on/ off: With the predefined procedures GWPSON(...) and GWPSOF(...), the constant grinding wheel peripheral speed (GWPS) for grinding tools (tool type: 400 to 499) is switched on and off.
Fundamentals 2.6 Spindle motion 2.6.5 Programmable spindle speed limitation (G25, G26) The minimum and maximum spindle speeds defined in the machine and setting data can be modified by means of a part program command. Programmed spindle speed limitations are possible for all spindles of the channel. Syntax G25 S…...
Fundamentals 2.7 Feed control Feed control 2.7.1 Feedrate (G93, G94, G95, F, FGROUP, FL, FGREF) These commands are used in the NC program to set the feedrates for all axes involved in the machining sequence. Syntax F<value> FGROUP(<axis_1>,<axis_2>,...) FGREF[<rotary axis>]=<reference radius> FL[<axis>]=<value>...
Page 106
Fundamentals 2.7 Feed control Program code Comment N140 X10 ; Feedrate = 100 mm/min, path = 10 mm, R1 = approx. 6 s N150 DO $R2=$AC_TIME N160 X10 A10 ; Feedrate = 100 mm/min, path = 14.14 mm, R2 = approx. 8 s N170 DO $R3=$AC_TIME N180 A10 ;...
Page 107
Fundamentals 2.7 Feed control Program code Comment N10 G17 G94 G1 Z0 F500 ; Feed of the tool. N20 X10 Y20 ; Approach the starting posi- tion. N25 FGROUP(X,Y) ; Axes X/Y are path axes, Z is a synchronized axis. N30 G2 X10 Y20 Z-15 I15 J0 F1000 FL[Z]=200 ;...
Page 108
Fundamentals 2.7 Feed control The feedrate is specified under address F. Depending on the default setting in the machine data, the units of measurement specified with the G commands are either in mm or inch. One F value can be programmed per NC block. The feedrate unit is defined using one of the G commands G93/G94/G95.
Page 109
Fundamentals 2.7 Feed control Note If the path lengths vary greatly from block to block, a new F value should be specified in each block with G93. When machining with rotary axes, the feedrate can also be specified in degrees/ min.
Page 110
Fundamentals 2.7 Feed control The setting made with FGROUP can be changed: 1. By reprogramming FGROUP: e.g. FGROUP(X,Y,Z) 2. By programming FGROUP without a specific axis: FGROUP() In accordance with FGROUP(), the initial setting in the machine data applies: Geometry axes are now once again traversed in the path axis grouping.
Page 111
Fundamentals 2.7 Feed control Traverse rotary axes with path velocity F (FGREF) For machining operations in which the tool or the workpiece or both are moved by a rotary axis, the effective machining feedrate is to be interpreted as a path feed in the usual way by reference to the F value.
Page 112
Fundamentals 2.7 Feed control With this type of programming, the F value programmed in N110 is evaluated as the rotary axis feedrate in degrees/min, while the feedrate evaluation in N120 is either 100 inch/min or 100 mm/ min, dependent upon the currently active G70/G71/G700/G710 setting. NOTICE Feedrate difference FGREF evaluation also works if only rotary axes are programmed in the block.
Fundamentals 2.7 Feed control With orientation axes the mode of operation of the FGREF[] factors is dependent upon whether the change in the orientation of the tool is implemented by means of rotary axis or vector interpolation. In the case of rotary axis interpolation, as is the case with rotary axes, the relevant FGREF factors of the orientation axes are calculated individually as reference radius for the axis paths.
Page 114
Fundamentals 2.7 Feed control WAITP(<axis>) ; Programming in a separate NC block. WAITMC(<wait marker>) Meaning Move positioning axis to specified position POS/POSA: POS and POSA have the same functionality but differ in their block change behavior: ● POS delays the enabling of the NC block until the position has been reached. ●...
Page 115
Fundamentals 2.7 Feed control CAUTION Travel with POSA If a command, which implicitly causes a preprocessing stop, is read in a following block, this block is not executed until all other blocks which are already preprocessed and stored have been executed. The previous block is stopped in exact stop (as G9). Examples Example 1: Travel with POSA and access to machine status data The control generates an internal preprocessing stop on access to machine status data ($A...).
Fundamentals 2.7 Feed control Block step enable or program execution is not affected by POSA. The movement to the end position can be performed during execution of subsequent NC blocks. Travel with POS The next block is not executed until all axes programmed under POS reach their end positions. Wait for end of travel with WAITP After a WAITP, assignment of the axis to the NC program is no longer valid;...
Fundamentals 2.7 Feed control Note For a synchronous spindle with setpoint coupling, it is not permissible that the leading spindle is switched into the speed-controlled mode using SPCOF. 2.7.4 Positioning spindles (SPOS, SPOSA, M19, M70, WAITS) SPOS, SPOSA or M19 can be used to set spindles to specific angular positions, e.g. during tool change.
Page 118
Fundamentals 2.7 Feed control Syntax Position spindle: SPOS=<value> / SPOS[<n>]=<value> SPOSA=<value> / SPOSA[<n>]=<value> M19 / M<n>=19 Switch spindle over to axis mode: M70 / M<n>=70 Define end-of-motion criterion: FINEA / FINEA[S<n>] COARSEA / COARSEA[S<n>] IPOENDA / IPOENDA[S<n>] IPOBRKA / IPOBRKA(<axis>[,<instant in time>]) ; Programming in a separate NC block.
Page 119
Fundamentals 2.7 Feed control Set the master spindle (M19 or M0=19) or spindle with the number <n> (M<n>=19) M<n>=19: to the angular position preset with SD43240 $SA_M19_SPOS with the position approach mode preset in SD43250 $SA_M19_SPOSMODE. The NC block is not enabled until the position has been reached. Switch the master spindle (M70 or M0=70) or spindle with the number <n>...
Page 120
Fundamentals 2.7 Feed control Note With incremental dimensions IC(<value>), spindle positioning can take place over several revolutions. Note If position control was activated with SPCON prior to SPOS, this remains active until SPCOF is issued. Note The control detects the transition to axis mode automatically from the program sequence. Explicit programming of M70 in the part program is, therefore, essentially no longer necessary.
Page 121
Fundamentals 2.7 Feed control WAITS can be used to identify a point at which the NC program waits until one or more spindles programmed with SPOSA in a previous NC block reach their positions. Example: Program code Comment N10 SPOSA[2]=180 SPOSA[3]=0 N40 WAITS(2,3) ;...
Fundamentals 2.7 Feed control 2.7.5 Feedrate for positioning axes / spindles (FA, FPR, FPRAON, FPRAOF) It is also possible to derive the revolutional feedrate for path and synchronized axes or for individual positioning axes/spindles from another rotary axis or spindle. Positioning axes such as workpiece transport systems, tool turrets and end supports are traversed independently of path and synchronized axes.
Page 123
Fundamentals 2.7 Feed control Derive rotational feedrate for positioning axes and spindles FPRAON(...): The first parameter (<axis>/SPI(<n>)/S<n>) identifies the positioning axis/spindle to be traversed with revolutional feedrate. The second parameter (<rotary axis>/SPI(<n>)/S<n>) identifies the rotary axis/spindle from which the revolutional feedrate is to be derived. Note: The second parameter can be omitted, in which case the feedrate will be derived from the master spindle.
Page 124
Fundamentals 2.7 Feed control Program code N40 FPR(A) N50 G95 X50 Y50 F500 Example 3: Derive revolutional feedrate for master spindle Program code Comment N30 FPRAON(S1,S2) ; The revolutional feedrate for the master spindle (S1) must be derived from spindle 2. N40 SPOS=150 ;...
Fundamentals 2.7 Feed control The revolutional feedrate can be deactivated for one or a number of axes/spindles simultaneously with the FPRAOF command. 2.7.6 Programmable feedrate override (OVR, OVRRAP, OVRA) The velocity of path/positioning axes and speed of spindles can be modified in the NC program. Syntax OVR=<value>...
Page 126
Fundamentals 2.7 Feed control Syntax ACC[<axis>]=<value> ACC[SPI(<n>)]=<value> ACC(S<n>)=<value> Deactivate: ACC[...]=100 Syntax Acceleration change for the specified path axis or speed change for the ACC: specified spindle. Channel axis name of path axis <axis>: Spindle identifier SPI(<n>)/S<n>: SPI(<n>) and S<n> are identical in terms of function. Spindle number <n>: Note:...
Fundamentals 2.7 Feed control In the part program The value written in the part program is then only taken into consideration in system variable $AA_ACC as written in the part program if ACC was not changed in the meantime by a synchronized action.
Page 128
Fundamentals 2.7 Feed control Positioning axes In the case of positioning axes, the travel path or velocity can be overlaid as an axial value. The handwheel assigned to the axis is evaluated. ● Path override The handwheel pulses evaluated dependent on the direction of rotation correspond to the axis path to be traveled.
Page 129
Fundamentals 2.7 Feed control Example Path definition: The grinding wheel oscillating in the Z direction is traversed to the workpiece in the X direction with the handwheel. The operator can continue to feed manually until the sparks are flying uniformly. Activating "Delete distance-to-go"...
Page 130
Fundamentals 2.7 Feed control Traverse positioning axes with path default (FDA[<axis>]=0) In the NC block with programmed FDA[<axis>]=0 the feed is set to zero so that the program cannot generate any travel movement. The programmed travel movement to the target position is now controlled exclusively by the operator rotating the handwheel.
Fundamentals 2.7 Feed control Program code Description N20 POS[V]=100 FAD[V]=200 ; Axial target position = 100, axial feedrate = 200 mm/min ; and velocity override with handwheel. ; Acceleration from 100 to 200 mm/min in N20. The ; Handwheel can be used to vary the velocity depending on the direc- tion of rotation ;...
Page 132
Fundamentals 2.7 Feed control Meaning Constant feedrate on the milling cutter center path CFTCP: The control keeps the feedrate constant and feedrate overrides are deactivated. Constant feedrate at the contour (tool cutting edge). CFC: This function is preset per default. Constant feedrate at the tool cutting edge only at concave contours, otherwise on the CFIN: milling cutter center path.
Fundamentals 2.7 Feed control Further information Constant feedrate along the contour with CFC The feedrate is reduced for inside radii and increased for outside radii. This ensures a constant velocity at the tool cutting edge and thus at the contour. 2.7.10 Several feedrate values in one block (F, ST, SR, FMA, STA, SRA) The "Multiple feedrates in one block"...
Page 134
Fundamentals 2.7 Feed control F2=... to F7=... : In addition to the path feedrate, up to six further feedrates can be programmed in the block. The numerical expansion indicates the bit number of the input that activates the feedrate when changed: Effective: Non-modal...
Page 135
Fundamentals 2.7 Feed control Note Delete distance-to-go If input bit 1 is activated for the dwell time or bit 0 for the return path, the distance to go for the path axes or the relevant single axes is deleted and the dwell time or return started. Note Retraction path The unit for the retraction path refers to the current valid unit of measurement (mm or inch).
Fundamentals 2.7 Feed control Note If no traversing motion is programmed in the block (e.g. computation block), the FB has no effect. If no explicit feedrate for chamfering/rounding is programmed, then the value of FB also applies for any chamfering/rounding contour element in this block. Feedrate interpolations FLIN, FCUB, etc.
Page 138
Fundamentals 2.7 Feed control The control uses the $TC_DPNT (number of teeth) tool parameter associated with the active tool offset data block to calculate the effective revolutional feedrate for each traversing block from the programmed tooth feedrate. F = FZ * $TC_DPNT with: Revolutional feedrate in mm/rev or inch/rev Tooth feedrate in mm/tooth or inch/tooth...
Page 139
Fundamentals 2.7 Feed control NOTICE Tool operations undefined Technological concerns such as climb milling or conventional milling, front face milling or peripheral face milling, etc., along with the path geometry (straight line, circle, etc.), are not taken into account automatically. Therefore, these factors have to be given consideration when programming the tooth feedrate.
Page 140
Fundamentals 2.7 Feed control Program code Comment N60 M6 T3 D1 ; Load tool with e.g. five teeth ($TC_DPNT = 5). N70 X22 M3 S300 N80 G1 X3 G95 FZ=0.02 ; Change G95 F… to G95 FZ…, tooth feedrate active with 0.02 mm/tooth.
Page 141
Fundamentals 2.7 Feed control Program code Comment N130 G95 G1 FZ0.03 X20 ; Path motion, the effective feedrate is dependent upon: - The tooth feedrate FZ - The speed of spindle 2 - The number of teeth of the active tool T1 Note Following the change in the master spindle (N100), a tool actuated by spindle 2 must be substituted (N110).
Page 142
Fundamentals 2.7 Feed control $AC_FZ Tooth feedrate effective when the current main run block was prepro‐ cessed. $AC_F_TYPE Path feedrate type effective when the current main run block was pre‐ processed. Value: Meaning: mm/min mm/rev inch/min inch/rev mm/tooth inch/tooth ● Without preprocessing stop in the part program via system variables: $P_FZ Programmed tooth feedrate $P_F_TYPE...
Fundamentals 2.8 Geometry settings Geometry settings 2.8.1 Settable zero offset (G54 to G57, G505 to G599, G53, G500, SUPA, G153) The G54 to G57 and G505 to G599 commands activate the settable work offsets for offsetting the workpiece coordinate system compared with the basic coordinate system set from the user interface.
Fundamentals 2.8 Geometry settings Example Three workpieces that are arranged on a palette according to the work offset values G54 to G56 are to be machined in succession. The machining sequence is programmed in subprogram L47. Program code Comment N10 G0 G90 X10 Y10 F500 T1 ;...
Fundamentals 2.8 Geometry settings ① Initial position in the BCS ② Offset ③ Offset + rotation ④ Offset + scaling The frame values for the settable work offsets are input from the user interface: SINUMERIK Operate: "Parameters" > "Work offsets" > "Details" operating area Parameterized number of parameterizable frames (G505 - G599) The number of user-specific settable work offsets (G505 - G599) can be set for each specific channel via:...
Page 146
Fundamentals 2.8 Geometry settings Syntax G17/G18/G19, etc. Meaning Working plane X/Y G17: Infeed direction Z, plane selection 1st - 2nd geometry axis Working plane Z/X G18: Infeed direction Y, plane selection 3rd - 1st geometry axis Working plane Y/Z G19: Infeed direction X, plane selection 2nd - 3rd geometry axis Note In the default setting, G17 (X/Y plane) is defined for milling and G18 (Z/X plane) is defined for...
Page 147
Fundamentals 2.8 Geometry settings 3. Switch on path correction (G41). 4. Program traversing movements. Program code Comment N10 G17 T5 D8 ; Call of working plane X/Y, tool call. Tool length offset is performed in the Z direction. N20 G1 G41 X10 Y30 Z-5 F500 ;...
Fundamentals 2.8 Geometry settings Tool length compensation on inclined planes As a general rule, the tool length compensation always refers to the fixed, non-rotated working plane. Note The tool length components can be calculated according to the rotated working planes with the functions for "Tool length compensation for orientable tools".
Fundamentals 2.8 Geometry settings 2.8.4.1 Absolute dimensions (G90, AC) With absolute dimensions, the position specifications always refer to the zero point of the currently valid coordinate system, i.e. the absolute position is programmed, on which the tool is to traverse. Modal absolute dimensions Modal absolute dimensions are activated with the G90 command.
Page 150
Fundamentals 2.8 Geometry settings Examples Example 1: Milling Program code Comment N10 G90 G0 X45 Y60 Z2 T1 S2000 M3 ; Absolute dimension input, in rapid tra- verse to position XYZ, tool selection, spindle on with clockwise direction of rotation. N20 G1 Z-5 F500 ;...
Fundamentals 2.8 Geometry settings Program code Comment N5 T1 D1 S2000 M3 ; Loading of tool T1, spindle on with clockwise direction of rotation. N10 G0 G90 X11 Z1 ; Absolute dimension input, in rapid tra- verse to position XZ. N20 G1 Z-15 F0.2 ;...
Page 152
Fundamentals 2.8 Geometry settings With preset absolute dimensions (G90), the IC command can be used to set non-modal incremental dimensions for individual axes. Note Non-modal incremental dimensions (IC) are also possible for spindle positioning (SPOS, SPOSA) and interpolation parameters (I, J, K). Syntax <axis>=IC(<value>) Meaning...
Page 153
Fundamentals 2.8 Geometry settings Examples Example 1: Milling Program code Comment N10 G90 G0 X45 Y60 Z2 T1 S2000 M3 ; Absolute dimension input, in rapid tra- verse to position XYZ, tool selection, spindle on with clockwise direction of rotation N20 G1 Z-5 F500 ;...
Page 154
Fundamentals 2.8 Geometry settings Example 2: Turning Program code Comment N5 T1 D1 S2000 M3 ; Loading of tool T1, spindle on with clockwise di- rection of rotation. N10 G0 G90 X11 Z1 ; Absolute dimension input, in rapid traverse to position XZ. N20 G1 Z-15 F0.2 ;...
Fundamentals 2.8 Geometry settings Program code Comment N30 G90 X50 ; Absolute dimensions active, traverse to position X75 (the zero offset is traversed). See also Absolute and incremental dimensions for turning and milling (G90/G91) (Page 155) 2.8.4.3 Absolute and incremental dimensions for turning and milling (G90/G91) The two following figures illustrate the programming with absolute dimensions (G90) or incremental dimensions (G91) using turning and milling technology examples.
Fundamentals 2.8 Geometry settings Turning: Note On conventional turning machines, it is usual to consider incremental traversing blocks in the transverse axis as radius values, while diameter specifications apply for the reference dimensions. This conversion for G90 is performed using the commands DIAMON, DIAMOF or DIAM90.
Page 157
Fundamentals 2.8 Geometry settings Syntax <Rotary axis>=DC(<Value>) <Rotary axis>=ACP(<Value>) <Rotary axis>=ACN(<Value>) Meaning Identifier of the rotary axis that is to be traversed (e.g. A, B or C) <Rotary axis>: Command to directly approach the position The rotary axis approaches the programmed position directly along the shortest path.
Fundamentals 2.8 Geometry settings Program code Comment N10 SPOS=0 ; Spindle in position control. N20 G90 G0 X-20 Y0 Z2 T1 ; Absolute dimensions, feed in tool T1 in rapid tra- verse. N30 G1 Z-5 F500 ; Lower tool with the feedrate. N40 C=ACP(270) ;...
Page 159
Fundamentals 2.8 Geometry settings Meaning Activating the inch system of units G70: The inch system of units is used to read and write geometrical data in units of length. Technological data in units of length (e.g. feedrates, tool offsets, adjustable work offsets, machine data and system variables) is read and written using the parameterized basic sys‐...
Page 160
Fundamentals 2.8 Geometry settings Example The basic system is metric (MD10240 $MN_SCALING_SYSTEM_IS_METRIC = 1). However, the workpiece drawing has dimensions shown in inches. This is the reason why within the part program, the inch system of units is selected. After the inch dimensions have been processed, the metric system of units is again selected.
Page 161
Length-related setting data Length-related system variables GUDs LUDs PUDs R parameters Siemens cycles Jog/handwheel increment factor P: Writing/reading is performed in the programmed system of units. G: Writing/reading is performed in the configured basic system Synchronized actions Note Reading position data in synchronized actions...
Fundamentals 2.8 Geometry settings 2.8.4.6 Channel-specific diameter/radius programming (DIAMON, DIAM90, DIAMOF, DIAMCYCOF) ① During turning, the dimensions for the transverse axis can be specified in the diameter ( ) or ② in the radius ( So that the dimensions from a technical drawing can be transferred directly (without conversion) to the NC program, channel-specific diameter or radius programming is activated using the modal commands DIAMON, DIAM90, DIAMOF, and DIAMCYCOF.
Page 163
Fundamentals 2.8 Geometry settings Command for the activation of the dependent channel-specific diameter program‐ DIAM90: ming. The effect of DIAM90 depends on the programmed dimensions mode: Dimensions in the diameter ● For G90: Dimensions in the radius ● For G91: Command for the deactivation of the channel-specific diameter programming DIAMOF: Channel-specific radius programming takes effect when diameter programming is...
Fundamentals 2.8 Geometry settings The diameter values apply for the following data: ● Actual value display of the transverse axis in the workpiece coordinate system ● JOG mode: Increments for incremental dimensions and manual handwheel travel ● Programming of end positions: Interpolation parameters I, J, K for G2/G3, if these have been programmed absolutely with AC.
Page 165
Fundamentals 2.8 Geometry settings Meaning Modal axis-specific diameter programming Command for the activation of the independent axis-specific diameter programming DIAMONA: The effect of DIAMONA is independent of the programmed dimensions mode (G90/G91 or AC/IC): Dimensions in the diameter ● For G90, AC: Dimensions in the diameter ●...
Page 166
Fundamentals 2.8 Geometry settings The DAC command sets the following dimensions to non-modal for the specified DAC: axis: Diameter in absolute dimensions The DIC command sets the following dimensions to non-modal for the specified DIC: axis: Diameter in incremental dimensions The RAC command sets the following dimensions to non-modal for the specified RAC: axis:...
Page 167
Fundamentals 2.8 Geometry settings Program code Comment N15 G0 G90 X20 Y40 DIAMONA[Y] ; Modal axis-specific diameter programming active for Y. N20 G01 X=RIC(5) ; Dimensions effective in this block for X: Radius in incremen- tal dimensions. N25 X=RAC(80) ; Dimensions effective in this block for X: Radius in absolute dimensions.
Fundamentals 2.8 Geometry settings 2.8.5 Position of workpiece for turning Axis identifiers The two geometry axes perpendicular to one another are usually called: Longitudinal axis = Z axis (abscissa) Transverse axis = X axis (ordinate) Workpiece zero Whereas the machine zero is permanently defined, the workpiece zero can be freely selected on the longitudinal axis.
Page 169
Fundamentals 2.8 Geometry settings Transverse axis Generally the dimensions for the transverse axis are diameter specifications (double path dimension compared to other axes): The geometry axis that is to serve as transverse axis is defined in the machine data (→ machine manufacturer).
Fundamentals 2.9 Motion commands Motion commands 2.9.1 General information about the travel commands Contour elements The programmed workpiece contour can be made up of the following contour elements: ● Straight lines ● Circular arcs ● Helical curves (through overlaying of straight lines and circular arcs) Travel commands The following travel commands are available for the creation of these contour elements: ●...
Fundamentals 2.9 Motion commands Workpiece contour NOTICE Tool operation undefined Before machining, the workpiece must be positioned in such a way that the tool or workpiece cannot be damaged. The motion blocks produce the workpiece contour when performed in succession: Figure 2-1 Motion blocks for turning Figure 2-2...
Page 172
Fundamentals 2.9 Motion commands Syntax G0 X... Y... Z... G1 X... Y... Z... G2 X... Y... Z..G3 X... Y... Z..Meaning Command for the activation of rapid traverse motion Command for the activation of linear interpolation Command for the activation of clockwise circular interpolation Command for the activation of counter-clockwise circular interpolation Cartesian coordinate of the target position in the X direction X...:...
Fundamentals 2.9 Motion commands Program code Comment N40 X12 Y-20 ; Travel on an inclined line to an end position specified with Cartesian coordinates N50 G0 Z100 M30 ; Retraction in rapid traverse for tool change 2.9.3 Travel commands with polar coordinates 2.9.3.1 Reference point of the polar coordinates (G110, G111, G112) The point from which the dimensioning starts is called the pole.
Fundamentals 2.9 Motion commands Note If no pole has been specified, the zero point of the current workpiece coordinate system applies. Example Poles 1 to 3 are defined as follows: ● Pole 1 with G111 X… Y… ● Pole 2 with G110 X… Y… ●...
Page 175
Fundamentals 2.9 Motion commands Syntax G0/G1/G2/G3 AP=… RP=… Meaning Command for the activation of rapid traverse motion Command for the activation of linear interpolation Command for the activation of clockwise circular interpolation Command for the activation of counter-clockwise circular interpolation Polar angle Angle between the polar radius and the horizontal axis of the working plane (e.g.
Page 176
Fundamentals 2.9 Motion commands Supplementary conditions ● No Cartesian coordinates such as interpolation parameters, axis addresses, etc. may be programmed for the selected working plane in NC blocks with polar end point coordinates. ● If a pole has not been defined with G110 ... G112, then the zero point of the current workpiece coordinate system is automatically considered as the pole: NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Page 177
Fundamentals 2.9 Motion commands ● Polar radius RP = 0 The polar radius is calculated from the distance between the starting point vector in the pole plane and the active pole vector. The calculated polar radius is then saved as modal. This applies irrespective of the selected pole definition (G110 ...
Fundamentals 2.9 Motion commands Program code Comment N110 AP=IC(72) N120 L10 … N130 G0 X300 Y200 Z100 M30 ; Retract tool, end of program. See also Overview (Page 188) 2.9.4 Rapid traverse movements 2.9.4.1 Activating rapid traverse (G0) The traversing of the path axes at rapid traversing velocity is activated with the G command G0. Syntax G0 X…...
Page 181
Fundamentals 2.9 Motion commands Meaning G command for switching off the linear interpolation RTLIOF: ⇒ In the rapid traversing mode (G0), the non-linear interpolation is active. All of the path axes reach their end points independently of one another. Effective: Modal G command for switching on the linear interpolation RTLION:...
Fundamentals 2.9 Motion commands 2.9.4.3 Adapt tolerances for rapid traverse motion (STOLF, CTOLG0, OTOLG0) The tolerances for rapid traverse motion (G0 tolerances) configured using machine data can be temporarily adapted in the part program. In so doing, the settings in the machine data are not changed.
Page 183
Fundamentals 2.9 Motion commands Meaning Address for programming a temporarily effective tolerance factor for rapid traverse motion STOLF: G0 tolerance factor <Value>: Type: REAL Value: ≥ 0: The G0 tolerance factor can be greater or less than 1.0. If the factor is equal to 1.0 (default value), then the same tolerances are active for rapid traverse motion as for non- rapid traverse motion.
Page 184
Fundamentals 2.9 Motion commands Examples Example 1: Adaptation of the relative G0 tolerance Program code Comment COMPCAD G645 G1 F10000 ; Compressor function COMPCAD X... Y... Z... ; The machine and setting data apply here. X... Y... Z... X... Y... Z... X...
Page 185
Fundamentals 2.9 Motion commands Further information Reading the G0 tolerance factor The currently active tolerance factor for rapid traverse motion can be read using system variables: ● In synchronized actions or with preprocessing stop in the part program via system variable: $AC_STOLF Active G0 tolerance factor G0 tolerance factor, which was effective when processing the...
Fundamentals 2.9 Motion commands 2.9.5 Linear interpolation (G1) With G1 the tool travels on paraxial, inclined or straight lines arbitrarily positioned in space. Linear interpolation permits machining of 3D surfaces, grooves, etc. Syntax G1 X… Y… Z … F… G1 AP=… RP=… F… Meaning Linear interpolation with feedrate (linear interpolation) End point in Cartesian coordinates...
Page 187
Fundamentals 2.9 Motion commands Examples Example 1: Machining of a groove (milling) The tool travels from the starting point to the end point in the X/Y direction. Infeed takes place simultaneously in the Z direction. Program code Comment N10 G17 S400 M3 ;...
Fundamentals 2.9 Motion commands Plane for the circular interpolation The control needs the working plane parameter (Page 145) to calculate the direction of rotation for the circle (G2 is clockwise or G3 is counter-clockwise). Exception: It is also possible to create circles outside the selected working plane (not with opening angle and helix parameters).
Page 190
Fundamentals 2.9 Motion commands X... Y... Z... : Circle end point in Cartesian coordinates. Depending on the currently valid dimensional notation setting G90/G91 or ...=AC(...) / ...=IC(...), the circle end point coordinates are in‐ terpreted either in the absolute dimension or in the incremental dimension. I...
Fundamentals 2.9 Motion commands Example 2: Turning Center point data using incremental dimensions N120 G0 X12 Z0 N125 G1 X40 Z-25 F0.2 N130 G3 X70 Z-75 I-3.335 K-29.25 N135 G1 Z-95 Center point data using absolute dimensions N120 G0 X12 Z0 N125 G1 X40 Z-25 F0.2 N130 G3 X70 Z-75 I=AC(33.33) K=AC(-54.25) N135 G1 Z-95...
Page 192
Fundamentals 2.9 Motion commands X... Y... Z... : Circle end point in Cartesian coordinates. Depending on the currently valid dimensional notation setting G90/G91 or ...=AC(...) / ...=IC(...), the end point coordinates are interpreted either in the absolute dimension or in the incremental dimension. CR=±...
Fundamentals 2.9 Motion commands Example 2: Turning Program code N125 G1 X40 Z-25 F0.2 N130 G3 X70 Z-75 CR=30 N135 G1 Z-95 2.9.6.4 Circular interpolation with opening angle and end point / center point (G2/G3, X... Y... Z... / I... J... K..., AR) Circular interpolation version, that uses the opening angle and center point or end point of a circular contour element for the interpolation.
Page 194
Fundamentals 2.9 Motion commands X... Y... Z... : Circle end point in Cartesian coordinates. Depending on the currently valid dimensional notation setting G90/G91 or ...=AC(...) / ...=IC(...), the circle end point coordinates are in‐ terpreted either in the absolute dimension or in the incremental dimension. I...
Fundamentals 2.9 Motion commands Example 2: Turning Program code N125 G1 X40 Z-25 F0.2 N130 G111 X33.33 Z-54.25 N135 G3 RP=30 AP=142.326 N140 G1 Z-95 2.9.6.6 Circular interpolation with intermediate point and end point (CIP, X... Y... Z..., I1... J1... K1...) The circular interpolation version programmed with the G command CIP allows the interpolation of arcs lying at an incline in the space.
Page 198
Fundamentals 2.9 Motion commands Syntax CIP X… Y… Z… I1=AC(…) J1=AC(…) K1=(AC…) Meaning Circular interpolation through intermediate point CIP: Effective: Modal X... Y... Z... : Circle end point in Cartesian coordinates. Depending on the currently valid dimensional notation setting G90/G91 or ...=AC(...) / ...=IC(...), the circle end point coordinates are in‐...
Page 199
Fundamentals 2.9 Motion commands Note Turning technology The diameter programming of the interpolation parameter for the transverse axis is not supported with CIP in the circular-path programming. The interpolation parameter for the transverse axis must therefore be programmed in the radius. Examples Example 1: Milling In order to machine an inclined circular groove, a circle is described by specifying the...
Fundamentals 2.9 Motion commands Example 2: Turning Program code Comment N125 G1 G90 X40 Z-25 F0.2 N130 CIP X70 Z-75 I1=IC(26.665) K1=IC(-29.25) ; Interpolation parameter I1 for transverse axis must be program- med in the radius. ; or ; N130 CIP X70 Z-75 I1=46.665 K1=-54.25 N135 G1 Z-95 2.9.6.7 Circular interpolation with tangential transition (CT, X...
Page 201
Fundamentals 2.9 Motion commands Start point End point Center of circle Circle radius End tangents of the programmed contour of the last block with a traversing movement. Figure 2-4 Tangentially to the straight section 1-2 connecting circular path S-E Figure 2-5 Tangentially connecting circular paths depend on the previous contour element Syntax CT X…...
Page 203
Fundamentals 2.9 Motion commands Program code Comment N110 G1 X23.293 Z0 F10 N115 X40 Z-30 F0.2 N120 CT X58.146 Z-42 ; Circular-path programming with tangential transition. N125 G1 X70 Further information Splines In the case of splines, the tangential direction is defined by the straight line through the last two points.
Fundamentals 2.9 Motion commands If the tangent of the previous block does not lie in the active plane, its projection into the active plane is used. If the start and end points do not have the same position components perpendicular to the active plane, a helix is produced instead of a circle.
Page 205
Fundamentals 2.9 Motion commands Opening angle TURN= : Number of additional circular passes in the range from 0 to 999 AP= : Polar angle RP= : Polar radius Note G2 and G3 are modal. The circular motion is performed in those axes that are defined by the specification of the working plane.
Fundamentals 2.9 Motion commands 3. Approach circle end position, e.g. as part rotation. 4. Execute steps 2 and 3 across the infeed depth. The pitch, with which the helix is to be machined is calculated from the number of full circles plus the programmed circle end position (executed across the infeed depth).
Page 207
Fundamentals 2.9 Motion commands The end point can be programmed in two ways: 1. Directly via Cartesian coordinates 2. Indirectly by specifying an opening angle (also refer to the programming of the opening angle for circular-path programming) If the starting point and the end point are in the plane of the basic circle, then, analogous to the helical interpolation for circles, there is a superimposition to a curve in space.
Page 208
Fundamentals 2.9 Motion commands AR=... : Indirect programming of the end point by specifying an opening angle (angle of rotation) The origin of the opening angle is the line from the circle center point to the starting point. AR > 0: The path of the involute moves away from the basic cir‐...
Page 209
Fundamentals 2.9 Motion commands Supplementary conditions ● Both the starting point and the end point must be outside the area of the basic circle of the involute (circle with radius CR around the center point specified by I, J, K). If this condition is not satisfied, an alarm is generated and the program processing is canceled.
Page 210
Fundamentals 2.9 Motion commands Examples Example 1: Counter-clockwise involute from the starting point to the programmed end point and back again as clockwise involute Program code Comment N10 G1 X10 Y0 F5000 ; The starting position is ap- proached. N15 G17 ;...
Fundamentals 2.9 Motion commands Example 2: Counter-clockwise involute with indirect programming of the end point by specifying an opening angle Program code Comment N10 G1 X10 Y0 F5000 ; The starting position is approached. N15 G17 ; Selection of the X/Y plane as machining plane.
Fundamentals 2.9 Motion commands Additional arbitrary NC addresses can be used, e.g. address letters for further axes (single axes or axis perpendicular to the machining plane), auxiliary function specifications, G commands, velocities, etc. in the blocks that describe contour definitions. Note Contour calculator The contour definitions can be programmed easily with the aid of the contour calculator.
Page 213
Fundamentals 2.9 Motion commands ANG: Angle of the straight line X1, Z1: Start coordinates X2, Z2: End point coordinates of the straight line Syntax X… ANG=… Z… ANG=… Meaning X... : End point coordinate in the X direction Z... : End point coordinate in the Z direction Identifier for angle programming ANG:...
Fundamentals 2.9 Motion commands 2.9.9.3 Contour definitions: Two straight lines Note In the following description it is assumed that: ● G18 is active (⇒ active working plane is the Z/X plane). (However, the programming of contour definitions is also possible without restrictions with G17 or G19.) ●...
Page 215
Fundamentals 2.9 Motion commands ANG=… X… Z… ANG=… ● Rounding as transition between the straight lines: ANG=… RND=... X… Z… ANG=… ● Chamfer as transition between the straight lines: ANG=… CHR=... X… Z… ANG=… Programming of the end point of the first straight line by specifying the coordinates ●...
Page 216
Fundamentals 2.9 Motion commands Meaning ANG=... : Identifier for angle programming The specified value (angle) refers to the abscissa of the active working plane (Z axis with G18). RND=... : Identifier for programming a rounding The specified value corresponds to the radius of the rounding: CHR=...
Fundamentals 2.9 Motion commands Example Program code Comment N10 X10 Z80 F1000 G18 ; Approach the starting position. N20 ANG=148.65 CHR=5.5 ; Straight line with angle and chamfer specification. N30 X85 Z40 ANG=100 ; Straight line with angle and end point specification. N40 ...
Page 218
Fundamentals 2.9 Motion commands ANG1: Angle of the first straight line ANG2: Angle of the second straight line X1, Z1: Start coordinates of the first straight line X2, Z2: End point coordinates of the first straight line or start coordinates of the second straight line X3, Z3: End point coordinates of the second straight line or start coordinates of the third straight line...
Page 219
Fundamentals 2.9 Motion commands ANG=… CHR=... X… Z… ANG=… CHR=... X… Z… Programming of the end point of the first straight line by specifying the coordinates ● Corner as transition between the straight lines: X… Z… X… Z… X… Z… ●...
Fundamentals 2.9 Motion commands CHR=... : Identifier for programming a chamfer The specified value corresponds to the width of the chamfer in the direction of motion: X... : Coordinates in the X direction Z... : Coordinates in the Z direction Note For further information on the programming of a chamfer or rounding, see "...
Fundamentals 2.9 Motion commands Number of programmed axes ● If no axis of the active plane has been programmed, then this is either the first or second block of a contour definition consisting of two blocks. If it is the second block of such a contour definition, then this means that the starting point and end point in the active plane are identical.
Page 222
Fundamentals 2.9 Motion commands Note Technical requirement for thread cutting with G33 is a variable-speed spindle with position measuring system. Multiple thread Multiple thread (thread with offset cuts) can be machined by specifying a starting point offset. The programming is performed in the G33 block at address SF. Note If no starting point offset is specified, the "starting angle for thread"...
Page 223
Fundamentals 2.9 Motion commands Note With continuous-path mode G64, the blocks are linked by the look-ahead velocity control in such a way that there are no velocity jumps. Direction of rotation of the thread The direction of rotation of the thread is determined by the direction of rotation of the spindle: ●...
Page 224
Fundamentals 2.9 Motion commands SF=... : Starting point offset (only required for multiple threads) The starting point offset is specified as an absolute angle position. Range of values: 0.0000 to 359.999 degrees Examples Example 1: Double cylinder thread with 180° starting point offset Program code Comment N10 G1 G54 X99 Z10 S500 F100 M3...
Page 225
Fundamentals 2.9 Motion commands Example 2: Tapered thread with angle less than 45° Program code Comment N10 G1 X50 Z0 S500 F100 M3 ; Approach starting point, activate spindle. N20 G33 X110 Z-60 K4 ; Tapered thread: End point in X and Z, specifi- cation of thread lead with K...
Page 226
Fundamentals 2.9 Motion commands The cylinder thread is described by: ● Thread length ● Thread lead The thread length is entered with one of the Cartesian coordinates X, Y or Z in absolute or incremental dimensions (for turning machines preferably in the Z direction). Allowance must also be made for the run-in and run-out paths, across which the feed is accelerated or decelerated.
Fundamentals 2.9 Motion commands Tapered thread The tapered thread is described by: ● End point in the longitudinal and transverse direction (taper contour) ● Thread lead The taper contour is entered in Cartesian coordinates X, Y, Z in absolute or incremental dimensions - preferentially in the X and Z direction for machining on turning machines.
Fundamentals 2.9 Motion commands Taper thread with increasing pitch: G34 X… Z… K… F... G34 X… Z… I… F... Taper thread with decreasing pitch: G35 X… Z… K… F... G35 X… Z… I… F... Meaning Command for thread cutting with linear increasing pitch G34: Command for thread cutting with linear decreasing pitch G35:...
Page 229
Fundamentals 2.9 Motion commands The thread axis is accelerated or braked along the specified path. ① Run-in/run-out path, depending on the machining direction Short run-in path Due to the collar on the thread runin, little room is left for the tool start ramp. This must therefore be specified shorter via DITS.
Page 230
Fundamentals 2.9 Motion commands Example Program code Comment N40 G90 G0 Z100 X10 SOFT M3 S500 N50 G33 Z50 K5 SF=180 DITS=1 DITE=3 ; Start of smoothing with Z=53. N60 G0 X20 Further information SD42010 $SC_THREAD_RAMP_DISP When a block containing DITS and/or DITE is inserted in the main run, the programmed run-in/ run-out path is transferred into the setting data SD42010 $SC_THREAD_RAMP_DISP: ●...
Fundamentals 2.9 Motion commands 2.9.10.4 Fast retraction during thread cutting (LFON, LFOF, DILF, ALF, LFTXT, LFWP, LFPOS, POLF, POLFMASK, POLFMLIN) The "Rapid retraction during thread cutting (G33)" function can be used to interrupt thread cutting without causing irreparable damage in the following situations: ●...
Page 232
Fundamentals 2.9 Motion commands The retraction direction is controlled in conjunction with ALF with G LFTXT commands LFTXT and LFWP. LFWP: The plane in which the retraction motion is executed is calculated from LFTXT: the path tangent and the tool direction (default setting). The plane in which the retraction motion is executed is the active working LFWP: plane.
Page 233
Fundamentals 2.9 Motion commands Examples Example 1: Enable rapid retraction during thread cutting Program code Comment N55 M3 S500 G90 G18 ; Active machining plane ; Approach the starting position N65 MSG ("thread cutting") ; Tool infeed MM_THREAD: N67 $AC_LIFTFAST=0 ;...
Page 235
Fundamentals 2.9 Motion commands parameters in the center point programming must be programmed with IR=..., JR=... and KR=..Cartesian coordinate for the circle center point in the X direction IR=...: Cartesian coordinate for the circle center point in the Y direction JR=...: Cartesian coordinate for the circle center point in the Z direction KR=...:...
Page 236
Fundamentals 2.9 Motion commands Example 2: Convex thread in the counter-clockwise direction with end and center point programming Program code Comment N5 G0 G18 X50 Z50 ; Approach starting point. N10 G336 Z100 K=3.5 KR=25 IR=20 SF=90 ; Turn convex thread in the coun- ter-clockwise direction.
Page 237
Fundamentals 2.9 Motion commands Figure 2-9 Convex thread in the clockwise direction with end point and radius programming Example 4: Convex thread in the clockwise direction with end point and opening angle programming Program code N5 G0 G18 X50 Z50 N10 G335 Z100 K=3.5 AR=102.75 SF=90 Figure 2-10 Convex thread in the clockwise direction with end point and opening angle programming...
Page 238
Fundamentals 2.9 Motion commands Figure 2-11 Convex thread in the clockwise direction with center point and opening angle programming Example 6: Convex thread in the clockwise direction with end and intermediate point programming Program code N5 G0 G18 X50 Z50 N10 G335 Z100 K=3.5 I1=60 K1=64 Figure 2-12 Convex thread in the clockwise direction with end and intermediate point programming...
Page 239
Fundamentals 2.9 Motion commands Further information Permissible arc areas The arc programmed at G335/G336 must be in an area in which the specified thread main axis (I, J or K) has the main axis share on the arc over the entire arc: Permissible areas for the Z axis (pitch programmed Permissible areas for the X axis (pitch programmed with K)
Fundamentals 2.9 Motion commands 2.9.11 Tapping without compensating chuck 2.9.11.1 Tapping without compensating chuck and retraction motion (G331, G332) For tapping without compensating chuck, using the G331 and G332commands, the following traversing motion is executed: ● G331: Tapping in the tapping direction up to the end of thread point ●...
Fundamentals 2.9 Motion commands Examples ● Example: Tapping with G331 / G332 (Page 241) ● Example: Output the programmed drilling speed in the current gear stage (Page 241) ● Example: Application of the second gear-stage data block (Page 242) ● Example: Speed is not programmed, the gearbox stage is monitored (Page 242) ●...
Fundamentals 2.9 Motion commands automatic gear-stage change is possible following an SPOS operation. In order for an automatic change in gear stage to be performed, the spindle must be in speed-control mode. Note If gearbox stage 2 is selected at a spindle speed of 800 rpm, then the switching thresholds for the maximum and minimum speed must be configured in the relevant machine data of the second gear-stage data block (see the examples below).
Fundamentals 2.9 Motion commands 2.9.11.6 Example: Gearbox stage cannot be changed, gearbox stage monitoring If the spindle speed is programmed in addition to the geometry in the G331 block when using the second gear-stage data block, if the speed is not within the preset speed range (defined by the maximum and minimum speed thresholds) of the active gear stage, it will not be possible to change gear stages, because the path motion of the spindle and the infeed axis (axes) would not be retained.
Fundamentals 2.9 Motion commands 2.9.12 Tapping with compensating chuck 2.9.12.1 Tapping with compensating check and retraction motion (G63) For tapping with compensating chuck, using the G63 command, the following traversing motion is executed: ● G63: Tapping in the tapping direction up to the end of thread point ●...
Fundamentals 2.9 Motion commands Program code Comment N30 G63 Z3 M4 ; Retraction movement: absolute Z=3mm ; Direction of rotation reversal ; Spindle with counterclockwise direction of rotation, 200 rpm 2.9.13 Chamfer, rounding (CHF, CHR, RND, RNDM, FRC, FRCM) Contour corners within the active working plane can be executed as roundings or chamfers. For optimum surface quality, a separate feedrate can be programmed for chamfer/rounding.
Page 246
Fundamentals 2.9 Motion commands RNDM=… : Modal rounding (rounding multiple contour corners in the same way one after the other) Radius of the roundings (unit corresponding to G70/G71) <value>: Modal rounding is deactivated with RNDM=0. FRC=… : Non-modal feedrate for chamfer/rounding Feedrate in mm/min (with active G94) or mm/rev (with active G95) <value>: FRCM=…...
Page 247
Fundamentals 2.9 Motion commands Examples Example 1: Chamfer between two straight lines ● MD20201 Bit 0 = 1 (derived from previous block). ● G71 is active. ● The width of the chamfer in the direction of motion (CHR) should be 2 mm and the fee‐ drate for chamfer 100 mm/min.
Page 248
Fundamentals 2.9 Motion commands Example 2: Rounding between two straight lines ● MD20201 Bit 0 = 1 (derived from previous block). ● G71 is active. ● The radius of the rounding should be 2 mm and the feedrate for rounding 50 mm/min. Program code N30 G1 Z…...
Page 249
Fundamentals 2.9 Motion commands Program code N30 G1 Z… RND=2 FRC=50 N40 G3 X… Z… I… K… Example 4: Modal rounding to deburr sharp workpiece edges Program code Comment N30 G1 X… Z… RNDM=2 FRCM=50 ; Activate modal rounding. Radius of rounding: 2 mm Feedrate for rounding: 50 mm/min N40...
Fundamentals 2.10 Tool radius compensation 2.10 Tool radius compensation 2.10.1 Tool radius compensation (G40, G41, G42, OFFN) When tool radius compensation (TRC) is active, the control automatically calculates the equidistant tool paths for various tools. Syntax G0/G1 X... Y… Z... G41/G42 [OFFN=<value>] G40 X...
Page 252
Fundamentals 2.10 Tool radius compensation Note In the NC block with G40/G41/G42, G0 or G1 has to be active and at least one axis has to be specified on the selected working plane. If only one axis is specified on activation, the last position on the second axis is added automatically and traversed with both axes.
Page 253
Fundamentals 2.10 Tool radius compensation Example 2: "Conventional" procedure using milling as an example "Conventional" procedure: 1. Tool call. 2. Change tool. 3. Activate working plane and tool radius compensation. Program code Comment N10 G0 Z100 ; Retraction for tool change. N20 G17 T1 M6 ;...
Page 254
Fundamentals 2.10 Tool radius compensation Example 3: Turning Program code Comment … N20 T1 D1 ; Only tool length compensation is activated. N30 G0 X100 Z20 ; X100 Z20 is approached without compensation. N40 G42 X20 Z1 ; Radius compensation is activated, point X20/Z1 is approached with compensation.
Page 257
Fundamentals 2.10 Tool radius compensation From this information, the control detects the plane and therefore the axis directions in which it is corrected. Example: Milling tool Program code Comment N10 G17 G41 … ; The tool radius compensation is performed in the X/Y plane, the tool length compensation is performed in the Z direction.
Page 258
Fundamentals 2.10 Tool radius compensation NORM and KONT can be used to define the tool path on activation and deactivation of compensation mode (see "Approaching and leaving contour (NORM, KONT, KONTC, KONTT) (Page 260)"). Point of intersection The intersection point is selected in the setting data: SD42496 $SC_CUTCOM_CLSD_CONT (behavior of tool radius compensation with closed contour) Value...
Page 259
Fundamentals 2.10 Tool radius compensation Change in the working plane The working plane (G17/G18/G19) cannot be changed if G41/G42 is active. Change of tool offset data block (D…) The tool offset data block can be changed in compensation mode. A changed tool radius already becomes active as from the block containing the new D number. Note The radius change or compensation movement is performed across the entire block and only reaches the new equidistance at the programmed end point.
Fundamentals 2.10 Tool radius compensation Changing the tool radius The change can be made, e.g. using system variables. The sequence is the same as when changing the tool offset data block (D…). Note The modified values only take effect the next time T or D is programmed. The change does not apply until the next block.
Page 261
Fundamentals 2.10 Tool radius compensation Meaning Activate direct approach/retraction to/from a straight line. NORM: The tool is oriented perpendicular to the contour point. Activate approach/retraction with travel around the starting/end point according to the KONT: programmed corner behavior G450 or G451. Activate approach/retraction with constant curvature.
Page 262
Fundamentals 2.10 Tool radius compensation The associated NC program segment is as follows: Program code Comment $TC_DP1[1,1]=121 ; Milling tool $TC_DP6[1,1]=10 ; Radius 10 mm N10 G1 X0 Y0 Z60 G64 T1 D1 F10000 N20 G41 KONTC X70 Y0 Z0 ;...
Page 263
Fundamentals 2.10 Tool radius compensation Further information Approach/retraction with NORM 1. Approach: If NORM is activated, the tool will move directly to the compensated start position along a straight line (irrespective of the preset approach angle programmed for the travel movement) and is positioned perpendicular to the path tangent at the starting point.
Page 264
Fundamentals 2.10 Tool radius compensation NOTICE Risk of collision Modified approach/retract angles must be taken into account during programming in order that potential collisions can be avoided. Approach/retraction with KONT Prior to the approach, the tool can be located in front of or behind the contour. The path tangent at the starting point serves as a separation line: NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Page 265
Fundamentals 2.10 Tool radius compensation Accordingly, two scenarios need to be distinguished where approach/retraction with KONT is concerned: 1. The tool is located in front of the contour. → The approach/retract strategy is the same as with NORM. 2. The tool is located behind the contour. NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Page 266
Fundamentals 2.10 Tool radius compensation – Approach: The tool travels around the starting point either along a circular path or over the intersection of the equidistant paths depending on the programmed corner behavior (G450/G451). The commands G450/G451 apply to the transition from the current block to the next block: In both cases (G450/G451), the following approach path is generated: A straight line is drawn from the uncompensated approach point.
Page 267
Fundamentals 2.10 Tool radius compensation The contour point is approached/exited with constant curvature. There is no jump in acceleration at the contour point. The path from the start point to the contour point is interpolated as a polynomial. Approach/retraction with KONTT The contour point is approached/exited with constant tangent.
Fundamentals 2.10 Tool radius compensation 2.10.3 Compensation at the outside corners (G450, G451, DISC) With tool radius compensation activated (G41/G42), command G450 or G451 can be used to define the course of the compensated tool path when traveling around outside corners: With G450, the tool center point travels With G451, the tool center point approaches around the workpiece corner across an...
Page 269
Fundamentals 2.10 Tool radius compensation Meaning G450 is used to travel around workpiece corners on a circular path. G450: Flexible programming of the circular path with G450 (optional) DISC: Type: <value>: Range of values: 0, 1, 2, ... 100 Meaning: Transition circle Intersection of the equidistant paths (the‐...
Page 270
Fundamentals 2.10 Tool radius compensation Program code Comment N80 G40 X-20 Y50 ; Deactivate compensation mode, retraction on transition circle. N90 G0 Y100 N100 X200 M30 Further information G450/G451 At intermediate point P*, the control executes operations such as infeed movements or switching functions.
Fundamentals 2.10 Tool radius compensation When G451 is activated and with acute contour angles, superfluous non-cutting tool paths can result from lift-off movements. A parameter can be used in the machine data to define automatic switchover to transition circle in such cases. 2.10.4 Smooth approach and retraction 2.10.4.1...
Page 272
Fundamentals 2.10 Tool radius compensation When the function is activated, the control calculates the intermediate points in such a way that the transition to the following block (or the transition from previous block during retraction) is performed in accordance with the specified parameters. The approach movement consists of a maximum of four sub-movements.
Page 273
Fundamentals 2.10 Tool radius compensation 1. For approach and retraction with straight lines (G147/G148): DISR=...: Distance of the cutter edge from the starting point of the contour 2. For approach and retraction with circles (G247, G347/G248, G348): Radius of the tool center point path Notice: For REPOS with a semicircle, DISR is the circle diameter Distance of the end point for the fast infeed motion from the machining plane...
Page 274
Fundamentals 2.10 Tool radius compensation ● Current tool radius=10, and so the effective compensation radius for TRC=15, the radius of the SAR contour =25, with the result that the radius of the tool center path is equal to DISR=10 ● The end point of the circle is obtained from N30, since only the Z position is programmed in ●...
Page 275
Fundamentals 2.10 Tool radius compensation Figure 2-16 Approach movements with simultaneous activation of the tool radius compensation Selecting the approach and retraction direction Use the tool radius compensation (G140, default setting) to determine the approach and retraction direction with positive tool radius: ●...
Page 276
Fundamentals 2.10 Tool radius compensation Motion steps between start point and end point (G340 and G341). In all cases, the movements are made up of one or more straight lines and, depending on the G command for determining the approach contour, an additional straight line or a quadrant or semicircle.
Page 277
Fundamentals 2.10 Tool radius compensation Length of the approach straight line or radius for approach circles (DISR) ● Approach/retract with straight lines DISR specifies the distance of the cutter edge from the starting point of the contour, i.e. the length of the straight line when TRC is active is the sum of the tool radius and the programmed value of DISR.
Page 278
Fundamentals 2.10 Tool radius compensation Programming of end point P4 for approach End point P can be programmed in the actual SAR block. Alternatively, P can be determined by the end point of the next traversing block. More blocks can be inserted between an SAR block and the next traversing block without moving the geometry axes.
Page 279
Fundamentals 2.10 Tool radius compensation programmed. When determining the end point, a distinction is made between the following three cases: 1. No geometry axis is programmed in the SAR block. In this case, the contour ends at point P (if DISRP has been programmed), at point P (if DISCL, but not DISRP has been programmed) or point P (if neither DICLS nor DISRP has been programmed).
Page 280
Fundamentals 2.10 Tool radius compensation Approach and retraction velocities ● Velocity of the previous block (G0) All motions from P up to P are executed at this velocity, i.e. the motion parallel to the machining plane and the part of the infeed motion up to the safety clearance. ●...
Fundamentals 2.10 Tool radius compensation Reading positions Points P and P can be read in the WCS as a system variable during approach. ● $P_APR: reading P ● (initial point) ● $P_AEP: reading P ● (contour starting point) ● $P_APDV: read whether $P_APR and $P_AEP contain valid data 2.10.4.2 Approach and retraction with extended retraction strategies (G460, G461, G462) In certain special geometrical situations, special extended approach and retraction strategies,...
Page 283
Fundamentals 2.10 Tool radius compensation Note The approach behavior is symmetrical to the retraction behavior. The approach/retraction behavior is determined by the state of the G command in the approach/ retraction block. The approach behavior can therefore be set independently of the retraction behavior.
Page 284
Fundamentals 2.10 Tool radius compensation Figure 2-18 Retraction behavior with G461 Collision monitoring CDON, CDOF If CDOF is active (see section Collision monitoring, CDON, CDOF), the search is aborted when an intersection is found, i.e., the system does not check whether further intersections with previous blocks exist.
Fundamentals 2.10 Tool radius compensation If KONT is active (travel round contour at start or end point), the behavior differs according to whether the end point is in front of or behind the contour. ● End point in front of contour If the end point is in front of the contour, the retraction behavior is the same as with NORM.
Page 286
Fundamentals 2.10 Tool radius compensation Meaning Activating collision detection ("bottleneck detection") CDON: CDON performs a check over an adjustable (MD20240) number of blocks as to whether the tool paths of non-adjacent blocks intersect. This look-ahead function allows possible collisions to be detected in advance and permits the control to actively avoid them. Deactivating collision detection ("bottleneck detection") CDOF: With CDOF, a search is made in the previous traversing block (at inside corners) for a...
Fundamentals 2.10 Tool radius compensation 2.10.6 2 1/2 D tool offset (CUT2D, CUT2DD, CUT2DF, CUT2DFD) The 2½ D tool radius compensation should be used if, when machining inclined surfaces, the workpiece is to be rotated, and not the tool alignment. This function is activated using commands CUT2D, CUT2DD, CUT2DF oder CUT2DFD.
Page 288
Fundamentals 2.10 Tool radius compensation Further information Contour tools ● Enabling Tool radius compensation for contour tools is enabled on a channel-specific basis using: MD28290 $MC_MM_SHAPED_TOOLS_ENABLE ● Tool type Contour tool types are defined on a channel-specific basis using: MD20370 $MC_SHAPED_TOOL_TYPE_NO ●...
Fundamentals 2.10 Tool radius compensation Requirement: At the machine, the tool orientation must be able to be adjusted perpendicular to the rotated machining plane, and set for machining. Note The tool length compensation continues to be active relative to the non-rotated working plane. For further information see the "Tools"...
Page 290
Fundamentals 2.10 Tool radius compensation Meaning Command to activate the "Keep tool radius compensation constant" function CUTCONON: Command to deactivate the "Keep tool radius compensation constant" function CUTCONOF: Example Program code Comment ; Definition of tool d1. N20 $TC_DP1[1,1] = 110 ;...
Fundamentals 2.10 Tool radius compensation Program code Comment N140 X0 Y0 G40 N150 M30 Further information Tool radius compensation is normally active before the compensation suppression and is still active when the compensation suppression is deactivated again. In the last traversing block before CUTCONON, the offset point in the block end point is approached.
Page 292
Fundamentals 2.10 Tool radius compensation Further information The original functionality has been modified as follows: ● A change from G40 to G41/G42 and vice-versa is no longer treated as a tool change. Therefore, a preprocessing stop no longer occurs with TRANSMIT. ●...
Fundamentals 2.11 Path action 2.11 Path action 2.11.1 Exact stop (G60, G9, G601, G602, G603) In exact stop traversing mode, all path axes and special axes involved in the traversing motion that are not traversed modally, are decelerated at the end of each block until they come to a standstill.
Fundamentals 2.11 Path action dynamic response of the axes and the path velocity. The workpiece corners can now be rounded. Configured exact stop criterion A channel-specific setting can be made for G0 and the other commands in the 1st G group indicating that contrary to the programmed exact stop criterion, a preset criterion should be used automatically (see the machine manufacturer's specifications).
Page 296
Fundamentals 2.11 Path action Continuous-path mode is not suitable if: ● A contour needs to be traversed precisely ● An absolutely constant velocity is required Note Continuous-path mode is interrupted by blocks which trigger a preprocessing stop implicitly, e.g. due to: ●...
Page 297
Fundamentals 2.11 Path action Continuous-path mode with smoothing within the defined tolerances (block-in‐ G643: ternal) G643 differs from G642 in that is not used to generate a separate rounding block; instead, axis-specific block-internal rounding movements are inserted. The rounding clearance can be different for each axis. Continuous-path mode with smoothing with maximum possible dynamic re‐...
Page 298
Fundamentals 2.11 Path action The two outside corners on the groove are to be approached exactly. Otherwise machining should be performed in continuous-path mode. Program code Comment N05DIAMOF ; Radius as dimension N10 G17 T1 G41 G0 X10 Y10 Z2 S300 M3 ;...
Page 299
Fundamentals 2.11 Path action Corners are also traversed at a constant velocity. In order to minimize the contour error, the velocity is reduced according to an acceleration limit and an overload factor. Note The extent of smoothing the contour transitions depends on the feedrate and the overload factor.
Page 300
Fundamentals 2.11 Path action Continuous-path mode with smoothing as per distance criterion (G641) With G641, the control inserts transition elements at contour transitions. The smoothing clearance ADIS (or ADISPOS for G0) specifies the maximum extent to which corners can be smooth (rounded).
Page 301
Fundamentals 2.11 Path action Note Smoothing cannot and should not replace the functions for defined smoothing (RND, RNDM, ASPLINE, BSPLINE, CSPLINE). Smoothing with axial precision with G642 With G642, smoothing does not take place within a defined ADIS range; instead, the axial tolerances defined with MD33100 $MA_COMPRESS_POS_TOL are applied.
Page 302
Fundamentals 2.11 Path action Smoothing with greatest possible dynamic response in G644 Smoothing with maximum possible dynamic response is configured in the thousands place with MD20480 $MC_SMOOTHING_MODE. Value Meaning Specification of maximum axial deviations with: MD33100 $MA_COMPRESS_POS_TOL Specification of maximum smoothing path by programming: ADIS=...
Page 303
Fundamentals 2.11 Path action No intermediate smoothing blocks An intermediate smoothing block is not inserted in the following cases: ● The axis stops between the two blocks. This occurs when: – The following block contains an auxiliary function output before the motion. –...
Page 304
Fundamentals 2.11 Path action ● Smoothing is not parameterized. This occurs when: – for G641 in G0 blocks, ADISPOS=0 (preassignment!). – for G641 in non G0 blocks, ADISPOS=0 (preassignment!). – for G641, for transition from G0 to non-G0 or non-G0 to G0, the lower of the values from ADISPOS and ADIS applies.
Fundamentals 2.12 Coordinate transformations (frames) 2.12 Coordinate transformations (frames) 2.12.1 Frames Frame The frame is a self-contained arithmetic rule that transforms one Cartesian coordinate system into another Cartesian coordinate system. Basic frame (basic offset) The basic frame describes coordinate transformation from the basic coordinate system (BCS) to the basic zero system (BZS) and has the same effect as settable frames.
Page 306
Fundamentals 2.12 Coordinate transformations (frames) Programmable 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 can be achieved using programmable frames. See Frame instructions (Page 307).
Fundamentals 2.12 Coordinate transformations (frames) 2.12.2 Frame instructions Function The statements for programmable frames apply in the current NC program. They function as either additive or substitute elements: ● Substitute statement Deletes all previously programmed frame statements. The reference is provided by the last settable zero offset called (G54 to G57, G505 to G599).
Page 309
Fundamentals 2.12 Coordinate transformations (frames) Workpiece coordinate system offset in the direction of the specified ge‐ TRANS/ATRANS: ometry axis or axes Workpiece coordinate system rotation: ROT/AROT: ● By linking individual rotations around the specified geometry axis or axes ● Around the angle RPL=... in the current working plane (G17/G18/G19) Direction of rotation: Rotation sequence:...
Fundamentals 2.12 Coordinate transformations (frames) ● Frame statements are executed in the programmed sequence. ● Additive statements are frequently used in subprograms. The basic statements defined in the main program are not lost after the end of the subprogram if the subprogram has been programmed with the SAVE attribute.
Page 311
Fundamentals 2.12 Coordinate transformations (frames) Examples Example 1: Milling With this workpiece, the shapes shown recur in a program. The machining sequence for this shape is stored in a subprogram. Zero offset is used to set the work‐ piece zeros required in each case and then call the subprogram.
Page 312
Fundamentals 2.12 Coordinate transformations (frames) Example 2: Turning Program code Comment N10 TRANS X0 Z150 ; Absolute offset N15 L20 ; Subprogram call N20 TRANS X0 Z140 (or ATRANS Z-10) ; Absolute offset N25 L20 ; Subprogram call N30 TRANS X0 Z130 (or ATRANS Z-10) ;...
Page 313
Fundamentals 2.12 Coordinate transformations (frames) TRANS TRANS Note ATRANS can be used to program an offset to be added to existing frames. ATRANS X... Y... Z... Translation through the offset values programmed in the specified axis directions. The currently set or last programmed zero point is used as the reference. ATRANS TRANS NC programming...
Fundamentals 2.12 Coordinate transformations (frames) 2.12.4 Programmable work offset (G58, G59) The G58 and G59 functions can be used to substitute translation components of the programmable work offset (TRANS/ATRANS) (Page 310) with specific axes: ● G58: Absolute translation component (coarse offset) ●...
Fundamentals 2.12 Coordinate transformations (frames) 2.12.5 Programmable rotation (ROT, AROT, RPL) The workpiece coordinate system can be rotated in space with the ROT/AROT statements. The statements refer exclusively to the programmable frame $P_PFRAME. Syntax ROT <1st GeoAx><angle> <2nd GeoAx><angle> <3rd GeoAx><angle> ROT RPL=<angle>...
Page 317
Fundamentals 2.12 Coordinate transformations (frames) Rotation around the geometry axis perpendicular to the active plane (G17, G18, RPL: G19) by the specified angle Reference Programmable frame $P_PFRAME frame: Reference point: Zero point of the current workpiece coordinate system set with G54 ... G57, G505 ... G599 Angle specification in degrees.
Page 318
Fundamentals 2.12 Coordinate transformations (frames) Example 2: Spatial rotation around the Y axis In this example, paraxial and inclined workpiece surfaces are to be ma‐ chined in a clamping. Condition: The tool must be aligned perpendic‐ ular to the inclined surface in the ro‐ tated Z direction.
Page 319
Fundamentals 2.12 Coordinate transformations (frames) Example 3: Multi-face machining In this example, identical shapes are ma‐ chined in two workpiece surfaces perpendicu‐ lar to one another via subprograms. In the new coordinate system on the right-hand work‐ piece surface, infeed direction, working plane and the zero point have been set up as on the top surface.
Page 320
Fundamentals 2.12 Coordinate transformations (frames) Program code Comment N50 AROT Z90 ; Additive rotation of the WCS around Z through 90° N60 L10 ; Subprogram call N70 G0 X300 Y100 M30 ; Retraction, end of program Further information Rotation in the active plane When programming using RPL=…, the WCS is rotated around the axis perpendicular to the active plane.
Page 321
Fundamentals 2.12 Coordinate transformations (frames) ① Angle of rotation Figure 2-20 Absolute rotation around the Z axis Additive rotation with AROT X... Y... Z... The WCS is rotated further around the specified axes through the programmed angles of rotation. ① Angle of rotation Figure 2-21 Absolute and additive rotation around the Z axis...
Fundamentals 2.12 Coordinate transformations (frames) Requirement: The tool must be perpendicular to the working plane and the positive direction of the infeed axis points in the direction of the tool base. Specifying CUT2DF activates the tool radius compensation in the rotated plane. 2.12.6 Programmable frame rotations with solid angles (ROTS, AROTS, CROTS) Rotations of the workpiece coordinate system can be specified in solid angles with the ROTS,...
Page 323
Fundamentals 2.12 Coordinate transformations (frames) ① Inclined plane α, β, γ Solid angle Alignment of the G17 plane parallel to the inclined plane: ● 1st rotation Rotation of x around y through angle α ⇒ x'-axis parallel to the inclined plane ●...
Page 324
Fundamentals 2.12 Coordinate transformations (frames) Syntax Requirements The position of a plane in space is clearly defined by two solid angles. The plane would be "over- defined" by the specification of a third solid angle. It is therefore not permitted. If only one solid angle is programmed, the rotation of the WCS is identical to ROT, AROT (see Section "Programmable rotation (ROT, AROT, RPL) (Page 316)").
Fundamentals 2.12 Coordinate transformations (frames) Meaning Absolute frame rotations with solid angles, ROTS: reference frame: Programmable frame $P_PFRAME Additive frame rotations with solid angles, AROTS: reference frame: Programmable frame $P_PFRAME Absolute frame rotations with solid angles, CROTS: reference frame: Programmed frame $P_ ... Geometry axis identifiers (see note above: Geometry axis identifiers) X, Y, Z: Α, β, γ:...
Page 326
Fundamentals 2.12 Coordinate transformations (frames) Example The pocket occurs twice on this workpiece, but with different sizes and rotated in relation to one another. The machining sequence is stor‐ ed in the subprogram. The required workpiece zeroes are set with zero offset and rotation, the contour is scaled down with scaling and the subprogram is then called again.
Page 327
Fundamentals 2.12 Coordinate transformations (frames) ASCALE X... Y... Z... The ASCALE command is used to program scale changes to be added to existing frames. In this case, the last valid scale factor is multiplied by the new one. The currently set or last programmed coordinate system is used as the reference for the scale change.
Fundamentals 2.12 Coordinate transformations (frames) Different scale factors NOTICE Risk of collision Please take great care when using different scale factors! Circular interpolations can, for example, only be scaled using identical factors. Note However, different scale factors can be used specifically to program distorted circles. 2.12.8 Programmable mirroring (MIRROR, AMIRROR) MIRROR/AMIRROR can be used to mirror workpiece shapes on coordinate axes.
Page 329
Fundamentals 2.12 Coordinate transformations (frames) Meaning Mirror absolute in relation to the currently valid coordinate system set with MIRROR: G54 to G57, G505 to G599. Additive mirror image with reference to the currently valid set or program‐ AMIRROR: med coordinate system. X...
Page 330
Fundamentals 2.12 Coordinate transformations (frames) Example 2: Turning The actual machining is stored as a subpro‐ gram and execution at the respective spindle is implemented by means of mirroring and off‐ sets. Program code Comment N10 TRANS X0 Z140 ; Zero offset to W ;...
Page 331
Fundamentals 2.12 Coordinate transformations (frames) Mirroring is implemented in relation to the currently valid coordinate system set with G54 to G57, G505 to G599. NOTICE No original frame The MIRROR command resets all frame components of the previously activated programmable frame. AMIRROR X...
Page 332
Fundamentals 2.12 Coordinate transformations (frames) Tool radius compensation Note The mirror command causes the control to automatically change the path compensation commands (G41/G42 or G42/G41) according to the new machining direction. The same applies to the direction of circle rotation (G2/G3 or G3/G2). Note If you program an additive rotation with AROT after MIRROR, you may have to work with reversed directions of rotation (positive/negative or negative/positive).
Fundamentals 2.12 Coordinate transformations (frames) MD10612 $MN_MIRROR_TOGGLE = <value> Value Meaning Programmed axis values are not evaluated. Programmed axis values are evaluated: ● For programmed axis values ≠ 0, the axis is mirrored if it has not yet been mirrored. ●...
Page 334
Fundamentals 2.12 Coordinate transformations (frames) Syntax TOFRAME/TOFRAMEZ/TOFRAMEY/TOFRAMEX TOROTOF TOROT/TOROTZ/TOROTY/TOROTX TOROTOF PAROT PAROTOF Meaning Align Z axis of the WCS by rotating the frame parallel to the tool orientation TOFRAME: As TOFRAME TOFRAMEZ: Align Y axis of the WCS by rotating the frame parallel to the tool orientation TOFRAMEY: Align X axis of the WCS by rotating the frame parallel to the tool orientation TOFRAMEX:...
Fundamentals 2.12 Coordinate transformations (frames) Example Program code Comment N100 G0 G53 X100 Z100 D0 N120 TOFRAME N140 G91 Z20 ; TOFRAME is included in the calculation, all program- med geometry axis movements refer to the new coordinate system. N160 X50 Further information Assigning axis direction If one of the TOFRAMEX, TOFRAMEY, TOROTX, TOROTY statements is programmed...
Fundamentals 2.12 Coordinate transformations (frames) MIRROR Meaning Non-modal suppression of all programmable and settable G53: frames G153 has the same effect as G53 and also suppresses the G153: entire basic frame ($P_ACTBFRAME). SUPA has the same effect as G153 and also suppresses: SUPA: ●...
Page 337
Fundamentals 2.12 Coordinate transformations (frames) Meaning Procedure for the deselection of the following offsets and overlays of an axis: CORROF: ● DRF offset ● Position offsets ($AA_OFF) Effective‐ Modal ness: Axis identifier (channel, geometry or machine axis identifier) <Axis>: Data type: AXIS Character string for the definition of the overlay type <String>:...
Page 338
Fundamentals 2.12 Coordinate transformations (frames) Program code Comment N80 CORROF(X,"AA_OFF") Example 4: Axis-specific deselection of a DRF offset and a $AA_OFF position offset (1) A DRF offset is generated in the X axis by DRF handwheel traversal. No DRF offsets are operative for any other axes in the channel.
Fundamentals 2.12 Coordinate transformations (frames) Automatic channel axis exchange If an axis that is active in another channel has been programmed for a CORROF, it will be fetched into the channel with an axis exchange (requirement: MD30552 $MA_AUTO_GET_TYPE > 0) and the position offset and/or the DRF offset deselected.
Fundamentals 2.12 Coordinate transformations (frames) Example 3: Axis-specific deselection of a DRF offset and a $AA_OFF position offset (1) A DRF offset is generated in the X axis by DRF handwheel traversal. No DRF offsets are operative for any other axes in the channel. Program code Comment N10 WHEN TRUE DO $AA_OFF[X]=10 G4 F5...
Page 341
Fundamentals 2.12 Coordinate transformations (frames) Meaning Activation of the grinding frame <n> of the data management GFRAME<n>: G group: Basic position: MD20150 $MC_GCODE_RESET_VALUES[63] Effectiveness: Modal Number of the grinding frame <n>: Range of values: 0, 1, 2, ... 100 NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Fundamentals 2.13 Auxiliary function outputs 2.13 Auxiliary function outputs Function The auxiliary function output sends information to the PLC indicating when the NC program needs the PLC to perform specific switching operations on the machine tool. The auxiliary functions are output, together with their parameters, to the PLC interface. The transferred values and signals must be processed by the PLC user program.
Page 343
Fundamentals 2.13 Auxiliary function outputs Function Address extension Value Explanations Maximum number per Meaning Range Range Type Meaning block Spindle no. 1 - 12 0 ... ± 1.8*10 REAL Speed Without spindle number, the function applies for the mas‐ ter spindle. 0 - 99 0 ...
Fundamentals 2.13 Auxiliary function outputs Function outputs for travel commands The transfer of information as well as waiting for the appropriate response takes time and therefore influences the traversing movements. High-speed acknowledgment without block change delay Block change behavior can be influenced by machine data. When the "without block change delay"...
Page 345
Fundamentals 2.13 Auxiliary function outputs Meaning Address for the programming of the M functions. The extended address notation applies for some M functions (e.g. <address extension>: specification of the spindle number for spindle functions). Assignment is made to a certain machine function through the value <value>: assignment (M function number).
Page 346
Fundamentals 2.13 Auxiliary function outputs M functions defined by the machine manufacturer All free M function numbers can be used by the machine manufacturer, e.g. for switching functions to control the clamping devices or for the activation/deactivation of further machine functions.
Page 347
Fundamentals 2.13 Auxiliary function outputs Programmed stop 1 - optional stop: M1 M1 can be set via: ● HMI / dialog box "Program Control" ● NC/PLC interface The program execution of the NC is stopped by the programmed blocks. Programmed stop 2 - an auxiliary function associated with M1 with stop in the program execution Programmed stop 2 can be set via the HMI / dialog box "Program Control"...
Fundamentals 2.14 Supplementary commands 2.14 Supplementary commands 2.14.1 Output messages (MSG) Using the MSG() statement, any character string from the part program can be output as message to the operator. Syntax MSG("<Message text>"[,<Execution>]) MSG () Meaning Predefined subprogram call for output of a message MSG: Any character string to be displayed as message <message text>:...
Fundamentals 2.14 Supplementary commands Examples Example 1: Output/delete message Program code Comment N10 G91 G64 F100 ; Continuous path mode N20 X1 Y1 N... X... Y... N20 MSG ("Machining part 1") ; The message is first output with N30. ; continuous-path mode is retained. N30 X...
Page 350
Fundamentals 2.14 Supplementary commands Optional parameters to define the instant in time when the string is written. <ExecTime>: Type: Range of values: 0, 1 0 (default) No dedicated main run block is not gen‐ erated to write the character string. This is realized in the next NC block that can be executed.
Fundamentals 2.14 Supplementary commands 2.14.3 Working area limitation 2.14.3.1 Working area limitation in BCS (G25/G26, WALIMON, WALIMOF) G25/G26 limits the working area (working field, working space) in which the tool can traverse. The areas outside the working area limitations defined with G25/G26 are inhibited for any tool motion.
Page 352
Fundamentals 2.14 Supplementary commands Syntax G25 X…Y…Z… G26 X…Y…Z… WALIMON WALIMOF Meaning Lower working area limitation G25: Assignment of values in channel axes in the basic coordinate system Upper working area limitation G26: Assignment of values in channel axes in the basic coordinate system Lower or upper working area limits for individual channel axes X…...
Page 353
Fundamentals 2.14 Supplementary commands Example Using the working area limitation G25/26, the working area of a lathe is limited so that the surrounding devices and equipment - such as revolv‐ er, measuring station, etc. are protected against damage. Default setting: WALIMON Program code Comment N10 G0 G90 F0.5 T1...
Fundamentals 2.14 Supplementary commands If the tool reference point lies outside the working area defined by the working area limitation, or if this area is exited, then the program sequence is stopped. Note If transformations are active, the tool data taken into consideration (tool length and tool radius) can deviate from the described behavior.
Page 355
Fundamentals 2.14 Supplementary commands $P_WORKAREA_CS_LIMIT_MINUS[<WALimNo>,<Ax>]=<Value> WALCS<n> WALCS0 Meaning $P_WORKAREA_CS_COORD_SYSTEM[<WALimNo>]=<Value> The coordinate system to which the working area limitation group refers Working area limitation group <WALimNo>: Type: Range of values: 0 (group 1) ... 9 (group 10) Value of the type INT <Value>: Workpiece coordinate system (WCS) Settable zero system (SZS)
Page 356
Fundamentals 2.14 Supplementary commands Channel axis name <Ax>: Value of the type REAL <Value>: $P_WORKAREA_CS_LIMIT_MINUS[<WALimNo>,<Ax>]=<Value> Working area limitation in the negative direction of the specified channel axis Working area limitation group <WALimNo>: Type: Range of val‐ 0 (group 1) ... 9 (group 10) ues: Channel axis name <Ax>:...
Fundamentals 2.14 Supplementary commands Program code Comment N51 $P_WORKAREA_CS_COORD_SYSTEM[1]=1 ; The working area limitation of working area limitation group 2 applies in the WCS. N60 $P_WORKAREA_CS_PLUS_ENABLE[1,X]=TRUE N61 $P_WORKAREA_CS_LIMIT_PLUS[1,X]=10 N62 $P_WORKAREA_CS_MINUS_ENABLE[1,X]=FALSE N70 $P_WORKAREA_CS_PLUS_ENABLE[1,Y]=TRUE N73 $P_WORKAREA_CS_LIMIT_PLUS[1,Y]=34 N72 $P_WORKAREA_CS_MINUS_ENABLE[1,Y]=TRUE N73 $P_WORKAREA_CS_LIMIT_MINUS[1,Y]=–25 N80 $P_WORKAREA_CS_PLUS_ENABLE[1,Z]=FALSE N82 $P_WORKAREA_CS_MINUS_ENABLE[1,Z]=TRUE N83 $P_WORKAREA_CS_LIMIT_PLUS[1,Z]=–600 N90 WALCS2...
Fundamentals 2.14 Supplementary commands Meaning G command call reference point approach G74: X1=0 Y1=0 Z1=0 … : The specified machine axis address X1, Y1, Z1 … for linear axes is approached as the reference point. A1=0 B1=0 C1=0 … : The specified machine axis address A1, B1, C1 …...
Page 359
Fundamentals 2.14 Supplementary commands Requirements The following requirements must be satisfied to approach fixed points with G75: ● The fixed-point coordinates must have been calculated exactly and written to machine data. ● The fixed points must be located within the valid traversing range (→ note the software limit switch limits!) ●...
Page 360
Fundamentals 2.14 Supplementary commands Fixed point that is to be approached FP=: Fixed point number <n>: Range of values: 1, 2, 3, 4 Note: In the absence of FP=<n> or a fixed point number, or if FP=0 has been programmed, this is interpreted as FP=1 and fixed point 1 is approached. Note Multiple axes can be programmed in one G75 block.
Page 361
Fundamentals 2.14 Supplementary commands Note If the "Tool management with magazines" function is active, the auxiliary function T… or M... (typically M6) will not be sufficient to trigger a block change inhibit at the end of G75 motion. Reason: If "Tool management with magazines" is active, auxiliary functions for tool change are not output to the PLC.
Fundamentals 2.14 Supplementary commands Working area limitation in the workpiece coordinate system/SZS Coordinate-system-specific working area limitation (WALCS0 ... WALCS10) is not effective in the block with G75. The destination point is monitored as the starting point of the following block. Axis/Spindle movements with POSA/SPOSA If programmed axes/spindles were previously traversed with POSA or SPOSA, these movements will be completed first before the fixed point is approached.
Page 363
Fundamentals 2.14 Supplementary commands FXSW[<axis>]=… FXS[<axis>]=… FXST[<axis>]=… FXS[<axis>]=… FXST[<axis>]=… FXSW[<axis>]=… Meaning Command for activation and deactivation of the "Travel to fixed stop" function FXS: Activate function FXS[<axis>]=1: Deactivate function FXS=[<axis>]=0: Optional command for setting the clamping torque FXST: Specified as % of the maximum drive torque Optional command for setting the window width for the fixed stop monitoring FXSW: Specified in mm, inches or degrees...
Page 364
Fundamentals 2.14 Supplementary commands Example: Program code Comment X250 Y100 F100 FXS[X1]=1 FXST[X1]=12.3 FXSW[X1]=2 ; Axis X1 travels with feedrate F100 (specification optional) to target position X=250 mm. The clamping torque is 12.3% of the maximum drive torque, moni- toring is performed in a 2 mm wide window.
Page 365
Fundamentals 2.14 Supplementary commands Clamping torque (FXST) and monitoring window (FXSW) Any programmed torque limiting FXST is effective from the block start, i.e. the fixed stop is also approached at a reduced torque. FXST and FXSW can be programmed and changed in the part program at any time.
Page 366
Fundamentals 2.14 Supplementary commands If an anticipated event ($R3) has occurred and the status "Limit stop contacted" (system variable $AA_FXS) is reached, then FXS must be deselected. Program code IDS=4 WHENEVER (($R3==1) AND ($AA_FXS[Y]==1)) DO FXS[Y]=0 FA[Y]=1000 POS[Y]=0 Fixed stop reached When the fixed stop has been reached: ●...
Fundamentals 2.14 Supplementary commands 2.14.7 Dwell time (G4) With the command G4, a time (dwell time) is programmed in a block that expires as soon as the block is executed in the main run. The block change to the following block is performed as soon as the time has completely expired.
Page 368
Fundamentals 2.14 Supplementary commands The effective dwell time depends on the setting in the machine data MD10280 $MN_PROG_FUNCTION_MASK, Bit 4 = <value> Value Meaning The effective dwell time is equal to the programmed dwell time The effective dwell time is equal to the programmed dwell time rounded to the next largest multiple of the interpolator cycle (MD10071 $MN_IPO_CYCLE_TIME) Program example: ●...
Fundamentals 2.14 Supplementary commands Program code Comment N40 G4 S30 ; Dwelling 30 revolutions of the spindle (at S=300 rpm and 100% speed override, corresponds to: t = 0.1 min). N50 X... ; The feedrate and spindle speed programmed in N10 continue to apply.
Fundamentals 2.15 Other information 2.15 Other information 2.15.1 Axes Axis types A distinction is made between the following types of axis types when programming: ● Main axes / geometry axes ● Special axes ● Main spindle, master spindle ● Machine axes ●...
Page 371
Fundamentals 2.15 Other information In NC technology, the main axes are called geometry axes. This term is also used in this Programming Guide. Replaceable geometry axes The "Replaceable geometry axes" function (see Function Manual, Job Planning) can be used to alter the geometry axes grouping configured using machine data from the part program. Here any geometry axis can be replaced by a channel axis defined as a synchronous special axis.
Fundamentals 2.15 Other information 2.15.1.2 Special axes In contrast to the geometry axes, no geometrical relationship is defined between the special axes. Typical special axes are: ● Tool revolver axes ● Swivel table axes ● Swivel head axes ● Loader axes Axis identifier On a turning machine with circular magazine, for example: ●...
Fundamentals 2.15 Other information Axis identifier The name/identifier of a machine axis can be defined using the following NC-specific machine data: MD10000 $MN_AXCONF_MACHAX_NAME_TAB (machine axis name) Default setting: X1, Y1, Z1, A1, B1, C1, U1, V1 Further, machine axes have fixed axis identifiers, which can always be used, independent of the names set in the machine data: AX1, AX2, …, AX<n>...
Fundamentals 2.15 Other information Typical positioning axes are: ● Loaders for moving workpieces to the machine ● Loaders for moving workpieces away from the machine ● Tool magazine/turret Types A distinction is made between positioning axes with synchronization at the block end or over several blocks.
Fundamentals 2.15 Other information 2.15.1.9 Command axes Command axes are started from synchronized actions in response to an event (command). They can be positioned, started and stopped fully asynchronous to the part program. An axis cannot be moved from the part program and from synchronized actions simultaneously. Command axes are interpolated separately;...
Page 376
Fundamentals 2.15 Other information Further information Requirements ● The participating NCUs, NCU1 and NCU2, must be connected by means of high-speed communication via the link module. ● The axis must be configured appropriately by machine data. ● The "Link axis" option must be installed. Description The position control is implemented on the NCU on which the axis is physically connected to the drive.
Fundamentals 2.15 Other information 2.15.1.12 Lead link axes A leading link axis is one that is interpolated by one NCU and utilized by one or several other NCUs as the master axis for controlling slave axes. An axial position controller alarm is sent to all other NCUs, which are connected to the affected axis via a leading link axis.
Page 378
Fundamentals 2.15 Other information Further information Requirements ● The NCUs involved, i.e., NCU1 to NCU<n> (<n> equals max. of 8), must be interconnected via the link module for high-speed communication. Reference: Device Manual Configuration NCU ● The axis must be configured appropriately by machine data. ●...
Fundamentals 2.15 Other information 2.15.2 From travel command to machine movement The relationship between the programmed axis movements (travel commands) and the resulting machine movements is illustrated in the following figure: 2.15.3 Path calculation The path calculation determines the distance to be traversed in a block, taking into account all offsets and compensations.
Fundamentals 2.15 Other information If a new zero offset and a new tool offset are programmed in a new program block, the following applies: ● With absolute dimensioning: Path = (absolute dimension P2 - absolute dimension P1) + (WO P2 - WO P1) + (TO P2 - TO P1).
Page 381
Fundamentals 2.15 Other information Modal/non-modal addresses Modal addresses remain valid with the programmed value (in all subsequent blocks) until a new value is programmed at the same address. Non-modal addresses only apply in the block, in which they were programmed. Example: Program code Comment...
Fundamentals 2.15 Other information Program code Comment X4=20 ; Axis X4; "=" is required CR=7.3 ; Two letters; "=" are required S1=470 ; Speed for 1st spindle: 470 rpm M3=5 ; Spindle stop for 3rd spindle The numeric extension can be replaced by a variable for addresses M, H, S and for SPOS and SPOSA.
Page 383
● CYCLE ● CUST_ ● GROUP_ ● _ ● S_ ● E_ ● F_ SIEMENS compile cycles ● CCS_ User compile cycles ● CC_ User cycles We recommend that the names of user cycles begin with U_. Variables Information relating to the name assignment for variables is provided in the following chapters: ●...
Fundamentals 2.15 Other information 2.15.6 Constants Constant (general) A constant is a data element whose value does not change during the execution of a program, e.g. a value assignment to an address. Decimal constant The numeric value of a decimal constant is displayed in the decimal system. INTEGER constant An INTEGER constant is an integer value, i.e.
Fundamentals 2.15 Other information Hexadecimal constants are enclosed in single quotation marks and start with the letter "H", followed by the value in hexadecimal notation. Separators are permitted between the letters and digits. Example: Program code Comment $MC_TOOL_MANAGEMENT_MASK='H7F' ; By assigning the hexadecimal constant, bits 0 to 7 are set in the machine data.
Page 386
Fundamentals 2.15 Other information Operator Meaning ● Division in synchronous actions: INT / INT ⇒ INT ● Division in synchronous actions with REAL result by using the function ITOR(): ITOR( INT ) / ITOR( INT ) ⇒ REAL ● Division in NC programs: INT / INT ⇒ REAL Integer division: INT / INT ⇒...
Page 387
Fundamentals 2.15 Other information Priority of the operators The operators have the following priorities for execution in the synchronous action (highest priority: 1): Priori‐ Operators Meaning NOT, B_NOT Negation, bit-by-bit negation *, /, DIV, MOD Multiplication, division +, - Addition, subtraction B_AND Bit-by-bit AND B_XOR...
Page 388
Fundamentals 2.15 Other information Indexing The index of a system variable of type "Array of …" can in turn be a system variable. The index is also evaluated in the main run in the interpolator clock cycle. Example Program code ...
Work preparation Flexible NC programming 3.1.1 Variables The use of variables from the system data and user data areas, especially in conjunction with arithmetic functions and check structures, enables highly flexible NC programs and cycles to be written. WARNING Material damage and personal injuries caused by changed variables When using variables in the NC program it must be taken into account that machine operators or unauthorized persons with corresponding access rights can change the variables and thus affect the program run.
Work preparation 3.1 Flexible NC programming 3.1.1.1 System data The system data contain the variables that are predefined in the system and enable access to the current parameter settings of the control, as well as to machine, control, and process states, in NC programs and cycles.
Page 391
Work preparation 3.1 Flexible NC programming $ + 1. Letter Meaning: Data type R-parameters (arithmetic parameters) Whether machine and setting data is treated as preprocessing or main run variables depends on whether they are written with one or two $ characters. The notation is freely selectable for the specific application.
Work preparation 3.1 Flexible NC programming 3.1.1.2 Predefined user variables: Channel-specific arithmetic parameters (R) Channel-specific arithmetic parameters or R parameters are predefined user variables with the designation R, defined as an array of the REAL data type. For historical reasons, notation both with array index, e.g.
Work preparation 3.1 Flexible NC programming Example Assignments to R-parameters and use of R-parameters in mathematical functions: Program code Comment R0=3.5678 ; Assignment in preprocessing R[1]=-37.3 ; Assignment in preprocessing R3=-7 ; Assignment in preprocessing $R4=-0.1EX-5 ; Assignment in the main program run: R4 = -0.1 * 10^-5 $R[6]=1.874EX8 ;...
Page 394
Work preparation 3.1 Flexible NC programming The global R parameters are read and written from the user interface or in the NC program during the preprocessing. Synchronous actions and technology cycles cannot be used. Note No synchronization between the channels when reading and writing global R parameters. Because the reading and writing is performed during the preprocessing, the point in time when a written value from one channel becomes active in another channel is not defined.
Work preparation 3.1 Flexible NC programming Value of the global R parameter <value>: Type: REAL Range of values: For a non-exponential notation: ± (0.000 0001 ... 9999 9999) Note: A maximum of eight decimal places are permitted For an exponential notation: ±...
Page 396
Work preparation 3.1 Flexible NC programming Link variable for REAL data format (8 bytes) $A_DLR: Data type: REAL Range of values: ±(2.2*10 … 1.8*10 -308 +308 Address index in bytes, counted from the start of the link variable memory <index>: Data type: Range of values: 0 - MAX_INDEX Note...
Work preparation 3.1 Flexible NC programming NCU1 NCU1 uses link variable $A_DLR[ 16 ] to write the actual current value of axis AX2 to the link variables memory cyclically in the interpolation cycle in a static synchronized action. Program code N111 IDS=1 WHENEVER TRUE DO $A_DLR[16]=$VA_CURR[AX2] NCU2 NCU2 uses link variable $A_DLR[ 16 ] to read the actual current value of axis AX2 to the link...
Page 398
Work preparation 3.1 Flexible NC programming User variables must be defined before they can be used (read/write). The following rules must be observed in this context: ● GUDs must be defined in a definition file, e.g. _N_DEF_DIR/_N_UGUD_DEF. ● PUDs and LUDs must be defined in the definition section of the NC program. ●...
Page 399
Work preparation 3.1 Flexible NC programming Data type: <type>: Integer with sign INT: Real number (LONG REAL to IEEE) REAL: Truth value TRUE (1)/FALSE (0) BOOL: ASCII character CHAR: Character string of a defined length STRING[<MaxLength>]: Axis/spindle identifier AXIS: Geometric data for a static coordinate trans‐ FRAME: formation See "Data types (Page 423)"...
Work preparation 3.1 Flexible NC programming Supplementary conditions Global user variables (GUD) In the context of the definition of global user variables (GUD), the following machine data has to be taken into account: Identifier: $MN_ Meaning 11140 GUD_AREA_ SAVE_TAB Additional save for GUD blocks 18118 MM_NUM_GUD_MODULES Number of GUD files in the active file system...
Page 403
Work preparation 3.1 Flexible NC programming Resetting attribute values The attributes for access rights and initialization time change with REDEF can be reset to their default values by reprogramming REDEF, followed by the name of the variable or the NC language command: ●...
Page 404
Work preparation 3.1 Flexible NC programming Lower/upper limit <limit values>: LLI <limit value>: Lower limit value (lower limit) ULI <limit value>: Upper limit value (upper limit) See "Attribute: Limit values (LLI, ULI) (Page 408)". Note Cannot be redefined for: ● System variables ●...
Work preparation 3.1 Flexible NC programming 3.1.1.7 Attribute: Initialization value Definition (DEF) of user variables During definition, an initialization value can be preassigned for the following user variables: ● Global user variables (GUD) ● Program-global user variables (PUD) ● Local user variables (LUD) Redefinition (REDEF) of system and user variables During redefinition, an initialization value can be preassigned for the following variables: ●...
Work preparation 3.1 Flexible NC programming Initialization value: CHAR data type For variables of the CHAR data type, instead of the ASCII code (0...255), the corresponding ASCII character can be programmed in quotation marks, e.g. "A". Initialization value: Data type STRING In the case of variables of the STRING data type, the character string must be enclosed in quotation marks, e.g.
Page 409
Work preparation 3.1 Flexible NC programming Definition (DEF) of user variables: Limit values and implicit initialization values If no explicit initialization value is defined when defining a user variable of one of the above data types, the variable is set to the data type's implicit initialization value. ●...
Work preparation 3.1 Flexible NC programming See also Variables (Page 389) 3.1.1.9 Attribute: Physical unit (PHU) A physical unit can only be specified for variables of the following data types: ● INT ● REAL Programmable physical units (PHU) The physical unit is specified as fixed point number: PHU <unit> The following physical units can be programmed: <unit>...
Work preparation 3.1 Flexible NC programming Note Compatibility of units When using variables (assignment, comparison, calculation, etc.) the compatibility of the units involved is not checked. Should conversion be required, this is the sole responsibility of the user / machine manufacturer. See also Variables (Page 389) 3.1.1.10...
Page 413
Work preparation 3.1 Flexible NC programming Redefinition (REDEF) of system and user data Access rights (APR.../APW...) can be redefined for the following data: ● System data – Machine data Note Redefinition of reading rights of machine data The protection level for reading machine data can only be set with keyword APR for the part program and OPI.
Page 414
Work preparation 3.1 Flexible NC programming ● DO operation with synchronized actions ● Cycles program identifier The cycle must be saved in a cycle directory and must contain a PROC operation. Access rights in relation to NC programs and cycles (APRP, APWP) The various access rights facilitate the following with regard to access from an NC program or cycle: ●...
Page 415
Work preparation 3.1 Flexible NC programming Access rights in relation to OPI (APRB, APWB) The access rights (APRB, APWB) restrict access to system and user variables via the OPI equally for all system components (HMI, PLC, external computers, EPS services, etc.). Note Local HMI access rights When changing access rights to system data, care must be taken to ensure that such changes...
Work preparation 3.1 Flexible NC programming 3. For access to protected elements from cycles, the execution and write rights for cycle directories _N_CST_DIR, _N_CMA_DIR, and _N_CST_DIR have to be modified. Execution rights – MD11160 $MN_ACCESS_EXEC_CST = <protection level> – MD11161 $MN_ACCESS_EXEC_CMA = <protection level> –...
Work preparation 3.1 Flexible NC programming Data type Init. value Limit values Physical unit Access rights Data class (only 828D) Sag compensation (CEC) REDEF Quadrant error compensation (QEC) REDEF Magazine data REDEF Tool data REDEF Protection areas REDEF Toolholder, with orientation capability REDEF Kinematic chains REDEF...
Page 418
Work preparation 3.1 Flexible NC programming Assignment of values to array elements Values can be assigned to array elements at the following points in time: ● During array definition (initialization values) ● During program execution Values can be assigned by means of: ●...
Page 419
Work preparation 3.1 Flexible NC programming Syntax (DEF...=REP...) Using a value with repetition ● During definition: DEF <data type> <variable name>[<n>,<m>,<o>]=REP(<value>) DEF <data type> <variable name>[<n>,<m>,<o>]=REP(<value>, <number_array_elements>) ● During value assignment: <variable name>[<n>,<m>,<o>]=REP(<value>) DEF <data type> <variable name>[<n>,<m>,<o>]=REP(<value>,<number_array_elements>) Meaning Command to define variables DEF: Data type of variables <data type>:...
Page 420
Work preparation 3.1 Flexible NC programming Value, which the array elements should be written when in‐ <value>: itializing with REP. Number of array elements to be written with the <number_array_elements>: specified <value>. The following apply to the remaining ar‐ ray elements, dependent on the point in time: ●...
Page 421
Work preparation 3.1 Flexible NC programming FELD[n,m,o] = 1 ENDFOR ENDFOR ENDFOR Example: Initializing complete variable arrays For the actual assignment, refer to the diagram. Program code N10 DEF REAL FELD1[10,3]=SET(0,0,0,10,11,12,20,20,20,30,30,30,40,40,40,) N20 ARRAY1[0,0] = REP(100) N30 ARRAY1[5,0] = REP(-100) N40 FELD1[0,0]=SET(0,1,2,-10,-11,-12,-20,-20,-20,-30, , , ,-40,-40,-50,-60,-70) N50 FELD1[8,1]=SET(8.1,8.2,9.0,9.1,9.2) See also Definition and initialization of array variables (DEF, SET, REP) (Page 417)
Page 422
Work preparation 3.1 Flexible NC programming Additional information (SET) initialization for the definition ● Starting with the 1st array element, as many array elements are assigned with the values from the value list as there are elements programmed in the value list. ●...
Work preparation 3.1 Flexible NC programming Value assignment in program execution In the case of value assignment in program execution, the rules described above for the definition apply. The following options are also supported: ● Expressions are also permitted as elements in the value list. ●...
Work preparation 3.1 Flexible NC programming from ↓/ to → REAL BOOL BOOL x : Possible without restrictions o: Data loss possible due to the range of values being overshot ⇒ alarm; rounding: decimal place value ≥ 0.5 ⇒ round up, decimal place value < 0.5 ⇒ round down &: value ≠...
Work preparation 3.1 Flexible NC programming Note MINVAL, MAXVAL, and BOUND can also be programmed in synchronized actions. Note Behavior if values are equal If the values are equal, MINVAL/MAXVAL are set to this equal value. In the case of BOUND the value of the variable to be tested is returned again.
Page 426
Work preparation 3.1 Flexible NC programming Meaning Return value <result>: Data type: BOOL Range of values: Variable available Variable unknown Checks whether the specified system/user variable is known in the NC. ISVAR: Name of the system/user variable <Variable>: Data type: STRING <n>: Array index of the first dimension (optional)
Work preparation 3.1 Flexible NC programming Program code Comment DEF BOOL IS_VAR=FALSE N100 IS_VAR=ISVAR("$MC_GCODE_RESET_VALUES[1]" ; Transfer parameter is a machine data item, IS_VAR is TRUE. Program code Comment DEF BOOL IS_VAR=FALSE N10 IS_VAR=ISVAR("$P_EP") ; IS_VAR is in this case TRUE. N20 IS_VAR=ISVAR("$P_EP[X]") ;...
Page 428
Work preparation 3.1 Flexible NC programming Note GETVARPHU can be used, for example, to check whether both variables have the expected physical units in a variable assignment a = b. Read access right Syntax: <Result>=GETVARAP(<name>,<access>) Meaning: Protection level for the specified <access> <result>: Data type: Range of val‐...
Page 429
Work preparation 3.1 Flexible NC programming Note GETVARAP can be used, for example, to implement a checking program that checks the access rights expected by the application. Read limit values Syntax: <Status>=GETVARLIM(<name>,<limit value>,<result>) Meaning: Function status <Status>: Data type: Range of val‐ ues: No limit value defined (for variables of type AXIS, STRING, FRAME)
Page 430
Work preparation 3.1 Flexible NC programming Meaning: Size of the dimension specified by the parameter <Index> <result>: Data type: Reading the size of the first, second or third dimension of the field of a system/user GETVARDIM: variable Name of the system/user variables <name>: Data type: STRING...
Page 431
Work preparation 3.1 Flexible NC programming Name of the system/user variables <name>: Data type: STRING Return of the default value <result>: Data type: VAR REAL (when reading the default value of variables of the types INT, RE‐ AL, BOOL, AXIS) VAR STRING (when reading the default value of variables of the types STRING and CHAR)
Work preparation 3.1 Flexible NC programming Meaning: Data type of the specified system/user variables <result>: Data type: Range of val‐ = BOOL ues: = CHAR = INT = REAL = STRING = AXIS = FRAME In case of fault < 0 The specified variable name has not been assigned to a sys‐...
Work preparation 3.1 Flexible NC programming Explanation At type conversion from REAL to INT, fractional values that are >=0.5 are rounded up, others are rounded down (cf. ROUND function). Value <> 0 is equivalent to TRUE; value == 0 is equivalent to FALSE If the value is in the permissible range If only 1 character String length 0 = >FALSE, otherwise TRUE...
Page 434
Work preparation 3.1 Flexible NC programming Examples Example 1: Indirectly programming a spindle number Direct programming: Program code Comment S1=300 ; Speed 300 rpm for the spindle number 1. Indirect programming: Program code Comment DEF INT SPINU=1 ; Defining variables, type INT and value assignment. S[SPINU]=300 ;...
Work preparation 3.1 Flexible NC programming Indirect programming: Program code Comment DEF AXIS AXVAR1 AXVAR2 ; Defining two type AXIS variables. AXVAR1=(X1) AXVAR2=(X2) ; Assigning the axis names. AX[AXVAR1]=100 AX[AXVAR2]=200 ; Traversing the axes whose address names are saved in the variables with the names AXVAR1 and AXVAR2 Example 5: Indirectly programming an axis Direct programming:...
Work preparation 3.1 Flexible NC programming Syntax G[<group>]=<number> Meaning G command with extension (index) G[...]: Index parameter: G group <group>: Type: Variable for the G command number <number>: Type: INT or REAL Note Generally, only G commands that do not determine the syntax can be indirectly programmed. Only G group 1 is possible from the G commands that determine the syntax.
Page 437
Work preparation 3.1 Flexible NC programming Application Indirectly programming position attributes is used in replacement cycles, as in this case, the following advantage exists over programming position attributes as keyword (e.g. IC, AC, ...): As a result of the indirect programming as variable, no CASE statement is required, which would otherwise branch over all possible position attributes.
Page 438
Work preparation 3.1 Flexible NC programming Value Meaning Permissible for: POS, POSA CACP POS, POSA CACN POS, POSA Example For an active synchronous spindle coupling between the leading spindle S1 and the following spindle S2, the following replacement cycle to position the spindle is called using the SPOS command in the main program.
Work preparation 3.1 Flexible NC programming Supplementary conditions The indirect programming of position attributes is not possible in synchronized actions. 3.1.2.4 Indirectly programming part program lines (EXECSTRING) Using the part program command EXECSTRING, it is possible to execute a previously generated string variable as part program line.
Work preparation 3.1 Flexible NC programming 3.1.3 Instructions 3.1.3.1 Arithmetic functions Operator / arithmetic function Meaning Addition Subtraction Multiplication Division Integer number division Modulo division (supplies the remainder of the integer number divi‐ sion) Chain operator for FRAME variables Sine SIN() Cosine COS()
Page 441
Work preparation 3.1 Flexible NC programming Programming The usual mathematical notation is used for arithmetic functions. Priorities for execution are indicated by parentheses. Angles are specified for trigonometry functions and their inverse functions (right angle = 90°). Examples Division: / (type REAL) = type INT or type REAL) / (type INT or type REAL);...
Work preparation 3.1 Flexible NC programming Programming examples Program code Comment R1=R1+1 ; New R1 = old R1 + 1 R1=R2+R3 R4=R5-R6 R7=R8*R9 R10=R11/R12 R13=SIN(25.3) R14=R1*R2+R3 ; Multiplication or division takes precedence over addition or subtraction. R14=(R1+R2)*R3 ; Expressions and parentheses are calculated first.
Page 443
Work preparation 3.1 Flexible NC programming Logic operator Meaning Negation Exclusive OR Bit-by-bit logic operator Meaning Bit-by-bit AND B_AND Bit-by-bit OR B_OR Bit-by-bit negation B_NOT Bit-by-bit exclusive OR B_XOR Note In arithmetic expressions, the execution order of all the operators can be specified by parentheses, in order to override the normal priority rules.
Work preparation 3.1 Flexible NC programming 3.1.3.3 Priority of the operations Each operator is assigned a priority. When an expression is evaluated, the operators with the highest priority are always applied first. Where operators have the same priority, the evaluation is from left to right.
Page 445
Work preparation 3.1 Flexible NC programming Syntax Precision correction on comparison errors TRUNC (R1*1000) Meaning Truncate decimal places TRUNC: Relative quality of 10 taken into account for ● Equality: (==) ● Inequality: (<>) ● Greater than or equal to: (>=) ●...
Work preparation 3.1 Flexible NC programming Program code Comments R11=TRUNC(R1*1000) R12=TRUNC(R2*1000) ; Accuracy correction R13=TRUNC(R3*1000) IF ABS(R12-R11) > R13 GOTOF ERROR ; Jump is no longer executed ; End of program ERROR: SETAL(66000) Example 2: Calculate and evaluate the quotient of both operands Program code Comments R1=61.01 R2=61.02 R3=0.01...
Work preparation 3.1 Flexible NC programming Example 2: ROUNDUP in the NC program Program code N10 X=ROUNDUP(3.5) Y=ROUNDUP(R2+2) N15 R2=ROUNDUP($AA_IM[Y]) N20 WHEN X=100 DO Y=ROUNDUP($AA_IM[X]) 3.1.4 String operations Sting operations In addition to the classic operations "assign" and "comparison" the following string operations are possible: ●...
Work preparation 3.1 Flexible NC programming 3.1.4.1 Type conversion to STRING (AXSTRING) The function "type conversion to STRING" allows variables of different types to be used as a component of a message (MSG). When using the << operator this is realized implicitly for data types INT, REAL, CHAR and BOOL (see "...
Work preparation 3.1 Flexible NC programming Variable for the result of the type conversion with NUMBER <REAL_RES>: Type: REAL The ISNUMBER command checks whether the <string> can be converted into a ISNUMBER: valid number. Variable for the result of the interrogation with ISNUMBER <BOOL_RES>: Type: BOOL...
Work preparation 3.1 Flexible NC programming Meaning Variable, type CHAR, BOOL, INT, REAL or STRING <any_type>: << : Operator to chain variables (<any_type>) to configure a character string (type STRING). This operator is also available alone as a so-called "unary" variant. This can be used for explicit type converter to STRING (not for FRAME and AXIS): <<...
Work preparation 3.1 Flexible NC programming <STRING_RES>=TOLOWER("<string>") Meaning Using the TOUPPER command, all of the letters in a character string are con‐ TOUPPER: verted into uppercase letters. Using the TOLOWER command, all of the letters in a character string are con‐ TOLOWER: verted into lowercase letters.
Work preparation 3.1 Flexible NC programming Example In conjunction with the single character access, this function allows the end of a character string to be determined: Program code IF (STRLEN(BLOCK_NAME)>10) GOTOF ERROR 3.1.4.6 Search for character/string in the string (INDEX, RINDEX, MINDEX, MATCH) This functionality searches for single characters or a string within a string.
Work preparation 3.1 Flexible NC programming Program code Comment LISTIDX = MINDEX (INPUT, "M,N,O,P") ; The value returned in LISTIDX is 3; because "N" is the first character in the parameter IN- PUT from the selection list starting from the beginning.
Work preparation 3.1 Flexible NC programming 3.1.4.8 Reading and writing of individual characters Individual characters can be read and written within a string. The following supplementary conditions must be observed: ● Only possible with user-defined variables, not with system variables ●...
Work preparation 3.1 Flexible NC programming Program code Comment EXTERN UP_VAL(ACHSE) ; Definition of subprogram with "call by value" parameters EXTERN UP_REF(VAR ACHSE) ; Definition of subprogram with "call by reference" parameters UP_VAL(STRG[6]) ; Parameter transfer "by value" CHR = STRG[6] ;...
Page 456
Work preparation 3.1 Flexible NC programming Format descriptions available Conversion into the "TRUE" string, if the value to be converted: ● Is not equal to 0. ● Is not an empty string (for string values). Conversion into the "FALSE" string, if the value to be converted: ●...
Page 457
Work preparation 3.1 Flexible NC programming Conversion into a string with a decimal number with 6 decimal places and a total %<m>F: length of at least <m> characters. Where relevant, the decimal places are rounded-off or filled with 0. Missing characters are filled up to the total length <m> using spaces, left-justified.
Page 458
Work preparation 3.1 Flexible NC programming Conversion into a string with a decimal number in the exponential representation. The %.<n>E: mantissa is saved, normalized with one pre-decimal place and <n> decimal places. Where relevant, the decimal places are rounded-off or filled with 0. The exponent starts with the keyword "EX".
Page 459
Work preparation 3.1 Flexible NC programming Conversion into a string with a decimal number – depending on the value range – in %<m>G: a decimal or exponential notation (like %G). The string has a total length of at least <m> characters. The missing characters are filled with spaces, left-justified. Example with decimal notation: N10 DEF REAL REAL_VAR=1.234567890123456EX-04 N20 DEF STRING[80] RESULT...
Page 460
Work preparation 3.1 Flexible NC programming Converting a REAL value into an INTEGER value taking into account <n> decimal %.<n>P: places. The INTEGER value is output as a 32-bit binary number. If the value to be converted cannot be represented with 32 bits, then processing is interrupted with an alarm.
Page 461
Work preparation 3.1 Flexible NC programming Conversion of a REAL value corresponding to the setting in machine data %<m>.<n>P: MD10751 $MN_SPRINT_FORMAT_P_DECIMAL into a string with: ● An integer of <m> + <n> places or ● A decimal number with a maximum of <m> pre-decimal places and precisely <n> decimal places.
Page 462
Work preparation 3.1 Flexible NC programming Inserting <n> characters of a string (starting with the first character). %.<n>S: Example: N10 DEF STRING[16] STRING_VAR="ABCDEFG" N20 DEF STRING[80] RESULT N30 RESULT=SPRINT("CONTENT OF STRING_VAR:%.3S",STRING_VAR) Result: The character string "CONTENT OF STRING_VAR:ABC" is written to the string variable RESULT.
Work preparation 3.1 Flexible NC programming Note The table indicates that the NC data types AXIS and FRAME cannot be directly used in the SPRINT function. However it is possible: ● To convert the AXIS data type into a string using the AXSTRING function – which can then be processed with SPRINT.
Work preparation 3.1 Flexible NC programming Example Program code Comment N10 ... ; Start of the program. N90 GOTOS ; Jump to beginning of the program. 3.1.5.2 Program jumps to jump markers (GOTOB, GOTOF, GOTO, GOTOC) Jump labels can be set in a program, which can be jumped to from another location within the same program using the commands GOTOF, GOTOB, GOTO, or GOTOC.
Page 465
Work preparation 3.1 Flexible NC programming Jump destination parameter <jump destination>: Possible data include: <jump label>: Jump destination is the jump label set in the program with a user-defined name:<jump label>: <block number>: Jump destination is main block or sub-block number (e.g.: 200, N300) STRING type variable: Variable jump destination.
Page 466
Work preparation 3.1 Flexible NC programming Program code Comment N20 GOTOF Label_1 ; Jump toward end of program to ; jump label "Label_1". N30 … N40 Label_0: R1=R2+R3 ; Jump label "Label_0" set. N50 … N60 Label_1: ; Jump label "Label_1" set. N70 …...
Work preparation 3.1 Flexible NC programming A branch is made to this jump target if the value of the variable or arithmetic <jump target_1>: function corresponds to the first specific constant. The jump target can be specified as follows: <jump marker>: Jump target is the jump marker (label) set in the program with a user-defined name: <jump marker>:...
Page 469
Work preparation 3.1 Flexible NC programming The program lines or program sections to be repeated are identified by jump markers (labels). Note Jump markers (labels) Jump markers are always located at the beginning of a block. If a program number exists, the jump marker is located immediately after the block number.
Page 470
Work preparation 3.1 Flexible NC programming Note It is not possible to nest the REPEAT statement with the two jump markers in parentheses. If the <start jump marker> appears before the REPEAT statement and the <end jump marker> is not reached before the REPEAT statement, the section between the <start jump marker>...
Page 471
Work preparation 3.1 Flexible NC programming Address for specifying the number of repetitions Number of program section repetitions <n>: Type: The program section to be repeated is repeated <n> times. After the last repetition, the program is resumed at the line following the REPEAT/REPEATB line.
Page 472
Work preparation 3.1 Flexible NC programming Program code Comment N60 Y=-R10 N70 END: Z=10 N80 Z10 N90 CYCLE(10,20,30) N100 REPEAT BEGIN END P=3 ; Execute section from N10 to N70 three times. N110 Z10 N120 M30 Example 4: Repeat section between jump marker and ENDLABEL Program code Comment N10 G1 F300 Z-10...
Page 473
Work preparation 3.1 Flexible NC programming Program code Comment N120 ENDLABEL: N130 DRILL() ; Change drill and drilling cycle. N140 THREAD(6) ; Load tap M6 and threading cycle. N150 REPEAT POS_1 ; Repeat program section once from POS_1 up to ENDLABEL. N160 DRILL() ;...
Page 475
Work preparation 3.1 Flexible NC programming Nesting depth A nesting depth of up to 16 check structures can be set up on each subprogram level. Main program Subprogram PROC SUBPROG LOOP REPEAT WHILE WHILE ENDIF ENDWHILE WHILE WHILE ENDWHILE SUBPROG ENDFOR ENDFOR ENDWHILE...
Work preparation 3.1 Flexible NC programming Supplementary conditions ● Blocks with check structure elements cannot be suppressed. ● Jumper markers (labels) are not permitted in blocks with check structure elements. ● Check structures are processed interpretively. When a loop end is detected, a search is made for the loop beginning, allowing for the check structures found in the process.
Work preparation 3.1 Flexible NC programming Meaning Introduces the conditional statement or branch. Introduces the alternative program block. ELSE: Marks the end of the conditional statement or branch. ENDIF: Logical expression that is evaluated as TRUE or FALSE. <condition>: Example: Tool change subprogram Program code Comment PROC L6...
Work preparation 3.1 Flexible NC programming Meaning Initiates the endless loop. LOOP: Marks the end of the loop and results in a return jump to the beginning of the loop. ENDLOOP: Example Program code LOOP MSG ("no tool cutting edge active") STOPRE ENDLOOP 3.1.7.3...
Work preparation 3.1 Flexible NC programming Examples Example 1: INTEGER variable or R parameter as count variable INTEGER variable as count variable: Program code Comment DEF INT iVARIABLE1 R10=R12-R20*R1 R11=6 FOR iVARIABLE1 = R10 TO R11 ; Count variable = INTEGER variable R20=R21*R22+R33 ENDFOR R parameter as count variable:...
Work preparation 3.1 Flexible NC programming Meaning Initiates the program loop. WHILE: Marks the end of the loop and results in a return jump to the beginning of the loop. ENDWHILE: The condition must be fulfilled so that the WHILE loop is executed. <condition>: Example Program code...
Work preparation 3.1 Flexible NC programming 3.1.7.6 Program example with nested check structures Program code Comment LOOP IF NOT $P_SEARCH ; IF no block search G1 G90 X0 Z10 F1000 WHILE $AA_IM[X] <= 100 ; WHILE (setpoint X axis <= 100) G1 G91 X10 F500 ;...
Page 482
Work preparation 3.1 Flexible NC programming Note Minimum distance between commands At least two traversing block distances must be maintained between the commands INIT, START, WAITE, WAITM, SETM, CLEARM and the command WAITMC. WAITMC is an executable block, but is moved into the previous block for optimization, and then deleted as a block. SETM for example is not an executable block, and is moved into the next block so that if there were a distance of one block between two commands, both commands would be in the middle block.
Page 483
Work preparation 3.1 Flexible NC programming Channel number <ChanNo>: The number of the own channel does not have to be specified. Type: Absolute or relative path specification (optional) + program name <Prog>: Type: STRING Information relating to path data, see the Programming Manual NC Programming, Chapter "Addressing program memory files"...
Page 484
Work preparation 3.1 Flexible NC programming Program code Comment START(LOADER) ; Start of channel 2 START using local "channel names", user variables and parameterized channel names Program code Comment DEF INT chanNo1 ; Definition of user variable for channel 1 DEF INT chanNo2 ;...
Page 485
Work preparation 3.1 Flexible NC programming Program coordination with WAITM ● Channel 1: The program /_N_MPF_DIR/_N_MPF100_MPF has already been selected and started. Program code Comment ; Program MPF100 N10 INIT(2,"MPF200","N") ; Selection of program MPF200, channel 2 N11 START(2) ; Start of channel 2 N80 WAITM(1,1,2) ;...
Page 486
Work preparation 3.1 Flexible NC programming Boundary conditions Non-synchronous start of execution of following blocks after WAIT markers In the case of channel coordination using WAIT markers, execution of the following blocks may start non-synchronously. This behavior occurs if an action is triggered in one of the channels to be synchronized immediately before reaching the common WAIT marker;...
Work preparation 3.1 Flexible NC programming 3.1.9 Macro technique (DEFINE ... AS) NOTICE Macro technology increases the complexity of the programming Macros can significantly alter the control's programming language. Macro technology may only be used with great care. A macro is a sequence of individual statements which have together been assigned a name of their own.
Page 488
Work preparation 3.1 Flexible NC programming Macros must be defined before they can be used. The following rules must be observed in this context: ● Any identifier, G, M, H functions and L subprogram names can be defined in a macro. ●...
Page 489
Work preparation 3.1 Flexible NC programming Example 2: Macro definitions in a macro file Program code Comment DEFINE M6 AS L6 ; A subprogram is called at tool change to handle the necessary data transfer. The actual tool change M function is output in the subprogram (e.g. M106). DEFINE G81 AS DRILL(81) ;...
Work preparation 3.2 Subprogram technique Subprogram technique 3.2.1 General information 3.2.1.1 Subprogram The term "subprogram" has its origins during the time when part programs were split strictly into main and subprograms. Main programs were the part programs selected for processing on the control and then launched.
Work preparation 3.2 Subprogram technique 3.2.1.2 Subprogram names Naming rules The subprogram name can be chosen freely providing the following rules are observed: ● Permissible characters: – Letters: A ... Z, a ... z – Numbers: 0 ... 9 – Underscore: _ ●...
Work preparation 3.2 Subprogram technique The subprogram with the program name SUB_PROG can be started using the following identifiers: 1. SUB_PROG 2. _N_SUB_PROG 3. SUB_PROG_SPF 4. _N_SUB_PROG_SPF Main programs and subprograms with the same name If a main program (.MPF) and a subprogram (.SPF) exist with the same program name, the appropriate file extension for the unique identification must be specified when the program name in the NC program is used.
(14 to 17) will be available to it. Siemens cycles Siemens cycles need 3 program levels. Therefore, a Siemens cycle must be called at the latest ● Part program processing: program level 12 ● interrupt routine: program level 14 3.2.1.4...
Work preparation 3.2 Subprogram technique Actual parameters When a subprogram is called, absolute values or variables (known as actual parameters) have to be transferred to it. As such, the actual parameters assign up-to-date values to the interface of the subprogram when the latter is called.
Page 495
Work preparation 3.2 Subprogram technique Program code Comment N30 SUB_PROG(1.0,2.0,3.0) ; Subprogram call with complete parameter transfer: X=1.0, Y=2.0, Z=3.0 … N100 M30 Examples for the subprogram call in N30 with incomplete parameter transfer: N30 SUB_PROG( ,2.0,3.0) ; X=0.0, Y=2.0, Z=3.0 N30 SUB_PROG(1.0, ,3.0) ;...
Work preparation 3.2 Subprogram technique 3.2.2 Definition of a subprogram 3.2.2.1 Subprogram without parameter transfer When defining subprograms without parameter transfer, the definition line at the beginning of the program can be omitted. Syntax [PROC <program name>] Meaning Definition operation at the beginning of a program PROC: Name of the program <program name>:...
Page 497
Work preparation 3.2 Subprogram technique Call-by-value The calling program transfers only the value of a variable to the subprogram on a call-by-value parameter transfer. Thus the subprogram is not given direct access to the variable. In this way, only the value visible in the subprogram is modified when the parameter value is changed. The value of the variables defined in the calling program remains unchanged.
Work preparation 3.2 Subprogram technique Examples Example 1 Definition of a subprogram SUB_PROG with three parameters of type REAL with default values: Program code PROC SUB_PROG(REAL LENGTH=10.0, REAL WIDTH=20.0, REAL HIGHT=30.0) Example 2 Various call versions Program code PROC MAIN_PROG REAL PAR_1 = 100 REAL PAR_2 = 200 REAL PAR_3 = 300...
Page 499
Work preparation 3.2 Subprogram technique Main program Value assignment LENGTH=20 Subprogram WIDTH=10 LENGTH, WIDTH New value assignment LENGTH=20 WIDTH=15 New values valid LENGTH, WIDTH New values valid Note The call-by-reference parameter transfer is then only necessary if the transferred variable was defined locally in the calling program (LUD).
Work preparation 3.2 Subprogram technique Array size [<m>,<n>,<o>]: Currently, up to 3-dimensional arrays are possible: Array size for 1st dimension <m>: Array size for 2nd dimension <n>: Array size for 3rd dimension <o>: Note ● The program name specified after the PROC keyword must match the program name assigned on the user interface.
Work preparation 3.2 Subprogram technique Meaning Saves the modal G commands before the subprogram call and restores after the end of SAVE: the subprogram. Example In the CONTOUR subroutine, the modal G command G91 applies (incremental dimension). The modal G command G90 is effective in the main program (absolute dimension). G90 is again effective in the main program after the end of the subprogram as a result of the subprogram definition with SAVE.
Page 502
Work preparation 3.2 Subprogram technique canceled. With the programmed return command, the decision is made whether to stop at the end of the subprogram: ● Return with M17: Stop at the end of the subprogram ● Return with RET: No stop at end of subprogram Suppressing single block machining within the NC program If the deactivation of single block machining (SBLOF) is programmed in a block within an NC program, then single block machining is deactivated from this block onward up to the next...
Page 503
Work preparation 3.2 Subprogram technique Special aspects ● Block display with suppressed single block machining The current block display can be suppressed in subprograms using DISPLOF. If DISPLOF is programmed together with SBLOF, for single block stops within the subprogram, the subprogram call is displayed.
Page 504
Work preparation 3.2 Subprogram technique Example 2: A cycle is to act like a command for a user Initial situation: Single block machining is active. Main program: Program code N100 G1 X10 G90 F200 N120 X-4 Y6 N130 CYCLE1 N140 G1 X0 N150 M30 Cycle CYCLE1: Program code...
Page 505
Work preparation 3.2 Subprogram technique Program code Comment N200 END: D=$P_TOOL T=$P_TOOLNO N210 RET Example 4: Specific stopping in the subprogram Initial situation: ● Single block machining is active. ● MD10702 $MN_IGNORE_SINGLEBLOCK_MASK, Bit12 = 1 Main program: Program code Comment N10 G0 X0 ;...
Work preparation 3.2 Subprogram technique Program code Comment N230 UP3(0) PROC UP3(INT _NR) N300 SBLOF ; Switch off single block machining N305 X30 N310 SBLON ; Activate single block machining N320 X32 ; single block stop N330 SBLOF ; Switch off single block machining N340 X34 N350 M17 ;...
Page 507
Work preparation 3.2 Subprogram technique Command for revoking suppression of the display of the current block DISPLON: Location: At the end of the program line with the PROC operation Effective: Up to the return jump from the subprogram or end of program. Note: If further subprograms are called from the subprogram using the DISPLON com‐...
Page 508
Work preparation 3.2 Subprogram technique Program code Comment N6040 R10 = 66 X100 ; Trigger alarm 12080 N7000 M17 Main program: Program code Comment N1000 G0 X0 Y0 Z0 N1010 ... N2050 SUBPROG1 ; Alarm output = "12080 channel K1 block N9040 syntax error for text R10="...
Work preparation 3.2 Subprogram technique Example 4: Display response for different DISPLON/DISPLOF combinations ① The part program lines from program level 0 are displayed in the current block display. ② The part program lines from program level 3 are displayed in the current block display. ③...
Work preparation 3.2 Subprogram technique Read subprogram with preparation and subprogram call The cycle directories are processed in the same order both for subprograms preprocessed with parameters during power up and during subprogram call. 1. _N_CUS_DIR user cycles 2. _N_CMA_DIR manufacturer cycles 3.
Work preparation 3.2 Subprogram technique 2. Subprogram with M17 in the last traversing block Program code Comment N10 G64 F2000 G91 X10 Y10 N20 X10 Z10 M17 ; Return jump without interruption of continuous- path mode. 3.2.2.9 RET subprogram return The RET command can also be used in the subprogram as a substitute for the M17 return jump command.
Work preparation 3.2 Subprogram technique Subprogram: Program code Comment PROC SUB_PROG N100 RET ; Return jump to block N60 in the main program. 3.2.2.10 Parameterizable subprogram return jump (RET ...) Generally, a return jump is made from a subprogram into the calling program using the RET command.
Page 513
Work preparation 3.2 Subprogram technique Meaning End of subprogram RET: Declares as jump target the block where program execution <target block>: should be resumed. If parameter <number of return jump levels> is not programmed, then the jump target is in the program from which the current sub‐ program was called.
Page 514
Work preparation 3.2 Subprogram technique The parameter specifies the number of program levels that should <number of be jumped through (return jumps) to search there for the target return jump levels>: block and continue processing the program. Type: Value: The program is resumed at the "current pro‐ gram level -1"...
Page 515
Work preparation 3.2 Subprogram technique Examples Example 1: Resuming in the main program after ASUB execution Programming Comment N10010 CALL "UP1" ; Program level 0 (main program) N11000 PROC UP1 ; Program level 1 N11010 CALL "UP2" N12000 PROC UP2 ;...
Page 516
Work preparation 3.2 Subprogram technique Program code Comment N2000 R10=R20+100 N2010 ... N2200 RET("subProg2") ; Return jump into the main program at block N1400 Subprogram subProg2: Program code Comment PROC subProg2 N2000 R10=R20+100 N2010 ... N2200 RET("iVar1") ; Return jump into the main program at block N1500 Subprogram subProg3: Program code...
Page 517
Work preparation 3.2 Subprogram technique 1. <target block> = "N200", <block after target block> = 0 After the RET command, program execution is continued with block N200 in the main program. 2. <target block> = "N200", <block after target block> = 1 After the RET command, program execution is continued with the block (N210) that follows block N200 in the main program.
Work preparation 3.2 Subprogram technique 3. <target block> = "N220", <number of return jump levels> = 2 After the RET command, two program levels are jumped through and program execution is continued with block N220. 3.2.2.11 Parameterizable subprogram return jump (RETB ...) Generally, a return jump is made from a subprogram into the calling program using the RETB command.
Page 519
Work preparation 3.2 Subprogram technique RETB("<target block>",<block after target block>,<number of return jump levels>, <return jump to the beginning of the program>) RETB( , ,<number of return jump levels>,<return jump to the beginning of the program>) Meaning End of subprogram RETB: Declares as jump target the block where program execution <target block>:...
Page 520
Work preparation 3.2 Subprogram technique The parameter specifies the number of program levels that should <number of be jumped through (return jumps) to search there for the target return jump levels>: block and continue processing the program. Type: Value: The program is resumed at the "current pro‐ gram level -1"...
Work preparation 3.2 Subprogram technique 3.2.3 Subprogram call 3.2.3.1 Subprogram call without parameter transfer A subprogram is called either with address L and subprogram number or by specifying the program name. A main program can also be called as a subprogram. The end of program M2 or M30 set in the main program is evaluated as M17 in this case (end of program with return to the calling program).
Page 523
Work preparation 3.2 Subprogram technique Examples Example 1: Subprogram call without parameter transfer Main program N10 L47 Subprogram Spigot_2 Example 2: Calling a main program as a subprogram Main program Additional main N10 MPF739 program N10WELLE3 N10... N50 M30 See also Subprogram without parameter transfer (Page 496) NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Work preparation 3.2 Subprogram technique 3.2.3.2 Subprogram call with parameter transfer (EXTERN) For a subprogram call with parameter transfer, variables or values can be transferred directly (but not VAR parameters). Subprograms with parameter transfer must be declared with EXTERNAL in the main program before they are called in the main program (e.g.
Page 525
Work preparation 3.2 Subprogram technique Examples Example 1: Subprogram call preceded by declaration Program code Comment N10 EXTERNAL BORDERS(REAL,REAL,REAL) ; Specify the subprogram. N40 BORDER(15.3,20.2,5) ; Call the subprogram with parameter transfer. Main program N10 EXTERNAL BORDER(REAL,REAL,REAL) N40 BORDER(15.3,20.2,5) Example 2: Subprogram call without declaration Program code Comment N10 DEF REAL LENGTH, WIDTH, DEPTH...
Work preparation 3.2 Subprogram technique Main program N30 LENGTH=15.3 WIDTH=20.2 DEPTH=5 N40 BORDER(LENGTH,WIDTH,DEPTH) N40 BORDER(15.3,20.2,5) See also Subprogram with call-by-value parameter transfer (PROC) (Page 496) Subprogram with call-by-reference parameter transfer (PROC, VAR) (Page 498) 3.2.3.3 Number of program repetitions (P) If a subprogram is to be executed several times in succession, the desired number of program repetitions can be entered at address P in the block with the subprogram call.
Work preparation 3.2 Subprogram technique Number of program repetitions <value>: Type: Range of values: 1 … 9999 (unsigned) Example Program code Comment N40 FRAME P3 ; The BORDER subprogram is to be executed three times one after the other. Main program Subprogram N40 FRAME P3 3.2.3.4...
Page 528
Work preparation 3.2 Subprogram technique Note The data definition area at the start of the subprogram is only executed once when executing the block with the programmed MCALL call. For the following subprogram calls, after the traversing blocks, the data definition area is no longer executed. This means that a value assigned in the definition of a local user variable (LUD) is no longer available after the first call, but the value that was last written in the cycle.
Work preparation 3.2 Subprogram technique manually via overstore. In this situation, the "Modal subprogram call" function must not be deselected because otherwise the search result is falsified. It is therefore recommended that the deselection of the "Modal subprogram call" function in the tool change cycle is programmed as follows: Program code Comment...
Work preparation 3.2 Subprogram technique Syntax CALL <program name> Meaning Command for the indirect subprogram call. CALL: Name of the subprogram (variable or constant) <program name>: Type: STRING Example Direct call with STRING constant: Program code Comment … CALL "/_N_WKS_DIR/_N_SUBPROG_WPD/_N_PART1_SPF" ;...
ISOCALL. The ISO mode set in the machine data is then activated. The original execution mode becomes effective again at the end of the program. If no ISO mode is set in the machine data, the subprogram is called in Siemens mode. NC programming...
Work preparation 3.2 Subprogram technique Meaning Keyword for subprogram call with absolute path name PCALL: Absolute path data including subprogram names. <path/program name>: Rules regarding path data, see "Addressing program memory files (Page 554)". If no absolute path name is specified, PCALL behaves like a standard subprogram call with a program identifier.
Work preparation 3.2 Subprogram technique Meaning Keyword for the programmable search path exten‐ CALLPATH: sion. Is programmed in a separate part program line. Constant or variable, STRING type. <path name>: Contains the absolute path name of the directory by which the search path should be extended. Rules regarding path data, see "Addressing pro‐...
Page 535
Work preparation 3.2 Subprogram technique The following are available as external memory: ● Local drive ● Network drive ● USB drive Note Only the USB interfaces on the operator panel front or the TCU can be used as an interface for processing an external program on a USB drive.
Page 536
Work preparation 3.2 Subprogram technique Meaning Command for calling an external subprogram. EXTCALL: Constant/variable of type STRING "<Path/><Program name>": Absolute or relative path specifica‐ <Path/>: tion (optional) The program name is specified with‐ <Program name>: out prefix "_N_". The file extensions ("MPF", "SPF") can be attached to program names using the "_"...
Page 537
Work preparation 3.2 Subprogram technique used for the path of subprogram "SP_1" and is also not rewritten in the main program. Therefore, the complete path has to be specified when subprogram "SP_2" is called. Main program "MAIN" Program code N010 PROC MAIN N020 ...
Page 538
Work preparation 3.2 Subprogram technique Note ShopMill/ShopTurn programs The contour descriptions added at the file end mean the ShopMill and ShopTurn programs must be stored completely in the read-only memory. A separate reload memory is required for external subprograms executed in parallel. Reset / end of program / POWER ON Reset and POWER ON cause external subprogram calls to be interrupted and the associated load memory to be deleted.
Work preparation 3.3 Interrupt routine (ASUB) Interrupt routine (ASUB) 3.3.1 Function of an interrupt routine Note The terms "asynchronous subprogram (ASUB)" and "interrupt routine" are used interchangeably in the description below to refer to the same functionality. A typical example should clarify the function of an interrupt routine: interrupt routine Retraction from the contour...
Work preparation 3.3 Interrupt routine (ASUB) 3.3.2 Creating an interrupt routine Create interrupt routine as subprogram The interrupt routine is identified as a subprogram in the definition. Example: Program code Comment PROC LIFT_Z ; Program name "ABHEB_Z" N10 ... ; The NC blocks then follow: N50 M17 ;...
Page 541
Work preparation 3.3 Interrupt routine (ASUB) An interrupt can be assigned a priority value from 1 ... 128. Priority value 1 corresponds to the highest priority and 128 the lowest. Syntax SETINT(<n>) <NAME> SETINT(<n>) PRIO=<value> <NAME> SETINT(<n>) PRIO=<value> <NAME> BLSYNC SETINT(<n>) PRIO=<value>...
Page 542
Work preparation 3.3 Interrupt routine (ASUB) Supplementary conditions Interrupt rules 1. For every interrupt that cannot be immediately executed, or is presently already being processed, an additional interrupt request is saved. All other interrupt requests for this interrupt are lost. 2.
Work preparation 3.3 Interrupt routine (ASUB) 3.3.4 Deactivating/reactivating the assignment of an interrupt routine (DISABLE, ENABLE) A SETINT statement can be deactivated with DISABLE and reactivated with ENABLE without losing the input → interrupt routine assignment. Syntax DISABLE(<n>) ENABLE(<n>) Meaning Command: Deactivating the interrupt routine assignment of input <n>...
Work preparation 3.3 Interrupt routine (ASUB) Meaning Command: Delete assignment of the interrupt signal <n> to the NC program CLRINT(<n>): (ASUP) defined with SETINT <n> Parameter: Number of the interrupt signal <n>: Type: Range of values: 1 ... 32 Example Program code Comment N20 SETINT(3) PRIO=2 ABHEB_Z...
Page 545
Work preparation 3.3 Interrupt routine (ASUB) Syntax SETINT(<n>) PRIO=1 LIFTFAST SETINT(<n>) PRIO=1 <NAME> LIFTFAST Meaning Command: Assign input <n> to an interrupt routine. The assigned interrupt routine SETINT(<n>): starts when input <n> switches. Parameter: Input number <n>: Type: Range of values: 1 ... 8 PRIO= : Defining the priority Priority value...
Work preparation 3.3 Interrupt routine (ASUB) Main program Comment N50 G41 G1 X16 Y16 F200 N60 Y35 N70 X53 Y65 N90 X71.5 Y16 N100 X16 N110 G40 G0 Z100 M30 Subprogram: Subprogram Comment PROC W_CHANGE SAVE ; Subprogram where the actual operat- ing state is saved N10 G0 Z100 M5 ;Tool changing position, spindle stop...
Page 547
Work preparation 3.3 Interrupt routine (ASUB) Example: Program code N10 SETINT(2) PRIO=1 ABHEB_Z LIFTFAST ALF=7 With G41 activated (machining direction to the left of the contour) the tool vertically moves away from the contour. ALF = 7 Reference plane for defining the traversing direction for LFTXT At the point of application of the tool to the programmed contour, the tool is clamped at a plane which is used as a reference for specifying the retraction movement with the corresponding code number.
Page 548
Work preparation 3.3 Interrupt routine (ASUB) Tangent Tangent Intervention point Tangent Tangent Intervention point Code numbers with traversing direction for LFTXT Starting from the reference plane, you will find the code numbers with traversing directions in the following diagram. View in the traversing direction 45¡˘...
Work preparation 3.3 Interrupt routine (ASUB) The "fast retraction" function is deactivated with ALF=0. CAUTION Risk of collision When the tool radius compensation is activated, then: ● For G41 codes 2, 3, 4 ● For G42 codes 6, 7, 8 should not be used, as in these cases, the tool would move to the contour and would collide with the workpiece.
Page 550
Work preparation 3.3 Interrupt routine (ASUB) The position on the contour is saved as interrupt position where the LIFTFAST motion is started and therefore the path was left. The interrupt routine with LIFTFAST and ALF=0 behaves in precisely the same way as the interrupt routine without LIFTFAST.
Work preparation 3.4 File and Program Management File and Program Management 3.4.1 Program memory 3.4.1.1 Program memory in the NCK Files and programs (e.g. main programs and subprograms, macro definitions) are saved in the non-volatile program memory (→ passive file system). A number of file types are also stored here temporarily;...
Page 552
Work preparation 3.4 File and Program Management Directory Content _N_CMA_DIR Manufacturer cycles _N_CUS_DIR User cycles _N_WKS_DIR Workpieces _N_SPF_DIR Global subprograms _N_MPF_DIR Main programs _N_COM_DIR Comments File types The following file types can be stored in the main memory: File type Description <name>_MPF Main program...
Work preparation 3.4 File and Program Management File Description _N_PART1_SPF Subprogram _N_PART2_SPF Subprogram _N_SHAFT_INI General initialization program for the data of the workpiece _N_SHAFT_SEA Setting data initialization program _N_PART2_INI General initialization program for the data for the Part 2 program _N_PART2_UFR Initialization program for the frame data for the Part 2 program _N_SHAFT_COM...
Work preparation 3.4 File and Program Management Program organization The program organization on external program memories is shown in the following diagram: Case-insensitive file systems Note To avoid problems with case-sensitivity for the file addressing (see "Addressing program memory files (Page 554)"), case-insensitive file systems should be used as external program memory.
Page 555
Work preparation 3.4 File and Program Management Addressing in the NC/EES notation Addressing files of the passive file system Files of the passive file system are generally addressed in the NC notation (directory and file names begin with the domain identifier "_N_", "_" is the separator for the file identifier) without specifying the drive name.
Page 556
Work preparation 3.4 File and Program Management Addressing files of an external program memory Files of an external program memory not recorded as GDIR must be addressed in EES notation. The drive name (e.g. "//DEV1:") must be specified at the start of the addressing path. All symbolic device names configured in /user/sinumerik/hmi/cfg/logdrive.ini are permissible.
Page 557
Work preparation 3.4 File and Program Management Examples: ● External program memory: – //Drive1: – //Drive_1: – //Drive 1: – //A B: – //1 B C 2: Directory path The following rules govern the specification of the directory path: ● A "/" is located at the start and end of the directory path and as separator for the individual path sections.
Page 558
Work preparation 3.4 File and Program Management Examples: ● Passive file system or GDIR: – NC notation: _N_WKS_DIR/_N_MYNCPROGS_WPD/... – EES notation: WKS.DIR/MYPROGS.WPD/... ● External program memory: – /abc – /ab_c.def – /ab c1.def – /a b c .d11 – /abc.def/ghi.klm File name The following rules apply to the file names: ●...
Work preparation 3.4 File and Program Management DIN subprogram name The following rules apply to DIN subprogram names: ● The first character must be the letter "L". ● The following characters are digits (at least one). ● File extension: – The file extension must consist of three letters. –...
Work preparation 3.4 File and Program Management Directory Description name_SPF /_N_CMA_DIR / Manufacturer cycle directory name_SPF /_N_CST_DIR / Standard cycle directory //DEV2:" For example represents the drive on which the global part program memory has been created. The following rules apply for the search: ●...
Work preparation 3.4 File and Program Management System variable Type Meaning $P_IS_EES_PATH[ <n>] BOOL Interrogates whether the path supplied by $P_PATH[<n>] or the program name supplied by $P_PROG[<n>] corresponds to the NC notation or the EES notation. = FALSE $P_PATH[<n>] and $P_PROG[<n>] supply a NC notation.
Page 562
Work preparation 3.4 File and Program Management Initialization programs These are programs with which the working memory data is initialized. The following file types can be used for this: File type Description name_TEA Machine data name_SEA Setting data name_TOA Tool offsets name_UFR Zero offsets/frames name_INI...
Page 564
Work preparation 3.4 File and Program Management Read-in initialization program NOTICE Data loss If the file is read-in with the name "INITIAL_INI", then all data that is not supplied in the file is initialized using standard data. Only machine data is an exception. This means that setting data, tool data, ZO, GUD values, ...
Work preparation 3.5 File handling File handling 3.5.1 Write file (WRITE) The WRITE command writes sets/data from the NC program at the end of a file (log file) in the passive file system or to external program memory. This can also be the program that is presently being executed.
Page 566
Work preparation 3.5 File handling Parameter 2: The name of the file in which the specified block or specified data is <file name>: to be added. Type: STRING The absolute path can be specified before the actual file name. If a path is not specified, the file is searched for in the current directory (= directory of selected program).
Page 567
Work preparation 3.5 File handling Program code Comment N40 MSG ("Error with WRITE command:" <<ERROR) N50 M0 N60 ENDIF Example 2: WRITE command into the passive file system with absolute path data Program code WRITE(ERROR,"/_N_WKS_DIR/_N_PROT_WPD/_N_PROT_MPF","LOG FROM 7.2.97") Example 3: Implicit/explicit "LF" a) Write to the passive file system with implicitly generated "LF"...
Work preparation 3.5 File handling c) Write to an external file with explicitly generated "LF" The following must be programmed in order to achieve the same result as under a: Program code N200 DEF STRING[30] DEV_1 N210 DEF INT ERROR N220 DEV_1="LOCAL_DRIVE/myprotfile.mpf"...
Work preparation 3.5 File handling Name of the file to be deleted <file name>: Type: STRING The absolute path can be specified before the actual file name. If a path is not specified, the file is searched for in the current directory (= directory of selected program).
Page 570
Work preparation 3.5 File handling Meaning Command for reading lines from the specified file and storing these lines in a READ: variable array. Variable for returning the error value (call-by-reference parameter) <error>: Type. Value: No error Path not allowed Path not found File not found Incorrect file type The file is in use...
Work preparation 3.5 File handling Note Binary files cannot be read in. The "incorrect data type" error is output (return value of the error variable = 4). The following types of file are not readable: _BIN, _EXE, _OBJ, _LIB, _BOT, _TRC, _ACC, _CYC, _NCK.
Work preparation 3.5 File handling Examples Example 1 Program code Comment N10 DEF BOOL RESULT ; Definition of result variables. N20 RESULT=ISFILE("TESTFILE") N30 IF(RESULT==FALSE) MSG("FILE DOES NOT EXIST") N60 ENDIF Example 2 Program code Comment N10 DEF BOOL RESULT ; Definition of result variables. N20 RESULT=ISFILE("TESTFILE") N30 IF(NOT ISFILE("TESTFILE")) MSG("FILE DOES NOT EXIST")
Page 573
Work preparation 3.5 File handling Returns a file with regard to the following rights for the status: FILESTAT: ● Read (r: read) ● Write (w: write) ● Execute (x: execute) ● Show (s: show) ● Delete (d: delete) Note: These protection levels are specific properties of the passive file system. When accessing an external program memory, FILESTAT therefore supplies default access rights (77777).
Page 574
Work preparation 3.5 File handling Example Program code Comment N10 DEF INT ERROR ; Definition of error varia- bles. N20 STRING[32] RESULT ; Definition of result varia- bles. N30 FILEINFO(ERROR,"/_N_MPF_DIR/_N_TESTFILE_MPF",RE- ; File name with domain, file SULT) ID and path data. N40 IF ERROR <>...
Work preparation 3.6 Protection zones Protection zones 3.6.1 Defining protection zones (CPROTDEF, NPROTDEF) Protection zones, which protect machine elements against collisions, are defined in the part program in blocks. These contain the following elements: 1. Definition of the machining plane Before the actual protection zone definition, the machining plane must be selected, to which the contour description of the protection zone refers.
Page 576
Work preparation 3.6 Protection zones Type of protection zone <t>: Data type: BOOL Value: Tool-related protection zone TRUE Workpiece-related protection zone FALSE Type of limitation in the third dimension <AppLim>: Data type: Value: No limitation Limit in plus direction Limit in minus direction Limit in positive and negative direction Value of the limit in the positive direction in the 3rd dimension <AppPlus>:...
Page 577
Work preparation 3.6 Protection zones Additional information Machine-specific protection zones A machine-specific protection zone or its contour is defined using the geometry axis, i.e. referenced to the basic coordinate system (BCS) of a channel. In order that correct protection- zone monitoring can take place in all channels in which the machine-specific protection zone is active, the basic coordinate system (BCS) of all of the channels involved must be identical: ●...
Work preparation 3.6 Protection zones General conditions During the definition of a protection zone, the following functions must not be active or used: ● Tool radius compensation (cutter radius compensation, tool nose radius compensation) ● Transformation ● Reference point approach (G74) ●...
Page 579
Work preparation 3.6 Protection zones Number of the protection zone <n>: Data type: The channel-specific activation status is set using this parameter <Status>: Data type: Value: Deactivate protection zone Preactivate protection zone Activate protection zone Preactivate protection zone with conditional stop Additive offset values in the X/Y/Z direction <XMov>,<YMov>,<ZMov>:...
Page 580
Work preparation 3.6 Protection zones ① Name for the protection zone of the probe Toolholder reference point Program code Comment DEF INT PROTZONE ; Definition of a Help variable ; machining plane XY ; defining protection zones: NPROTDEF(1,FALSE,3,10,–10) ; protection zone n–PZ1 G01 X0 Y–10 Y-10 EXECUTE(PROTZONE)
Page 581
Work preparation 3.6 Protection zones Program code Comment CPROTDEF(2,TRUE,3,–100,–150) ; protection zone c–PZ2 G01 X0 Y–10 G03 X0 Y10 J10 X0 Y–10 J–10 EXECUTE(PROTZONE) CPROTDEF(3,TRUE,3,–150,–170) ; protection zone c–PZ3 G01 X0 Y–27.5 G03 X0 Y27.5 J27.5 X0 Y27.5 J–27.5 EXECUTE(PROTZONE) ;...
Work preparation 3.6 Protection zones 3.6.3 Checking for protection zone violation, working area limitation and software limit switches (CALCPOSI) Function In the workpiece coordinate system (WCS), the CALCPOSI function checks whether, starting from the starting position, the geometry axes can be traversed a specified distance without violating active limits.
Page 583
Work preparation 3.6 Protection zones Function return value. Negative values indicate error states. <status>: (Part 1) Data type: Value range: -8 ≤ x ≤ 100000 Value: The distance can be traversed completely. At least one component is negative in <Limit>. Error in a transformation calculation.
Page 584
Work preparation 3.6 Protection zones Hundreds digit <status>: (Part 3) Value: AND units digit == 1 or 2: The positive limit value has been violated. AND units digit == 3 An NC-specific protection zone has been violated. AND units digit == 1 or 2: The negative limit value has been violated.
Page 585
Work preparation 3.6 Protection zones Reference to a vector. <Dist>: Input: Incremental traversing distance ● <Dist> [0]: 1st geometry axis ● <Dist> [1]: 2nd geometry axis ● <Dist> [2]: 3rd geometry axis Output (only for set hundred thousands digit in <Status>): <Dist>...
Page 586
Work preparation 3.6 Protection zones Reference to a vector with the incremental traversing distance in which the speci‐ <MaxDist>: fied minimum clearance of an axis limit is not violated by any of the relevant ma‐ chine axes: ● <Dist> [0]: 1st geometry axis ●...
Page 587
Work preparation 3.6 Protection zones Example Limitations In the example, the active software limit switches and working area limits in the X-Y plane and the following three protection zones are displayed: ● C2: Tool-related, channel-specific protection zone, active, circular, radius = 2 mm ●...
Page 590
Work preparation 3.6 Protection zones N... <status> <MaxDist>[0] ≙ X <MaxDist>[1] ≙ Y Remarks 4223 -13.000 0.000 Clearance to C4 is a total of 4 mm due to C2 and _LIMIT[3]. Clearance C2 → N3 of 0.1 mm does not result in limitation of the tra‐ versing distance.
Page 591
Work preparation 3.6 Protection zones Software limit switches and transformations With CALCPOSI(), the positions of the machine axes (MCS) cannot always be uniquely determined from the positions of the geometry axes (WCS) during various kinematic transformations (e.g. TRANSMIT) because of ambiguities at certain positions of the traversing distance.
Work preparation 3.7 Special motion commands Special motion commands 3.7.1 Approaching coded positions (CAC, CIC, CDC, CACP, CACN) Using the path commands to "Approach coded positions", it is possible to traverse linear and rotary axes to fixed axis positions saved in the machine data table by specifying position numbers.
Page 593
Work preparation 3.7 Special motion commands A spline defines a curve which is formed from polynomials of 2nd or 3rd degree. The characteristics of the points along the curve of a spline can be defined depending on the spline type being used. P1 to P6: specified coordinates For SINUMERIK solution line, the following spline types are available: ●...
Page 594
Work preparation 3.7 Special motion commands Command to activate B spline interpolation BSPLINE: Command to activate C spline interpolation CSPLINE: The ASPLINE, BSPLINE and CSPLINE commands are modally effective and belong to the group of motion commands. Points along a curve and check points: Positions in Cartesian coordinates X...
Page 595
Work preparation 3.7 Special motion commands Tangential transition to the previous block (delete position) ETAN: BAUTO EAUTO No input BNAT ENAT Zero curvature Tangential transition BTAN ETAN Note The programmable transitional behavior has no influence on the B spline. The B spline is always tangential to the check polygon at its start and end points.
Page 597
Work preparation 3.7 Special motion commands Program code N40 X30 N50 X40 Y5 N60 X50 Y15 N70 X55 Y7 N80 X60 Y20 N90 X65 Y20 N100 X70 Y0 N110 X80 Y10 N120 X90 Y0 N130 M30 Example 3: Spline interpolation (A spline) and coordinate transformation (ROT) Main program: Program code Comment...
Page 598
Work preparation 3.7 Special motion commands Subprogram "contour" (includes the coordinates of the points along the curve): Program code N10 X20 Y18 N20 X10 Y21 N30 X6 Y31 N40 X18 Y31 N50 X13 Y43 N60 X22 Y42 N70 X16 Y58 N80 X33 Y51 N90 M1 In addition to the spline curve, resulting from the example program (ASPLINE), the following...
Page 599
Work preparation 3.7 Special motion commands Properties and use of the various spline types Spline type Properties and use A spline A spline (akima spline) P1 to P7: specified coordinates Properties: ● Passes exactly through the specified intermediate points along the curve. ●...
Page 600
Work preparation 3.7 Special motion commands Spline type Properties and use B spline B spline Check polygon P1 to P7: specified coordinates Properties: ● Does not run through the specified intermediate points along the curve, but only close to them. The intermediate points to not attract the curve. The curve characteristic can be additionally influenced by weighting the intermediate points using a factor.
Page 601
Work preparation 3.7 Special motion commands Spline type Properties and use C spline C spline (cubic spline) P1 to P7: specified coordinates Properties: ● Passes exactly through the specified intermediate points along the curve. ● The curve characteristic is tangential with continuous curvature. ●...
Page 602
Work preparation 3.7 Special motion commands Comparison of three spline types with identical interpolation points Minimum number of spline blocks The G codes ASPLINE, BSPLINE and CSPLINE link block end points with splines. For this purpose, a series of blocks (end points) must be simultaneously calculated. The buffer size for calculations is ten blocks as standard.
Work preparation 3.7 Special motion commands The function is activated via the channel-specific machine data: MD20488 $MC_SPLINE_MODE (setting for spline interpolation). Further information: Function Manual Basic Functions 3.7.3 Spline group (SPLINEPATH) The axes to be interpolated in the spline group are selected using the SPLINEPATH command. Up to eight path axes can be involved in a spline interpolation grouping.
Work preparation 3.7 Special motion commands SPLINEPATH (1,X,Y,Z) 3.7.4 Activating/deactivating NC block compression (COMPON, COMPCURV, COMPCAD, COMPSURF, COMPOF) The functions to compress linear blocks (and dependent on the parameterization, also circular and/or rapid traverse blocks) are activated/deactivated using G commands of G group 30. The commands are modal.
Work preparation 3.7 Special motion commands Example: COMPCAD Program code Comment N10 G00 X30 Y6 Z40 N20 G1 F10000 G642 ; Activation: Rounding function G642 N30 SOFT ; Activation: Jerk limitation SOFT N40 COMPCAD ; Activation: Compressor function COMPCAD N50 FIFOCTRL N24050 Z32.499 ;...
Page 606
Work preparation 3.7 Special motion commands Axis identifier X, Y, Z: xe, ye, ze : Specification of end position for the particular axis; value range as for path dimension a2, a3, a4, a5 : The coefficients a , and a are written with their value;...
Page 607
Work preparation 3.7 Special motion commands Example Program code Comment N10 G1 X… Y… Z… F600 N11 POLY PO[X]=(1,2.5,0.7) PO[Y]=(0.3,1,3.2) ; Polynomial interpolation on PL=1.5 N12 PO[X]=(0,2.5,1.7) PO[Y]=(2.3,1.7) PL=3 N20 M8 H126 … N25 X70 PO[Y]=(9.3,1,7.67) PL=5 ; Mixed data for the axes N27 PO[X]=(10,2.5) PO[Y]=(2.3) ;...
Page 608
Work preparation 3.7 Special motion commands End point 2 End point 4 Example: N9 X0 Y0 G90 N10 POLY PO[Y]= (2) PO[X] (4,0.25) PL=4 (PL) Shape of the curve in the XY plane Result in XY plane (PL) Description The equation to express the polynomial function is generally as follows: f(p)= a p + a + .
Page 609
Work preparation 3.7 Special motion commands In the control, polynomials up to a maximum of the 5th degree can be programmed: f(p)= a p + a By assigning concrete values to these coefficients, it is possible to generate various curve shapes such as line, parabola and power functions.
Work preparation 3.7 Special motion commands As a result of the programmed start points, end points, coefficient a and PL=1, the intermediate results are as follows: Numerator (X) = 10 + 0 * p - 10 * p Numerator 0 + 20 * p + 0 * p (Y) = Denominator = 1 + p If polynomial interpolation is active and a denominator polynomial is programmed with zeros...
Page 611
Work preparation 3.7 Special motion commands possibilities are available for selecting the axes not contained in FGROUP on how they should follow the FGROUP axes: ● Synchronous to path S (SPATH) ● Synchronous to curve parameter U (UPATH) Syntax SPATH UPATH Meaning The axes not contained in FGROUP are traversed with reference to path S...
Work preparation 3.7 Special motion commands In both program sections, the path S of the FGROUP axes in N20 is dependent on the square of curve parameter U. Therefore, different position arise for synchronized axis A along path X, according to whether SPATH or UPATH is active. Further information Control behavior for reset and machine/option data The G command, defined with MD20150 $MC_GCODE_RESET_VALUES[44], is effective...
Page 613
Work preparation 3.7 Special motion commands Syntax MEAS=<TE> G... X... Y... Z... MEAW=<TE> G... X... Y... Z... Meaning Measurement with delete distance-to-go MEAS: Effectiveness: Non-modal Measurement without delete distance-to-go MEAW: Effectiveness: Non-modal Application: For measuring tasks in which the programmed position is to be approached in every case.
Page 614
Work preparation 3.7 Special motion commands Note MEAS and MEAW are non-modal, and programmed together with motion operations. The feedrate and interpolation type (G0, G1, etc.) as well as the number of axes must be adapted for the respective measuring task. Example Program code Comment...
Work preparation 3.7 Special motion commands Reading measurement results The measured values of the axes acquired by probes can be read through the following system variables in the part program and in synchronized actions. System variable Meaning $AA_MM[<Axis>] Probe measured value in the machine coordinate system $AA_MW[<Axis>] Probe measured value in the workpiece coordinate system 3.7.8...
Page 616
Work preparation 3.7 Special motion commands Name of channel axis used for measurement <Axis>: Two-digit (xx) number indicating the operating mode (measuring mode and meas‐ <Mode>: uring system) Units decade: Measuring mode Specifies whether the trigger events are to be activated in chronological or pro‐ grammed order.
Page 617
Work preparation 3.7 Special motion commands Program code Comment N110 IF $AC_MEA[1]==FALSE GOTOF END ; Check that the measurement was success- ful. N120 R10=$AA_MM1[X] ; Save measured value acquired at the first programmed trigger event (positive edge). N130 R11=$AA_MM2[X] ; Save measured value acquired at the sec- ond programmed trigger event (negative edge).
Page 618
Work preparation 3.7 Special motion commands Program code Comment N130 R11=$AA_MM2[X] ; Save measured value acquired at the sec- ond programmed trigger event (positive edge of probe 1). N140, PROBE2: N150 IF $AC_MEA[2]==FALSE GOTOF END ; Check that the measurement with probe 2 is successful.
Page 619
Work preparation 3.7 Special motion commands c) Measurement of a positive/negative tooth flank with 2 probes Program code Comment N110 DEF REAL MEASVALUE[16] N120 DEF INT loop=0 N130 MEAC[X]=(1,1,-1,2) G01 X100 F100 ; Measurement in mode 1 with active meas- uring system, save measured values under $AC_FIFO1, wait for measuring signal in the sequence negative edge of probe 1,...
Page 620
Work preparation 3.7 Special motion commands If the measuring operation is performed with two measuring systems, a maximum of two trigger events can be programmed (positive or negative edge). The measured values of both probes are acquired for both of the trigger events. With the use of PROFIBUS telegram 391 (default setting for PROFIBUS communication) only one measured value is possible for each trigger event and position control cycle.
Page 621
Work preparation 3.7 Special motion commands Examples: N10 MEASA[Z]=(1,1) MEASA[Y]=(1,1) MEASA[X]=(1,1) G0 Z100 N10 MEASA[Z]=(1,1) POS[Z]=100 Query status If an evaluation is required in the program, whether a probe has been deflected or has switched, the status can be queried through the following system variables: System variable Meaning Data type...
Page 622
Work preparation 3.7 Special motion commands Measurement results for MEASA / MEAWA The values measured by probes can be read through the following system variables in the part program and in synchronized actions. System variable Meaning $AA_MM1[<Axis>] Probe measured value for trigger event 1 in the machine coordinate system $AA_MM4[<Axis>] Probe measured value for trigger event 4 in the machine coordinate system $AA_MW1[<Axis>]...
Work preparation 3.7 Special motion commands Protection against programming errors The following programming errors are detected and indicated as errors: ● MEASA/MEAWA programmed with MEAS/MEAW in the same block Example: N01 MEAS=1 MEASA[X]=(1,1) G01 F100 POS[X]=100 ● MEASA/MEAWA with number of parameters <2 or >5 Example: N01 MEAWA[X]=(1) G01 F100 POS[X]=100 ●...
Work preparation 3.7 Special motion commands Reserved G command calls The following G command calls are reserved for OEM users: ● OEMIPO1, OEMIPO2 (from G group 1) ● G810 ... G819 (G group 31) ● G820 ... G829 (G group 32) Their functionality is incorporated by means of compile cycles.
Work preparation 3.7 Special motion commands Syntax FENDNORM G62 G41 G621 Meaning FENDNORM: Automatic corner deceleration OFF Corner deceleration at inside corners when tool radius compensation is active G62: Corner deceleration at all corners when tool radius compensation is active G621: G62 only acts on inner corners with active tool radius compensation G41/G42 and active continuous-path mode G64/G641.
Page 626
Work preparation 3.7 Special motion commands End-of-motion criterion: "Interpolator stop" IPOENDA: Effective: Modal Block change criterion: Braking ramp IPOBRKA: Effective: Modal Tolerance window for end-of-motion criterion ADISPOSA: Effective: Modal Channel axis name (X, Y, ..) <axis>: Time of the block change, referred to the braking ramp as a %: <instant in time>: ●...
Page 627
Work preparation 3.7 Special motion commands Program code Comment N20 IPOBRKA(X,100) ; Block change criterion: "Braking ramp", 100% = start of the braking ramp N30 POS[X]=200 ; The block is changed as soon as the X axis starts to brake N40 POS[X]=250 ;...
Work preparation 3.8 Coordinate transformations (frames) Coordinate transformations (frames) 3.8.1 Coordinate transformation via frame variables In addition to frame instructions (Page 307), such as e.g. ROT, AROT, SCALE, etc., the workpiece coordinate system (WCS) can also be transformed using frame variables $P_...FR (data management frames) and $P_...FRAME (active frames).
Page 629
Work preparation 3.8 Coordinate transformations (frames) Figure 3-1 Overview of the frame variables NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Work preparation 3.8 Coordinate transformations (frames) 3.8.1.1 Predefined frame variable ($P_CHBFRAME, $P_IFRAME, $P_PFRAME, $P_ACTFRAME) Active: channel-specific base frames $P_CHBFRAME[ <n> ] ($P_BFRAME) Note The current base frame $P_BFRAME and the data storage base frame $P_UBFR are retained for compatibility reasons. ●...
Page 631
Work preparation 3.8 Coordinate transformations (frames) Active: Channel-specific programmable frame $P_PFRAME The $P_PFRAME frame variable defines the reference between the settable zero system (SZS) and the workpiece coordinate system (WCS). $P_PFRAME contains the resulting frame, that results ● From the programming of TRANS/ATRANS, ROT/AROT, SCALE/ASCALE, MIRROR/ AMIRROR or ●...
Page 632
Work preparation 3.8 Coordinate transformations (frames) Figure 3-2 Frame variable $P_ACTFRAME If one of the following frames $P_BFRAME / $P_CHBFRAME[<n>], $P_IFRAME or $P_PFRAME is changed, the current total frame $P_ACTFRAME is recalculated. Basic frame and settable frame are effective after Reset if MD 20110 RESET_MODE_MASK is set as follows: Bit0=1, bit14=1 -->...
Work preparation 3.8 Coordinate transformations (frames) Data storage: channel-specific base frames $P_CHBFR[<n>] The frame variables $P_CHBFR[<n>] read/write the base frames in the data storage. The data storage frame is not immediately active in the channel when written. The written frame is activated with: ●...
Page 634
Work preparation 3.8 Coordinate transformations (frames) $P_PFRAME = CMIRROR(X, Y, Z) The syntax for $P_CHBFRAME[<n>] is identical to $P_PFRAME. Meaning Translation of specified axes CTRANS: Rotation around specified axes CROT: Scale change on specified axes CSCALE: Direction reversal on specified axis CMIRROR: Offset value in the direction of the specified geometry axis X, Y, Z:...
Work preparation 3.8 Coordinate transformations (frames) Alternatively, the direct assignment of the individual values to the associated axis of the rotation component of the data storage frame: $P_UIFR[5, Y, RT]=0 $P_UIFR[5, X, RT]=0 $P_UIFR[5, Z, RT]=0 Description The chaining operator : combines several operations on a frame with each other. The operations are processed successively from left to right.
Work preparation 3.8 Coordinate transformations (frames) Meaning This command automatically establishes the reference $P_UIFRNUM: to the currently valid settable zero offset. P_UIFR[n,…,…] : Specify the frame number n to access the settable frame no. n. Specify the component to be read or modified: TR Translation FI Translation Fine RT Rotation...
Page 637
Work preparation 3.8 Coordinate transformations (frames) The frame components can only contain intermediate values for the description of pallet tasks. These are chained to generate various workpiece zeroes. Examples Assignments Program code Comment DEF FRAME SETTING_1 ; Definition of a local frame variable SETTING_1 = CTRANS(X,10) ;...
Work preparation 3.8 Coordinate transformations (frames) Chainings The operator : chains frames with each other in the programmed sequence. The frame components, such as offsets and rotations, are executed successively additive. Program code Comment $P_IFRAME = $P_UIFR[15] : ; Assignment of the result frame from the chaining $P_UIFR[16] of the ;...
Work preparation 3.8 Coordinate transformations (frames) 3.8.3 Coarse and fine offsets (CTRANS, CFINE) Fine offset A fine offset CFINE(...) can be applied to the following frames: ● Settable frames: $P_UIFR or $P_IFRAME ● Basic frames: $P_NCBFR[<n>], $P_CHBFR[<n>], $P_CHBFRAMES[<n>] or $P_ACTBFRAME ●...
Work preparation 3.8 Coordinate transformations (frames) In particular for the programmable frame $P_PFRAME: ● TRANS <K_1> <value> ● TRANS <K_1> <value> <K_2> <value> ● TRANS <K_1> <value> <K_2> <value> <K_3> <value> Meaning Frame, e.g. settable frame of the data storage $P_UIFR[<n>] <Frame>: Fine offset, additive offset.
Work preparation 3.8 Coordinate transformations (frames) MD28082 $MC_MM_SYSTEM_FRAME_MASK,Bit1 = <value> <value> Meaning Function: $AA_ETRANS[<axis>] written directly by PLC, HMI or NC program. Enable for retraction of the zero offset for $AA_ETRANS[<axis>] in the next possible tra‐ versing block: DB31, ... DBX3.0 Function: Activation of the active system frame $P:EXTFRAME and the data storage frame $P_EXTFR Enable for retraction of the zero offset for $AA_ETRANS[<axis>] by: DB31, ...
Page 642
Work preparation 3.8 Coordinate transformations (frames) Referencing status By setting a new actual value in the machine coordinate system, the referencing status of the machine axis is reset: DB31, ... DBX60.4/.5 = 0 (referenced / synchronized measuring system 1/2) It is recommended that PRESETON only be used for axes that do not require a reference point. To restore the original machine coordinate system, the measuring system of the machine axis must be referenced again, e.g.
Work preparation 3.8 Coordinate transformations (frames) 3.8.6 Set actual value without loss of the referencing status (PRESETONS) The PRESETONS() procedure sets a new actual value for one or more axes in the machine coordinate system (MCS). This corresponds to a work offset of the MCS of the axis. This does not cause the axis to be traversed.
Work preparation 3.8 Coordinate transformations (frames) New current actual value of the machine axis in the machine coordinate system <value_x>: (MCS) The input is made in the active measuring system (inch/metric) An active diameter programming (DIAMON) is taken into account Type: REAL Further information...
Page 645
Work preparation 3.8 Coordinate transformations (frames) Variable with which information on the quality of the FRAME calculation is <quality>: returned Type: VAR REAL Value: The ideal points are almost on a straight line: The frame could not be calculated. The returned FRAME variable contains a neutral frame.
Page 646
Work preparation 3.8 Coordinate transformations (frames) Program code Comment DEF REAL FIT_QUALITY=0 DEF REAL ROT_FRAME_LIMIT=5 ; Permits max. five degree rota- tion of the part position. DEF REAL FIT_QUALITY_LIMIT=3 ; Permits max. 3 mm offset between ideal and the measured triangle. DEF REAL SHOW_MCS_POS1[3] DEF REAL SHOW_MCS_POS2[3] DEF REAL SHOW_MCS_POS3[3]...
Work preparation 3.8 Coordinate transformations (frames) Geometrical relationships and frame chains With global frames there is no geometrical relationship between the axes. It is therefore not possible to perform rotations or program geometry axis identifiers. Rotations cannot be used on global frames. The programming of a rotation is denied with alarm 18310 "Channel %1 Block %2 Frame: rotation not allowed".
Work preparation 3.8 Coordinate transformations (frames) The number of basic frames can be configured in the channel via the machine data MD28081 $MC_MM_NUM_BASE_FRAMES. The standard configuration is designed for at least one basic frame per channel. A maximum of eight basic frames are supported per channel. In addition to the eight basic frames, there can also be eight NCU global basic frames in the channel.
Page 650
Work preparation 3.8 Coordinate transformations (frames) $P_TOOLFRAME TOROT and TOFRAME $P_WPFRAME Workpiece reference points $P_TRAFRAME Transformations $P_PFRAME Current programmable frame Current system frame For: $P_CYCFRAME Cycles P_ACTFRAME Current total frame FRAME chaining Current frame is made up of the com‐ plete basic frame $P_NCBFRAME [n] current global basic frames System variable $P_NCBFRAME[n] can be used to read and write the current global basic...
Page 651
Work preparation 3.8 Coordinate transformations (frames) $P_CHBFRMASK and $P_NCBFRMASK Complete basic frame The user can select which basic frames are to be included in the calculation of the "Complete" basic frame via the system variables $P_CHBFRMASK and $P_NCBFRMASK. The variables can only be programmed in the program and read via the OPI.
Page 652
Work preparation 3.8 Coordinate transformations (frames) $P_PFRAME Current programmable frame $P_PFRAME is the programmable frame that results from the programming of TRANS/ ATRANS, G58/G59, ROT/AROT, SCALE/ASCALE, MIRROR/AMIRROR or from the assignment of CTRANS, CROT, CMIRROR, CSCALE to the programmable frame. Current, programmable frame variable that establishes the reference between the settable zero system (SZS) and the workpiece coordinate system (WCS).
Page 653
Work preparation 3.8 Coordinate transformations (frames) Frame chaining The current frame is composed of the complete basic frame, the settable frame, the system frame and the programmable frame in accordance with the current complete frame specified above. Frame chain Frame for cycles, programmable frame; transformations System frame for TOROT (TOFRAME), workpieces...
Work preparation 3.9 Transformations Transformations 3.9.1 General programming of transformation types General function You can choose to program transformation types with suitable parameters in order to adapt the controller to various machine kinematics. These parameters can be used to declare both the orientation of the tool in space and the orientation movements of the rotary axes accordingly for the selected transformation.
Page 655
Work preparation 3.9 Transformations axes describe the orientation in space and are called orientation axes in subsequent sections. They are available as rotary axes on four types of machine with varying kinematics. 1. Two-axis swivel head, e.g. cardanic tool head with one rotary axis parallel to a linear axis on a fixed tool table.
Work preparation 3.9 Transformations Kinematic transformation also includes the so-called "Cartesian PTP travel" for which up to 8 different articulated joint positions STAT= can be programmed. Although the positions are programmed in a Cartesian coordinate system, the movement of the machine occurs in the machine coordinates.
Page 657
Work preparation 3.9 Transformations Machine kinematics for three, four and five axis transformation (TRAORI) Either the tool or the tool table can be rotatable with up to two rotary axes. A combination of swivel head and rotary table (single-axis in each case) is also possible. Swivel head, Swivel head, Swivel head,...
Page 658
Work preparation 3.9 Transformations not exactly parallel with the linear axes, "generic five-/six-axis transformation" can provide better results in respect of tool orientation. Kinematic transformations TRANSMIT, TRACYL and TRAANG For milling on turning machines or an axis that can be set for inclined infeed during grinding, the following axis arrangements apply by default in accordance with the transformation declared: TRANSMIT Activation of polar transformation...
Page 659
Work preparation 3.9 Transformations Example: Three- to five-axis transformation on a universal milling head The machine tool has at least five axes: ● Three translatory axes for movements in straight lines, which move the operating point to any position in the working area. ●...
Work preparation 3.9 Transformations 3.9.1.2 Overview of orientation transformation TRAORI Programming types available in conjunction with TRAORI Machine type Programming with active transformation TRAORI Machine types 1, 2, or 3 two- The axis sequence of the orientation axes and the orientation direction axis swivel head or two-axis of the tool can either be configured on a rotary table or a combination...
Page 661
Work preparation 3.9 Transformations Machine type Programming with active transformation TRAORI Interpolation of the orientation vector on a taper peripheral surface Orientation changes to a taper peripheral surface anywhere in space using interpolation: - ORIPLANE in the plane (large radius circle interpolation) - ORICONCW on a taper peripheral surface in the clockwise direction - ORICONCCW on a taper peripheral surface in the counter-clockwise direction...
Work preparation 3.9 Transformations 3.9.2 Three, four and five axis transformation (TRAORI) 3.9.2.1 General relationships of universal tool head To obtain optimum cutting conditions when machining surfaces with a three-dimensional curve, it must be possible to vary the setting angle of the tool. Tool axis The machine design to achieve this is stored in the axis data.
Page 663
Work preparation 3.9 Transformations Cardanic tool head variant 1 In the examples shown here, you can see the arrangements as illustrated by the CA machine kinematics with the Cardanic tool head! Machine manufacturer The axis sequence of the orientation axes and the orientation direction of the tool can be set up using the machine data as appropriate for the machine kinematics.
Work preparation 3.9 Transformations The following possible relations are generally valid: A' lies below the angle φ to the X axis B' lies below the angle φ to the Y axis C' lies below the angle φ to the Z axis Angle φ...
Page 665
Work preparation 3.9 Transformations Orientation of the tool is possible only in the plane perpendicular to the rotary axis. The transformation supports machine types with movable tool and movable workpiece. Three- and four-axis transformations are configured and programmed in the same way as five- axis transformations.
Work preparation 3.9 Transformations As an alternative to direct programming, the additional offset for orientation axes can also be transferred automatically from the work offset currently active. Transfer is configured in the machine data. Examples TRAORI(1,0,0,1) ; The basic orientation of the tool is in the Z direction TRAORI(1,0,1,0) ;...
Work preparation 3.9 Transformations Examples of machine kinematics CA (channel axis names C, A) Commands Description ORIRESET(90, 45) Axis C: 90° Axis A: 45° ORIRESET(, 30) Axis C: $MC_TRAFO5_ROT_AX_OFFSET_1/2[0] Axis A: 30° ORIRESET( ) Axis C: $MC_TRAFO5_ROT_AX_OFFSET_1/2[0] Axis A: $MC_TRAFO5_ROT_AX_OFFSET_1/2[1] Examples of machine kinematics CAC (channel axis names C, A, B) Commands Description...
Page 668
Work preparation 3.9 Transformations 4. Programming the surface normal vector at the start of the block with A4, B4, C4 and at the end of the block with A5, B5, C5 (face milling). 5. Programming using lead angle LEAD and tilt angle TILT 6.
Page 669
Work preparation 3.9 Transformations Syntax Rotary axis positions G1 X<Value> Y<Value> Z<Value> A<Value> B<Value> C<Value> Euler angles G1 X<Value> Y<Value> Z<Value> A2<Value> B2<Value> C2<Value> Direction vector G1 X<Value> Y<Value> Z<Value> A3<Value> B3<Value> C3<Value> Surface normal vector at block start G1 X<Value> Y<Value> Z<Value> A4<Value> B4<Value> C4<Value> Surface normal vector at the end of the block G1 X<Value>...
Page 670
Work preparation 3.9 Transformations The following commands are available for orientation programming: Command Meaning Euler angle with rotation sequence ZX'Z'' ORIEULER: RPY angle with rotation sequence XY'Z'' ORIRPY: RPY angle with rotation sequence ZY'X'' ORIRPY2: Virtual orientation axes with freely definable rotation sequence via: ORIVIRT1: MD21120 $MC_ORIAX_TURN_TAB_1 Virtual orientation axes with freely definable rotation sequence via:...
Page 671
Work preparation 3.9 Transformations Programming the directional vector The components of the direction vector are programmed with A3, B3, C3. The vector points towards the tool adapter; the length of the vector is of no significance. Vector components that have not been programmed are set equal to zero. X, Y, Z Coordinate axes of the WCS A3, B3,...
Page 672
Work preparation 3.9 Transformations Path tangent Perpendicular to path tangent Surface normal Path Tool Center Point Orientation vector Figure 3-4 Programming of LEAD TILT Note Behavior at inside corners with 3D tool offset If the block is shortened at an inside corner, the programmed tool orientation is still taken over at the end of the block.
Work preparation 3.9 Transformations 3.9.2.5 Face milling (A4, B4, C4, A5, B5, C5) Face milling is used to machine curved surfaces of any kind. For this type of 3D milling, you will require the line-by-line description of the 3D paths on the workpiece surface.
Work preparation 3.9 Transformations When ORIWKS is active (see "Reference of the orientation axes (ORIWKS, ORIMKS): (Page 674)"), the surface normal vectors refer to the active frame and are also rotated with frame rotation. Machine manufacturer The surface normal vector must be perpendicular to the path tangent, within a limit value set via machine data, otherwise an alarm will be output.
Page 675
Work preparation 3.9 Transformations Further information With ORIMKS, the movement executed by the tool depends on the machine kinematics. In the case of a change in orientation of a tool tip at a fixed point in space, linear interpolation takes place between the rotary axis positions.
Work preparation 3.9 Transformations 3.9.2.7 Programming orientation axes (ORIAXES, ORIVECT, ORIEULER, ORIRPY, ORIRPY2, ORIVIRT1, ORIVIRT2) The "Orientation axes" function describes the orientation of the tool in space and is achieved by programming the offset for the rotary axes. An additional, third degree of freedom can be achieved by also rotating the tool about itself.
Page 677
Work preparation 3.9 Transformations Orientation programming via RPY angle ORIRPY: The rotation sequence is XYZ and: ● A2 is the angle of rotation around X ● B2 is the angle of rotation around Y ● C2 is the angle of rotation around Z Orientation programming via RPY angle ORIRPY2: The rotation sequence is ZYX and:...
3.9 Transformations MD21155 $MC_JOG_VELO_ORI Note SINUMERIK 840D sl with "handling transformation package" Using the "Cartesian manual traverse" function, the translation of geometry axes in JOG mode can be set separately from one another in the reference systems MCS, WCS and TCS.
Page 679
Work preparation 3.9 Transformations Programming The end orientation is either defined by specifying the angle programming in the Euler or RPY angle using A2, B2, C2 or by programming the rotary axis positions using A, B, C. Further programming details are needed for orientation axes along the peripheral surface of a taper: ●...
Page 680
Work preparation 3.9 Transformations Interpolation on the peripheral surface of a taper with tangential tran‐ ORICONTO: sition Programming of a rotary axis of the taper (normalized vector) A6= B6= C6=: Opening angle of taper in degrees NUT=angle: Traverse angle less than or equal to 180 degrees NUT=+179: Traverse angle greater than or equal to 180 degrees NUT=-181:...
Work preparation 3.9 Transformations Programming in the ORIPLANE plane corresponds to ORIVECT The programming of large-radius circular interpolation together with angle polynomials corresponds to the linear and polynomial interpolation of contours. The tool orientation is interpolated in a plane that is defined by the start and end orientation. If additional polynomials are programmed, the orientation vector can also be tilted out of the plane.
Page 682
Work preparation 3.9 Transformations Programming This type of interpolation can be used to program points (using G1) or polynomials (using POLY) for the two curves in space. Circles and involutes are not permitted. A BSPLINE spline interpolation and the "Combine short spline blocks" function can also be activated. Additional information about function "Combine short spine blocks", see Function Manual Basic Functions.
Work preparation 3.9 Transformations Note Identifiers XH YH ZH for programming a 2nd orientation path The identifiers must be selected such that no conflict arises with the other identifiers or linear axes X Y Z axes and rotary axes such as A2 B2 C2 Euler angle or RPY angle A3 B3 C3 direction vectors A4 B4 C4 or A5 B5 C5 surface normal vectors...
Page 684
Work preparation 3.9 Transformations In both cases, with 6-axis transformations, a polynomial can also be programmed for the rotation using Interpolation of the rotation relative to the N… PO[THT]=(c2, c3, c4, c5) path N… PO[THT]=(d2, d3, d4, d5) Interpolation absolute, relative and tangen‐ tial to the change of orientation of the orientation vector.
Work preparation 3.9 Transformations Type 2 orientation polynomials with ORICURVE If interpolation with the additional curve in space ORICURVE is active, the Cartesian components of the orientation vector are interpolated and only type 2 orientation polynomials are possible. 3.9.4 Rotations of the tool orientation (ORIROTA, ORIROTR, ORIROTT, ORIROTC, THETA) If you also want to be able to change the orientation of the tools on machine types with movable tools, program each block with end orientation.
Page 686
Work preparation 3.9 Transformations Meaning Angle of rotation to an absolute direction of rotation ORIROTA: Angle of rotation relative to the plane between the start and end orientation ORIROTR: Angle of rotation as a tangential rotation vector to the change of orientation ORIROTT: Angle of rotation as a tangential rotation vector to the path tangent ORIROTC:...
Work preparation 3.9 Transformations ORIROTR The angle of rotation THETA is interpreted relative to the plane defined by the start and end orientation. ORIROTT The angle of rotation THETA is interpreted relative to the change in orientation. For THETA=0 the rotation vector is interpolated tangentially to the change in orientation and only differs from ORIROTR if at least one polynomial has been programmed for "tilt angle PSI"...
Work preparation 3.9 Transformations ORIPATH/ORIPATHS can be used to program various references to the path tangent via the three angles ● LEAD = specification of lead angle relative to the path and surface ● TILT = specification of tilt angle relative to the path and surface ●...
Page 689
Work preparation 3.9 Transformations Machine manufacturer Please refer to the machine manufacturer's instructions. The interpolation of the LEAD and TILT angles can be set differently using machine data. Syntax Rotation of tool orientation and tool The type of tool orientation relative to the path is activated using ORIPATH or ORIPATHS. Activate type of orientation relative to the path N...
Work preparation 3.9 Transformations Orientation polynomial for the TILT angle PO[PSI]: Orientation polynomial for the THETA angle of rotation PO[THT]: Note Angle of rotation THETA A 6-axis transformation is required to rotate a tool with a third rotary axis that acts as an orientation axis about itself.
Page 691
Work preparation 3.9 Transformations Note Interpolation of the rotation vector ORIROTC Initiating rotation of the tool relative to the path tangent in the opposite direction to the tool orientation, is only possible with a 6-axis transformation. With active ORIROTC Rotation vector ORIROTA cannot be programmed. If programming is undertaken, ALARM 14128 "Absolute programming of tool rotation with active ORIROTC"...
Work preparation 3.9 Transformations Intermediate orientation (programming as normalized vector) A7= B7= C7=: Interpolation of the orientation specifying a movement between two con‐ ORICURVE tact points of the tool. In addition to the end points, additional curve XH YH ZH, e.g. with polynomials can also be programmed.
Work preparation 3.9 Transformations Note Programming direction vectors A8, B8, C8 If the length of this vector is exactly zero, no retracting movement is executed. ORIPATHS Tool orientation relative to the path is activated using ORIPATHS. The orientation is otherwise transferred from the start orientation to the end orientation by means of linear large-circle interpolation.
Page 694
Work preparation 3.9 Transformations N... X=<...> Y=<...> Z=<...> A2=<...> B2=<...> C2=<...> THETA=<...> F=<...> Note The position values can be entered directly (e.g. X90) or indirectly via parameter settings (e.g. X=R1*(R2+R3)). Programming tool orientation using rotary axis positions Tool orientation can be also specified using rotary axis positions, e.g. with the following structure: N...
Page 695
Work preparation 3.9 Transformations See " Activating/deactivating NC block compression (COMPON, COMPCURV, COMPCAD, COMPSURF, COMPOF) (Page 604) ". Note Orientation motion is only compressed when large radius circular interpolation is active (i.e. tool orientation is changed in the plane, which is determined by start and end orientation). Large-radius circular interpolation is performed under the following conditions: ●...
Work preparation 3.9 Transformations 3.9.7 Compression of the orientation (COMPCAD, COMPSURF) NC programs, in which orientation transformation (TRAORI) is active and tool orientations are programmed (no matter what type), can be compressed if kept within specified limits. Programming Tool orientation If orientation transformation (TRAORI) is active, for 5-axis machines, tool orientation can be programmed in the following way (independent of the kinematics): ●...
Page 697
Work preparation 3.9 Transformations In this case, compression is executed in two different ways, depending on whether large-radius circular interpolation is executed. If no large-radius circular interpolation takes place, then the compressed change in orientation is represented in the usual way by axial polynomials for the rotary axes.
Work preparation 3.9 Transformations Programming Comment DEF INT COUNTER DEF REAL ANGLE N10 G1 X0 Y0 F5000 G64 //sort match rate lower first $SC_COMPRESS_CONTUR_TOL=0.05 ; Maximum deviation of the contour = 0.05 mm $SC_COMPRESS_ORI_TOL=5 ; Maximum deviation of the orientation = 5 degrees TRAORI COMPCAD...
Work preparation 3.9 Transformations Note A TRANSMIT transformation active in the channel is activated with: ● Deactivate transformation: TRAFOOF ● Activation of another transformation: E.g. TRACYL, TRAANG, TRAORI 3.9.9.2 Activate cylinder surface transformation (TRACYL) The cylinder surface transformation (TRACYL) is activated in the part program or synchronized action using the TRACYL statement.
Page 701
Work preparation 3.9 Transformations Example Program code Comment N40 TRACYL(40.) ; Activate TRACYL with the first TRACYL data set and working diameter 40 mm. Further information Program structure A part program for milling a groove with TRACYL transformation 513 (TRACYL with groove side offset) generally comprises the following steps: 1.
Page 702
Work preparation 3.9 Transformations ① OFFN ② Programmed path Note OFFN should be at least as large as the tool radius to avoid damage occurring to the opposite side of the groove wall. Note OFFN acts differently with TRACYL than it does without TRACYL. Since, even without TRACYL, OFFN is included when TRC is active, OFFN should be reset to zero after TRAFOOF.
Work preparation 3.9 Transformations Axis utilization Note The following axes cannot be used as a positioning axis or a reciprocating axis: ● The geometry axis in the peripheral direction of the cylinder peripheral surface (Y axis). ● The additional linear axis for groove side compensation (Z axis). 3.9.9.3 Activating an oblique angle transformation with programmable angle (TRAANG) The oblique angle transformation with programmable angle is activated in the part program or...
Work preparation 3.9 Transformations Example Program code Comment N20 TRAANG(45) ; Activate TRAANG with the first TRAANG data set and angle 45° 3.9.9.4 Oblique plunge-cutting on grinding machines (G5, G7) The G commands G7 and G5 are used to simplify programming of oblique plunge-cutting on grinding machines with "inclined axis (TRAANG)", so that when plunge cutting, only the inclined axis is traversed.
Work preparation 3.9 Transformations Example ① Grinding wheel ② Workpiece ③ Parallel to the inclined axis through the programmed end position ④ Starting position ⑤ Plunge-cutting: Starting position ⑥ Plunge-cutting: End position ⑦ Parallel to the Z axis, at a distance from the actual position of the X axis Geometry axis Geometry axis Machine axis...
Page 706
Work preparation 3.9 Transformations Syntax TRACON(<Trafo_No>,<Par_1>,...,<Par_n>,<Par_n+1>) TRAFOOF Meaning Activate concatenated transformation TRACON: If another transformation was previously activated, it is implicitly dis‐ abled by means of TRACON(). Number of the concatenated transformation: <Trafo_No>: Type: Range of val‐ 0 ... 2 ues: Value: 0, 1...
Work preparation 3.9 Transformations Program code Comment ; The previously active transformation is automatically de- selected. ; The angle for the inclined axis is 45°. N330 TRACON(2,40.) ; Activate second concatenated transformation. ; The angle for the inclined axis is 40°. N380 TRAFOOF ;...
Work preparation 3.9 Transformations Activate point-to-point movement PTPWOC (only possible if orientation transformation PTPWOC: is active) Just the same as PTP, however, without any compensatory motion, which is caused by motion of rotary axes and orientation axes. Deactivating point-to-point motion and activating path motion CP Cartesian path motion is executed with CP.
Page 709
Work preparation 3.9 Transformations The use of STAT is to be illustrated by the example of a 6-axis articulated robot with milling spindle. The kinematic transformation is to be realized using the ROBX robot transformation (precondition: Compile cycle "RMCC/ROBX Transformation Extended Robotics" is loaded and active).
Page 710
Work preparation 3.9 Transformations The articulated joint positions required for machining are selected by programming bit 0 ... 2 of the adjustable STAT address: Bit 0 Position of the intersection points of the hand/wrist axes (A4, A5, A6) Basic range (shoulder right) The robot is in the basic range if the X value of the intersection point of the hand/wrist ax‐...
Page 711
Work preparation 3.9 Transformations Program code Comment N16 ORIMKS N17 G1 PTP X1665.67 Y0 Z1377.405 A=0 B=0 C=0 STAT=... F2000 ; The STAT value defines the articulated joint positions (see below) → Shoulder left STAT=1 ('B001') → Elbow down → No handflip →...
Work preparation 3.9 Transformations → Shoulder right STAT=6 ('B110') → Elbow up → Handflip TRANSMIT For TRANSMIT, the STAT address is used to initiate the equivocality regarding the pole. The following applies if the rotary axis must rotate through 180º or the contour for CP would go through the pole: Bit 0 Only relevant for $MC_TRANSMIT_POLE_SIDE_FIX_1/2 = 1 or 2:...
Page 713
Work preparation 3.9 Transformations Meaning Adjustable address to specify axis angle signs Binary or decimal value <Value>: For each axis that is involved in the transformation, there is a bit that indicates the sign of the axis angle (θ), and therefore the traversing direction. Axis angle sign: + Axis angular range: 0°...
Page 714
Work preparation 3.9 Transformations Meaning Value Axis angle Axis angle sign Bit 5 Sign for the axis angle of A6 ≥ 0° < 0° The actual TU bit numbers obtained from the channel axis numbers of the robot axes! In the example, robot axes (A1 to A6) are the first six axes in the channel;...
Work preparation 3.9 Transformations Example The rotary axis position shown in the following diagram can be approached in the negative or positive direction. The angular position is programmed under address A1. The traversing direction is only absolutely clear when TU is specified. 3.9.11.4 Example 1: PTP travel of a 6-axis robot with ROBX transformation In the following application example, Cartesian PTP travel and the associated NC commands...
Work preparation 3.9 Transformations 3.9.11.6 Example 3: PTPG0 and TRANSMIT Traversing around the pole with PTPG0 and TRANSMIT Program code Comment N001 G0 X30 Z0 F10000 T1 D1 G90 ;Initial setting absolute dimension N002 SPOS=0 N003 TRANSMIT ;TRANSMIT transformation N010 PTPG0 ;...
Work preparation 3.9 Transformations ● Tool radius compensation must be deselected (G40); if not a message is displayed. ● An activated tool length offset is included in the transformation by the control. ● The control deselects the current frame active before the transformation. ●...
Page 720
Work preparation 3.9 Transformations Syntax TRAFOOF Meaning Deactivating all active transformations/frames TRAFOOF: NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Work preparation 3.10 Kinematic chains 3.10 Kinematic chains 3.10.1 Deletion of components (DELOBJ) The DELOBJ() function "deletes" components by resetting the assigned system variables to their default values: ● Elements from kinematic chains ● Protection areas, protection area elements and collision pairs ●...
Page 722
Work preparation 3.10 Kinematic chains Meaning Deletion of elements from kinematic chains, protection areas, protection area ele‐ DELOBJ: ments, collision pairs and transformation data Component type to be deleted <CompType>: Data type: STRING Value: "KIN_CHAIN_ELEM" Meaning: System variables of all kinematic elements: $NK_... Value: "KIN_CHAIN_SWITCH"...
Page 723
Work preparation 3.10 Kinematic chains Index of the first component to be deleted (optional) <Index1>: Data type: Default value: Range of val‐ -1 ≤ x ≤ (maximum number of configured components -1) ues: Value Meaning 0, 1, 2, ..Index of the component to be deleted. All components of the specified type are deleted.
Work preparation 3.10 Kinematic chains 3.10.2 Index determination by means of names (NAMETOINT) User-specific names are entered in the system variable arrays of type STRING. Based on the identifier of the system variables and the name, the NAMETOINT() function determines the index value belonging to the name under which it is stored in the system variable array.
Work preparation 3.11 Collision avoidance with kinematic chains 3.11 Collision avoidance with kinematic chains Note Protection areas The protection areas specified in the following chapters refer to the "Geometric machine modeling" function. Information about this function, see Function Manual Monitoring and Compensation. 3.11.1 Check for collision pair (COLLPAIR) The COLLPAIR() function determines whether two protection areas form a collision pair.
Work preparation 3.11 Collision avoidance with kinematic chains Alarm suppression (optional) <NoAlarm>: Data type: BOOL Value: FALSE (Default) In the event of an error (<RetVal> < 0), the program processing is stopped and an alarm displayed. TRUE In the event of an error, the program process‐ ing is not stopped and no alarm displayed.
Work preparation 3.11 Collision avoidance with kinematic chains Program code Comment PROTA THEN recalculate collision model ENDIF ; ENDIF See also Setting the protection zone status (PROTS) (Page 727) 3.11.3 Setting the protection zone status (PROTS) The PROTS() procedure sets the state of protection areas to the specified value. Syntax PROTS(<State>[,<Name_1>,...,<Name_n>]) Meaning...
Page 728
Work preparation 3.11 Collision avoidance with kinematic chains Function properties: ● The clearance calculation is performed independent of the protection area status (activated, deactivated, preactivated). ● To calculate the clearance of two protection areas, only protection area elements are used, which are marked with $NP_USAGE = "C"...
Page 729
Work preparation 3.11 Collision avoidance with kinematic chains Return value: 3-dimensional clearance vector from protection area <Name_2> to <Vector>: protection area <Name_1> with: ● <Vector>[0]: X coordinate in the world coordinate system ● <Vector>[1]: Y coordinate in the world coordinate system ●...
Work preparation 3.12 Transformation with kinematic chains 3.12 Transformation with kinematic chains 3.12.1 Activating a transformation (TRAFOON) A transformation defined with kinematic chains is activated with the predefined TRAFOON procedure. The call must be alone in a block. Note Alternatively, a transformation defined with kinematic chains can also be activated via conventional NC commands, such as TRAORI or TRANSMIT.
Work preparation 3.12 Transformation with kinematic chains 3.12.2 Modifying the orientation transformation after the machine measurement (CORRTRAFO) For machines with orientation transformations that were defined by means of kinematic chains, the user can use the predefined CORRTRAFO function in order to modify the offset vectors or the direction vectors of the orientation axes in the kinematic model of the machine after a machine measurement.
Page 732
Work preparation 3.12 Transformation with kinematic chains Meaning Function call CORRTRAFO: NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Page 733
Work preparation 3.12 Transformation with kinematic chains Function return value <Corr_Status>: Data type: Values: 0 The function was executed without an error. 1 No transformation is active. 2 The currently active transformation is not an orientation trans‐ formation. 3 The active orientation transformation was not defined with kin‐ ematic chains.
Page 734
Work preparation 3.12 Transformation with kinematic chains 42 For the correction of a direction vector, the angular displace‐ ment compared to the current direction is greater than the maximum value specified by the setting data SD41611 $SN_CORR_TRAFO_DIR_MAX. 43 The attempt to write a system variable was rejected because of missing write rights.
Page 735
Work preparation 3.12 Transformation with kinematic chains Correction mode <Corr_Mode>: Data type: The <Corr_Index> parameter is decimal coded (units to thousands position): Units Specifies which element is to be corrected. position: xxx0 Correction of a linear offset vector xxx1 Correction of the direction vector of an orientation axis Tens Specifies how the correction element to which the content position:...
Page 736
Work preparation 3.12 Transformation with kinematic chains Behavior in the event of an error (return value > 0) (optional) <No_Alarm>: Data type: BOOL Value: FALSE In the event of an error, the program processing is stop‐ (default) ped and alarm 14103 is displayed. TRUE In the event of an error, the program processing is not stopped and no alarm is displayed.
Page 737
Work preparation 3.12 Transformation with kinematic chains Figure 3-7 CORRTRAFO example The sections are clearly defined: If you run through the kinematic subchain from the starting point to the end point, the first section has the index 0, the next the index 1, and so on. The index of the last section is then always equal to the number of orientation axes.
Page 738
Work preparation 3.12 Transformation with kinematic chains Point to close the tool chain If the $NT_CLOSE_CHAIN_T system variable is not empty, the tool chain is not closed at the end point of the chain, but rather at the end point of the designated chain element. Other chain elements that are behind this point result in a corresponding work offset when the transformation is activated.
Work preparation 3.13 Tool offsets 3.13 Tool offsets 3.13.1 Offset memory Structure of the offset memory Every data field can be called with a T and D number, and contains not only the geometric specifications for the tool but also further entries, such as the tool type. User cutting edge data User cutting edge data can be configured via machine data.
Page 740
Work preparation 3.13 Tool offsets Tool parameter number (DP) Meaning of system variables Remark $TC_DP14 Length 3 $TC_DP15 Radius 1 / length 1 Milling/turning/grinding tool $TC_DP15 diameter d Slotting saw $TC_DP16 Length 2 / corner radius, tapered milling tool, slot width Milling tools $TC_DP16 b corner radius...
Work preparation 3.13 Tool offsets Tool parameter number Meaning Cutting Dn Remark (DP) $TC_DP5 Length 3 Geometry Radius $TC_DP6 Radius Geometry Limit angle $TC_DP10 Minimum limit angle $TC_DP11 Maximum limit angle Wear Length and radius compensation $TC_DP12 Wear length 1 $TC_DP13 Wear length 2 $TC_DP14...
Page 742
Work preparation 3.13 Tool offsets Application Dimension errors caused be the location of use can be compensated using additive offsets. Syntax DL=<number> Meaning Command to activate an additive offset The additive tool offset data to be activated is specified using the <number> param‐ <number>: eter Note...
Work preparation 3.13 Tool offsets Program code Comment 3.13.2.2 Specify wear and setup values ($TC_SCPxy[t,d], $TC_ECPxy[t,d]) Wear and setting-up values can be read and written to using system variables. The logic is based on the logic of the corresponding system variables for tools and tool noses. System variables Wear values that are assigned to the particular geometry parameters $TC_SCPxy[<t>,<d>]:...
Work preparation 3.13 Tool offsets Meaning Command to delete additive offsets DELDL: T number of the tool <t>: D number of the tool cutting edge <d>: All additive offsets of the cutting edges <d> of the tool <t> are deleted. DELDL[<t>,<d>]: All additive offsets of all cutting edges of tool <t>...
Page 745
Work preparation 3.13 Tool offsets SD42935 $SC_WEAR_TRANSFORM Transformation of wear values. SD42940 $SC_TOOL_LENGTH_CONST Assignment of tool length components to geome‐ try axes. SD42950 $SC_TOOL_LENGTH_TYPE Assignment of the tool length components inde‐ pendent of tool type. SD42960 $SC_TOOL_TEMP_COMP Temperature compensation value in tool direction. Also operative when tool orientation is program‐...
Work preparation 3.13 Tool offsets 3.13.3.1 Mirroring of tool lengths When setting data SD42900 $SC_MIRROR_TOOL_LENGTH and SD42910 $SC_MIRROR_TOOL_WEAR are not set to zero, then you can mirror the tool length components and components of the basis dimensions with wear values and their associated axes.
Work preparation 3.13 Tool offsets In the following table, the dimensions, whose sign is inverted using SD42920 (not equal to zero), are designed using an X: Cutting edge position Length 1 Length 2 Note The sign evaluation using SD42920 and SD42910 are independent of one another. If, for example, the sign of a dimension is changed using both setting data, then the resulting sign remains unchanged.
Page 748
Work preparation 3.13 Tool offsets Syntax TOWSTD TOWMCS TOWWCS TOWBCS TOWTCS TOWKCS Meaning Initial setting value for offsets in tool length wear value TOWSTD: Offsets in tool length in MCS TOWMCS: Offsets in tool length in WCS TOWWCS: Offsets in tool length in BCS TOWBCS: Offsets in tool length at tool carrier reference point (orientable tool carrier) TOWTCS:...
Page 749
Work preparation 3.13 Tool offsets No kinematic transformation and no orientable tool carrier If neither a kinematic transformation nor an orientable tool carrier is active, then all the other four coordinate systems (except for the WCS) are combined. It is then only the WCS, which is different to the other systems.
Work preparation 3.13 Tool offsets 3.13.3.4 Tool length and plane change When setting data SD42940 $SC_TOOL_LENGTH_CONST is set not equal to zero, then you can assign the tool length components – such as lengths, wear and basic dimension – to the geometry axes for turning and grinding tools when changing the plane.
Work preparation 3.13 Tool offsets 3.13.4 Online tool offset 3.13.4.1 Defining a polynomial function (FCTDEF) Certain dressing strategies (e.g. dressing roller) are characterized by the fact that the grinding wheel radius is continuously (linearly) reduced as the dressing roller is fed in. This strategy requires a linear function between infeed of the dressing roller and writing the wear value of each length.
Work preparation 3.13 Tool offsets Example Definitions ● Function number: 1 ● Lower and upper limit value: -100, 100 ● Gradient of the characteristic: a ● The operating point should be located at the center of the characteristic. Based on the setpoint position of axis XA in the WCS at the instant that the function is defined in the NC program, the characteristic must be shifted in the negative Y direction: a = -a...
Work preparation 3.13 Tool offsets Syntax PUTFTOCF(<Func>,<RefVal>,<ToolPar>,<Chan>,<Sp>) Meaning PUTFTOCF(...): Write online tool offset, continuously block-by-block using the polynomial function defined with FCTDEF(...) Function number, defined in the function definition with FCTDEF(...) <Func>: Data type: Range of val‐ 1, 2, 3 ues: Reference value, from which the offset is to be derived (e.g.
Work preparation 3.13 Tool offsets Number of the channel in which the online tool offset is to take effect. <Chan>: Note: Only required if the offset is not to take effect in the active channel. Data type: Number of the spindle for which the online tool offset is to take effect. <Sp>: Note: Only required if the offset is to be applied to a non-active grinding wheel rather than...
Page 755
Work preparation 3.13 Tool offsets The actual activation is performed with G41 or G42 The tool radius compensation is deactivated with G40. Syntax G41/G42 ORIC/ORID ISD=... CUT3DC/CUT3DCD CDOF2 X... Y... Z... G40 X... Y... Z... Meaning 3D TRC for circumferential milling (only when 5-axis transforma‐ CUT3DC: tion is active) 3D TRC in relation to a differential tool for circumferential milling...
Page 756
Work preparation 3.13 Tool offsets Example Program code Comment ; Definition of tool D1: $TC_DP1[1,1]=120 ; Type (end mill) $TC_DP3[1,1]=20 ; Length compensation vector $TC_DP6[1,1]=8 ; Radius N10 X0 Y0 Z0 T1 D1 F12000 ; Selection of the tool. N20 TRAORI(1) ;...
Page 757
Work preparation 3.13 Tool offsets Figure 3-8 Circumferential milling Approach behavior The approach behavior is always NORM for the 3D variant of the tool radius compensation. Behavior at outside corners The G commands of group 18 (corner behavior, tool offset) are evaluated at the outside corners for circumferential milling with 3D TRC in the same way as for the conditions for the 2½D TRC: ●...
Page 758
Work preparation 3.13 Tool offsets ① Programmed path ② Milling tool machining point ③ Milling tool reference point ④ Milling tool tip Insertion depth (InSertion Depth) Figure 3-9 Insertion depth Tool radius compensation referred to a differential tool 3D TRC for circumferential milling referred to a differential tool is activated via the CUT3DCD command.
"Advanced Surface" / "Top Surface" must be observed. A special test program is provided in the SIOS portal for checking the set data. → Test program for Advanced Surface / Top Surface (https://support.industry.siemens.com/cs/ ww/en/view/109738423) 3.13.5.2 Selecting 3D tool radius compensation for the 3D face milling (CUT3DF, CUT3DFS,...
Page 760
Work preparation 3.13 Tool offsets 3D TRC in relation to a differential tool for face milling with CUT3DFD: change in orientation (only with active 5-axis transformation) The radius difference is specified by the tool parameter $TC_DP15. Note: CUT3DFD is only possible in combination with "Smoothing of surface normals in 3D face milling".
Page 761
Work preparation 3.13 Tool offsets Program code Comment N80 X0 Y0 Z0 A0 B0 C0 G17 T1 D1 F12000 ; Selection of the tool. N90 TRAORI(1) ; Select orientation transformation. N100 B4=-1 C4=1 ; Definition of the plane. N110 G41 ORID CUT3DF G64 X10 Y0 Z0 ;...
Page 762
Work preparation 3.13 Tool offsets Program code Comment TRAORI(1) ; Select orientation transformation. G500 CYCLE832(0.01, _TOP_SURFACE_SMOOTH_ON + _ORI_FIN- ; Call CYCLE832 with: ISH, 1) ; Contour tolerance = 0.01 mm, ; Processing type: Top Surface with smoothing, ; Finishing with input of an orientation toler- ance, ;...
Page 764
For 3D face milling with CUT3DFD in combination with "Top Surface", the setting recommendations regarding "Top Surface" must be observed. A special test program is provided in the SIOS portal for checking the set data. → Test program for Top Surface (https://support.industry.siemens.com/cs/ww/en/view/ 109738423) See also CYCLE832 - High-Speed Settings (Page 1107)
Work preparation 3.13 Tool offsets 3.13.5.3 3D circumferential milling taking into account a limitation surface (CUT3DCC, CUT3DCCD) In 3D circumferential milling with a continuous or constant change in tool orientation, the tool center-point path is frequently programmed for a defined standard tool. Because in practice suitable standard tools are often not available, a tool that does not deviate too much from a standard tool (≤...
Page 766
Work preparation 3.13 Tool offsets Note The G commands for selecting the 3D TRC are evaluated in the approach block, i.e. typically in the block that contains G41 or G42. G41 or G42 can also be programmed in blocks without traversing movement in geometry axes relevant for the compensation.
Page 767
Work preparation 3.13 Tool offsets Standard tools with corner rounding Corner rounding with a standard tool is defined by the tool parameter $TC_DP7. Tool parameter $TC_DP16 describes the deviation of the corner rounding of the real tool compared with the standard tool. Example: Toroidal miller with reduced radius compared to the standard tool Tool type Shaft radius (R)
Page 768
Work preparation 3.13 Tool offsets of the original tool is a negative value. A negative wear value always describes a tool with a reduced diameter. Using cylindrical tools When cylindrical tools are used, infeed is only necessary if the machining surface and the surface of limitation form an acute angle (less than 90 degrees).
"Advanced Surface" / "Top Surface" must be observed. Special test programs are provided in the SIOS portal for checking the set data. → Test program for Advanced Surface / Top Surface (https://support.industry.siemens.com/cs/ ww/en/view/109738423) 3.13.6 Tool orientation (ORIC, ORID, OSOF, OSC, OSS, OSSE, ORIS, OSD, OST) The term tool orientation describes the geometric alignment of the tool in space.
Page 770
Work preparation 3.13 Tool offsets Programming Programming a orientation change: A change in tool orientation can be programmed by: ● Direct programming of rotary axes A, B, C (rotary axis interpolation) ● Euler or RPY angle ● Direction vector (vector interpolation by specifying A3 or B3 or C3) ●...
Page 771
Work preparation 3.13 Tool offsets Note All commands for smoothing the tool orientation (OSOF, OSC, OSS, OSSE, OSD, and OST) are summarized in G group 34. They are modal; in other words, only one of these commands can ever be effective at the same time. Examples Example 1: ORIC If two or more blocks with orientation changes are programmed between the traversing blocks...
Page 772
Work preparation 3.13 Tool offsets Example 2: ORID If ORID is active, then all blocks between the two traversing blocks are executed at the end of the first traversing block. The circle block with constant orientation is executed immediately before the second traversing block. Perform N12 and N14 Program code Comment...
Page 773
Work preparation 3.13 Tool offsets Example 3: Change in orientation at an inside corner Program code ORIC N10 X …Y… Z… G1 F500 N12 X …Y… Z… A2=… B2=… C2=… N15 X …Y… Z… A2=… B2=… C2=… Further information Behavior at outer corners A circle block with the radius of the cutter is always inserted at an outside corner.
Page 774
Work preparation 3.13 Tool offsets A circular block will be added between block N1 and N2 If an orientation change is required at outside corners, this can be performed either at the same time as interpolation or separately together with the path movement. When ORID is programmed, the inserted blocks are executed first without path motion.
Work preparation 3.13 Tool offsets 3.13.7 Free assignment of D numbers, cutting edge numbers 3.13.7.1 Free assignment of D numbers, cutting edge numbers (CE address) D number The D numbers can be used as offset numbers. The number of the cutting edge can also be addressed via the CE address.
Work preparation 3.13 Tool offsets GETDNO This command returns the D number of a particular cutting edge (ce) of a tool with tool number t. If no D number exists for the entered parameters, d=0 will be set. If the D number is invalid, a value greater than 32000 is returned.
Work preparation 3.13 Tool offsets Syntax <Status>=GETACTTD(<TNo>,<DNo>) Meaning Function call GETACTTD(): D number for which the T number shall be searched. <DNo>: Data type: T number found <TNo>: Data type: VAR INT Result <status>: Data type: Value: The T number was found. <Tno> contains the value of the T number.
Page 778
Work preparation 3.13 Tool offsets In addition, the following requirement is applicable to machines for which all possible orientations have to be settable: ● The tool longitudinal axis must be perpendicular to the first rotary axis V Function The toolholder kinematics with a maximum of two rotary axes v or v are defined using the 17 system variables $TC_CARR1[m] to $TC_CARR17[m].
Page 779
Work preparation 3.13 Tool offsets Function of the system variables for orientable toolholders α angle of rota‐ $TC_CARR13[m] tion $TC_CARR14[m] α angle of rota‐ tion offset vector $TC_CARR15[m] $TC_CARR16[m] $TC_CARR17[m] Extensions of the system variables for orientable toolholders Designation x component y component z component offset vector...
Page 780
Work preparation 3.13 Tool offsets Note Explanations of parameters "m" specifies the number of the toolholder to be programmed. $TC_CARR47 to $TC_CARR54 and $TC_CARR61 to $TC_CARR63 are not defined and produce an alarm if read or write access is attempted. The start/end points of the distance vectors on the axes can be freely selected.
Page 781
Work preparation 3.13 Tool offsets Example The toolholder used in the following example can be fully described by a rotation around the Y axis. Program code Comment N10 $TC_CARR8[1]=1 ; Definition of the Y component of the first rotary axis of toolholder N20 $TC_DP1[1,1] = 120 ;...
Page 782
Work preparation 3.13 Tool offsets Further information Resolved kinematics For machines with resolved kinematics (both the tool as well as the workpiece can be rotated), the system variables have been expanded by the entries $TC_CARR18[m] up to $TC_CARR23[m] and are described as follows: The rotatable tool table consisting of: ●...
Work preparation 3.13 Tool offsets 3.13.9 Tool length compensation for orientable toolholders (TCARR, TCOABS, TCOFR, TCOFRX, TCOFRY, TCOFRZ) When the spatial orientation of the tool changes, its tool length components also change. Z<< X<< After a reset, e.g. through manual setting or change of the toolholder with a fixed spatial orientation, the tool length components also have to be determined again.
Page 784
Work preparation 3.13 Tool offsets Further information Determine tool length offset from the orientation of the toolholder (TCOABS) TCOABS calculates the tool length offset from the current orientation angles of the toolholder; saved in the system variables $TC_CARR13 and $TC_CARR14. For a definition of toolholder kinematics with system variables, see "Toolholder kinematics (Page 777)".
Work preparation 3.13 Tool offsets the rotation angle values stored in the system variables must at least correspond approximately to the mechanically set rotation angles. Note Tool orientation It is not possible for the control to check whether the rotation angles calculated by means of the frame orientation are settable on the machine.
Page 786
Work preparation 3.13 Tool offsets Note The correction values written with the CORRTC function are not immediately effective in the tool carrier. The correction values only become active after deselecting the tool carrier, NEWCONF and selecting the tool carrier. Syntax <_Corr_Status>...
Page 787
Work preparation 3.13 Tool offsets Correction mode <_Corr_Mode>: Data type: The <Corr_Index> parameter is decimal coded (unit to thousands position): Unit Reserved position: Tens Specifies how the correction element to which the content of <_Corr_Index> position: refers, is to be modified. xx0x The correction vector is written immediately to the correction element.
Work preparation 3.13 Tool offsets The CORRTC function writes axis directions for machines with tool carriers in special correction elements. A kinematic chain is described, for example, with elements of the type OFFSET, which are defined via $ NK_TYPE. CORRTC works with sections The two subchains can each be divided into a maximum of four sections: ●...
Page 789
Work preparation 3.13 Tool offsets The three geometry axis identifiers are used as index <n>. Thus, the number of active direction offsets is determined by the geometry axes that are active at the same time. All offsets can be active at the same time. The online tool length offset function can be used for: ●...
Page 790
Work preparation 3.13 Tool offsets Program code Comment N5 DEF REAL XOFFSET N10 TRAORI(1) ; Transformation on. N20 TOFFON(Z) ; Activation of online tool length compensation for the Z tool direc- tion. N30 WHEN TRUE DO $AA_TOFF[Z]=10 G4 F5 ; A TLC of 10 is interpolated for the Z tool direction.
Work preparation 3.13 Tool offsets Variable $AA_TOFF_PREP_DIFF The dimension for the difference between the currently active compensation in the interpolator and the compensation that was active at the time of block preparation can be polled in the variable $AA_TOFF_PREP_DIFF[<n>]. Adjusting machine data and setting data The following system data is available for online tool length offset: ●...
Page 792
Work preparation 3.13 Tool offsets Note Order of the orientation axes If you run through the kinematic chain that describes the structure of the machine, from the workpiece to the tool, then the following specifications apply for the order of the three orientation axes of a 6-axis transformation: ●...
Page 793
Work preparation 3.13 Tool offsets Meaning Function call ORISOLH: Function return value <RetVal>: Data type: Range of val‐ 0, -2, -3, ..., -17 ues: Values: 0 Function has ended without an error. -2 No valid transformation (6-axis orientation transformation) is active.
Page 794
Work preparation 3.13 Tool offsets Controls the behavior of the function <Cntrl>: Data type: The <Cntrl> parameter is decimal coded (unit to thousands position): Unit position: The unit position controls the response to errors. xxx0 In the event of an error (return value < 0), alarm 14106 is output and program processing is aborted.
Page 795
Work preparation 3.13 Tool offsets If the angles <W1> and <W2> are selected arbitrarily, the cutting edge of the tool is generally not in the machining plane. The angle γ through which the cutting edge is rotated out of the machining plane, must not be greater than the limit value which is defined by the setting data SD42999 $SC_OR‐...
Page 796
Work preparation 3.13 Tool offsets Further information The number of solutions found together with further status information when executing the ORISOLH function, can be read via the following system variables: System variable Meaning $P_ORI_POS Returns the angles of the orientation axes that result from the orientation program‐ [<n>, <m>] ming.
Page 797
Work preparation 3.13 Tool offsets System variable Meaning $P_ORI_SOL If for an orientation transformation with more than one orientation axis, the axis angles are calculated that should result in a specified orientation, there is generally more than one solution. The $P_ORI_SOL system variables contain the number of valid solutions together with additional status information.
Page 798
Work preparation 3.13 Tool offsets System variable Meaning 1 There is a solution. There can be three different causes for this case: ● Based on the specified orientation and the machine kine‐ matics, there is only one solution (from the mathematical point of view, two coinciding solutions) even without con‐...
Page 799
Work preparation 3.13 Tool offsets System variable Meaning $P_ORI_STAT Returns the status for each of the maximum three orientation axes after ORISOLH [<n>] has been called. <n>: Index of the orientation axis (correspnds to the index of the relevant orientation axis in $NT_ROT_AX_NAME) Range of values: 0 ...
Work preparation 3.13 Tool offsets System variable Meaning sition). This information is also contained in the $P_ORI_SOL system variable. Of the error numbers that indicate a violation of the axis limits, several can occur simultaneously. When an axis limit is violated, an attempt is made to reach a position within the permissible axis limits by adding or subtracting multiples of 360°.
Page 801
Work preparation 3.13 Tool offsets Meaning Function call in combination with orientable tool carriers CUTMOD: Assigned value <Value>: Data type: Value: 0 The function is deactivated. The values supplied from system variables $P_AD... are the same as the corresponding tool parameters. >...
Page 802
Work preparation 3.13 Tool offsets Assigned Command <Command>: Data type: STRING Value: The states of an active transformation defined with kinematic "NEW" chains relevant for the "Modification of the offset data", the name of the transformation and the current contour frame are saved.
Page 803
Work preparation 3.13 Tool offsets The data is always modified with respect to the corresponding tool parameters ($TC_DP2[..., ...] etc.) when the "Modification of the offset data for rotatable tools" function was activated with the CUTMOD or CUTMODK command and the tool was rotated by an orientable tool carrier or a suitable orientation transformation.
Page 804
Work preparation 3.13 Tool offsets System variable Meaning $P_CUTMOD_ERR Error state after the last call of the CUTMOD function The CUTMOD function can also be called implicitly for a tool change. At a reset, the variable is reset to zero. It is reset at every tool change and, if required, rewritten.
Page 805
Work preparation 3.13 Tool offsets Effectiveness of the modified cutting data The modified cutting edge position and the modified cutting edge reference point are immediately effective when programming, even for a tool that is already active. A tool does not have to be re-selected for this purpose.
Work preparation 3.13 Tool offsets in which the TRC is active; the corresponding positions are therefore identical. The different cutting edge positions only become effective again in the deselect blocks N260 and/or N300. 3.13.13 Working with tool environments Overview of functions ●...
Page 808
Work preparation 3.13 Tool offsets ● Setting data: – SD42900 $SC_MIRROR_TOOL_LENGTH (sign change tool length when mirroring) – SD42910 $SC_MIRROR_TOOL_WEAR (sign change tool wear when mirroring) – SD42920 $SC_WEAR_SIGN_CUTPOS (sign of the tool wear with cutting edge systems) – SD42930 $SC_WEAR_SIGN (sign of wear) –...
Page 809
Work preparation 3.13 Tool offsets Function return value. Negative values indicate error states. <Status>: Data type: Value: Function OK No memory reserved for tool environments: MD18116 $MN_MM_NUM_TOOL_ENV = 0 This means that the "tool environments" functionality is not available. No more free memory locations for tool environments available. Null string illegal as name of a tool environment.
Work preparation 3.13 Tool offsets Maximum number of data sets for tool environments Machine data MD18116 $MN_MM_NUM_TOOL_ENV is used to define the maximum number of data sets that can be saved to describe the tool environments. The data are in the TOA area. They are kept even when the control system is switched off.
Work preparation 3.13 Tool offsets 3.13.13.3 Read T, D and DL number (GETTENV) The GETTENV function is used to read the T, D and DL numbers stored in a tool environment. Syntax <Status> = GETTENV(<name>, <TDDL>) Meaning Predefined function to read T, D and DL numbers in a data set to describe a tool GETTENV(...): environment Alone in the...
Work preparation 3.13 Tool offsets 3.13.13.4 Read information about the saved tool environments ($P_TOOLENVN, ($P_TOOLENV) Information regarding the saved tool environments can be read using the following system variables: Supplies the number of data sets (which have still not been deleted) – defined $P_TOOLENVN: using TOOLENV –...
Page 813
Work preparation 3.13 Tool offsets Function return value. Negative values indicate error states. <Status>: Data type: Value: Function OK No memory reserved for tool environments: MD18116 $MN_MM_NUM_TOOL_ENV = 0 This means that the "tool environments" functionality is not available. A tool environment with the name specified under <Stat> does not exist.
Page 814
Work preparation 3.13 Tool offsets Tool length components (optional) <Comp>: Data type: STRING The character string consists of two substrings, which are separated from one another by a colon. General form: "<SubStr_1> [: <SubStr_2]" The first substring designates the tool length components to be <SubStr_1>: taken into account when calculating the tool length.
Page 815
Work preparation 3.13 Tool offsets Internal T number of the tool (optional). <T>: Data type: If this parameter is not specified or if its value is "0", then the tool stored in <Stat> is used. If the value of this parameter is "-1", then the T number of the active tool is used. It is also possible to explicitly specify the number of the active tool.
Page 816
Work preparation 3.13 Tool offsets Additional information Adapter transformation/toolholder with orientation capability/kinematic transformation Any rotations and component exchanges initiated by the adapter transformation, toolholder with orientation capability and kinematic transformation, are part of the tool environment. They are thus always performed, even if the corresponding length component is not supposed to be included.
Page 817
Work preparation 3.13 Tool offsets Program code Comment N140 R4=_LEN[3] ; 7.5 (= 0.5 * 3.0 + 0.5 * 12.0) N150 R5=_LEN[4] ; 19.0 (= 5.0 + 14.0) N160 M30 Length components of the kinematic transformation and toolholder with orientation capability If a toolholder with orientation capability is taken account of during the tool length calculation, the following vectors are included in that calculation: Type...
Work preparation 3.13 Tool offsets 3.13.13.6 Change tool components (SETTCOR) The SETTCOR function is used to change tool components taking into account all general conditions that can be involved when evaluating the individual components. Note Regarding the terminology: If in the following, in conjunction with the tool length, tool components are involved, then the components considered from a vectorial perspective are meant, which make up the complete tool length (e.g.
Page 819
Work preparation 3.13 Tool offsets Function return value. Negative values indicate error states. <Status>: Data type: Value: Function OK No memory reserved for tool environments: MD18116 $MN_MM_NUM_TOOL_ENV = 0 This means that the "tool environments" functionality is not available. A tool environment with the name specified under <Stat> does not exist.
Page 820
Work preparation 3.13 Tool offsets Tool component(s) <Comp>: Data type: STRING The character string consists of two substrings, which are separated from one another by a colon. General form: "<SubStr_1> [: <SubStr_2]" The first substring must always be available, and can either <SubStr_1>: comprise one or two characters.
Page 821
Work preparation 3.13 Tool offsets Specifies the component(s) of the tool data sets that are to be described (optional). <CorComp>: Data type: Value: Offset value <CorVal>[0] refers to the geometry axis transferred in parameter <GeoAx> in the workpiece coordinate system – or in the tool coordinate system (also see a description of param‐...
Page 822
Work preparation 3.13 Tool offsets Specifies the type of write operation to be executed (optional). <CorMode>: Data type: Value: = <CorVal> 1new = Val + <CorVal> 1new 1old = <CorVal> 1new 2new = Val + Val + <CorVal> 1new 1old 2old 2new The notation Val...
Page 823
Work preparation 3.13 Tool offsets Name of the data set for describing a tool environment (optional) <Stat>: Data type: STRING If the value of this parameter is the null string (""), or is not specified, then the current status is used. The current tool is used if a tool is not specified. Internal T number of the tool (optional).
Page 824
Work preparation 3.13 Tool offsets Program code Comment N70 R1=SETTCOR(_CORVAL,"G",0,0,2) N80 T1 D1 X0 Y0 Z0 ; ==> MCS position X0.000 Y0.000 Z1.333 N90 M30 <CorComp> is "0", therefore, the coordinate value of the geometry component acting in the Z direction must be replaced by the offset value 0.333.
Page 825
Work preparation 3.13 Tool offsets Program code Comment N40 $TC_DP12[1,1]=1.0 ; wear L1 N50 _CORVAL[0]=0.333 N60 T1 D1 G17 G0 N70 R1=SETTCOR(_CORVAL,"GW",0,3,2) N80 T1 D1 X0 Y0 Z0 ; ==> MCS position X0.000 Y0.000 Z11.333 N90 M30 <CorComp> is "3", therefore, the wear value and compensation value are added to the geometry component and the wear component is deleted.
Page 826
Work preparation 3.13 Tool offsets G18 is active. Since <CorMode> = 3, the tool wear in the direction of the X axis of the WCS must become zero once N100 has been executed. The contents of the relevant tool parameters at the end of the program are thus: $TC_DP3[1,1]: 21.830 ;...
Page 827
Work preparation 3.13 Tool offsets The same result as that achieved by calling the SETTCOR function with the <CorComp> = 0 parameter twice can also be reached by calling <CorComp> = 1 (vectorial compensation) just once: Program code Comment N10 DEF REAL _CORVAL[3] N20 $TC_DP1[1,1]=500 ;...
Page 829
Work preparation 3.13 Tool offsets However, since the wear is evaluated negatively, due to setting data SD42930 $SC_WEAR_SIGN, the compensation determined in this way has to be entered in the compensation memory with a negative sign. The contents of the relevant tool parameters at the end of the program are thus: $TC_DP3[1,1]: 10.000 ;...
Page 831
Work preparation 3.13 Tool offsets Function return value. Negative values indicate error states. <Status>: Data type: Value: Function OK Information provided in <AxInd> is sufficient for the descrip‐ tion (all tool length components are in parallel to the geom‐ etry axes). Function is OK, however, the content of <Matrix>...
Page 832
Work preparation 3.13 Tool offsets coordinate system applicable for the assignment (optional) <Coord>: Data type: STRING Charac‐ The tool length is represented in the machine coordinate ters: system. The tool length is represented in the basic coordinate system. The tool length is represented in the workpiece coordinate system (default setting).
Page 833
Work preparation 3.13 Tool offsets ROT Z60 The direction of the applicate (Z direction) remains unchanged; the main component of L2 now lies in the direction of the new X axis; the main component of L1 now lies in the direction of the negative Y axis.
Work preparation 3.14 Path traversing behavior 3.14 Path traversing behavior 3.14.1 Feedrate characteristic (FNORM, FLIN, FCUB, FPO) To permit flexible definition of the feedrate characteristic, the feedrate programming according to DIN 66025 has been extended by linear and cubic characteristics. The cubic characteristics can be programmed either directly or as interpolating splines.
Page 835
Work preparation 3.14 Path traversing behavior Example: Various feed profiles This example shows you the programming and graphic representation of various feed profiles. Feed 5000 4000 3000 2000 1000 Path Program code Comment N1 F1000 FNORM G1 X8 G91 G64 ;...
Page 836
Work preparation 3.14 Path traversing behavior Feed Path FLIN The feedrate characteristic is approached linearly from the current feedrate value to the programmed F value until the end of the block. Example: N30 F1400 FLIN X50 Feed Path FCUB The feedrate is approached according to a cubic characteristic from the current feedrate value to the programmed F value until the end of the block.
Page 837
Work preparation 3.14 Path traversing behavior feedrate values programmed non-modally that have an active FCUB. The feedrate values act here as interpolation points for calculation of the spline interpolation. Example: N50 F1400 FCUB X50 N60 F2000 X47 N70 F3800 X52 Feed Path F=FPO(…,…,…)
Page 838
Work preparation 3.14 Path traversing behavior Feed Path Boundary conditions ● The functions for programming the path traversing characteristics apply regardless of the programmed feedrate characteristic. ● The programmed feedrate characteristic is always absolute regardless of G90 or G91. ● The feed characteristics FLIN and FCUB are active with G93 and G94, however, not with G95, G96/G961 and G97/G971.
Work preparation 3.14 Path traversing behavior 3.14.2 Acceleration behavior 3.14.2.1 Acceleration mode (BRISK, BRISKA, SOFT, SOFTA, DRIVE, DRIVEA) The following part program commands are available for programming the current acceleration mode: ● "BRISK, BRISKA" The single axes or the path axes traverse with maximum acceleration until the programmed feedrate is reached (acceleration without jerk limitation).
Page 840
Work preparation 3.14 Path traversing behavior Figure 3-13 Path velocity curve with DRIVE Syntax BRISK BRISKA(<axis1>,<axis2>,…) SOFT SOFTA(<axis1>,<axis2>,…) DRIVE DRIVEA(<axis1>,<axis2>,…) Meaning Command for activating the "acceleration without jerk limitation" BRISK: for the path axes. Command for activating the "acceleration without jerk limitation" BRISKA: for single axis movements (JOG, JOG/INC, positioning axis, os‐...
Work preparation 3.14 Path traversing behavior Example 2: DRIVE and DRIVEA Program code N05 DRIVE N10 G1 X… Y… F1000 N20 DRIVEA (AX4, AX6) 3.14.2.2 Influence of acceleration on following axes (VELOLIMA, ACCLIMA, JERKLIMA) For axis couplings (Page 891) (tangential correction, coupled motion, master value coupling, electronic gear), the following axes/spindles are traversed depending on one or several master axes/spindles.
Work preparation 3.14 Path traversing behavior Program code Comment Example 2: Electronic gear Axis 4 is coupled to axis X via an "electronic gear" coupling. The acceleration capacity of the following axis is limited to 70% of the maximum acceleration. The maximum permissible velocity is limited to 50% of the maximum velocity.
Page 843
Work preparation 3.14 Path traversing behavior Note The dynamic values are already active in the block in which the associated G command is programmed. Machining is not stopped. Read or write a specific field element: R<m>=$MA...[n,X] $MA...[n,X]=<value> Meaning Activate normal dynamic response DYNNORM: Activate dynamic response for positioning mode, tapping DYNPOS:...
Work preparation 3.14 Path traversing behavior Example 2: Read or write a specific field element Maximum acceleration for roughing, axis X Program code Comment R1=$MA_MAX_AX_ACCEL[2,X] ; reading $MA_MAX_AX_ACCEL[2,X]=5 ; writing 3.14.3 Traversing with feedforward control (FFWON, FFWOF) The feedforward control reduces the velocity-dependent overtravel when contouring towards zero.
Page 845
Work preparation 3.14 Path traversing behavior specifications) either via the setting data $SC_CONTPREC or via the programmed contour tolerance CTOL. The smaller the value and the smaller the K factor of the geometry axes, the greater the path feedrate is reduced on curved contours. The "Programmable contour accuracy"...
Work preparation 3.14 Path traversing behavior Program code Comment N100 CPRECOF ; Deactivate the "programmable contour accuracy". N110 G0 ... See also Programming contour/orientation tolerance (CTOL, OTOL, ATOL) (Page 864) 3.14.5 Program sequence with preprocessing memory (STOPFIFO, STARTFIFO, FIFOCTRL, STOPRE) Depending on its expansion level, the control system has a certain quantity of so-called preprocessing memory in which prepared blocks are stored prior to program execution and then output as high-speed block sequences while machining is in progress.
Page 847
Work preparation 3.14 Path traversing behavior once the fill level reaches 2/3 in order to prevent complete emptying and deceleration to standstill. Preprocessing stop Programming the "STOPRE" command in a block will stop block preprocessing and buffering. The following block is not executed until all preprocessed and saved blocks have been executed in full.
Work preparation 3.14 Path traversing behavior Meaning "STOPFIFO" identifies the start of a machining step to be buffered in the prepro‐ STOPFIFO: cessing memory. "STOPFIFO" stops processing and fills the preprocessing mem‐ ory until: ● "STARTFIFO" or "STOPRE" is recognized ●...
Page 849
Work preparation 3.14 Path traversing behavior Syntax DELAYFSTON DELAYFSTOF Meaning Defining the start of a stop delay range DELAYFSTON: Alone in the block: Yes Define the end of the stop delay area DELAYFSTOF: Alone in the block: Yes Programming example The following program block is repeated in a loop: Program code N99 MY_LOOP:...
Work preparation 3.14 Path traversing behavior Additional information End of subprogram DELAYFSTOF is activated implicitly at the end of the subprogram in which DELAYFSTON is called. Nesting If subprogram 1 calls subprogram 2 in a stop delay area, the whole of subprogram 2 is a stop delay area.
Page 851
Work preparation 3.14 Path traversing behavior It is also possible to define untraceable sections in part program sections that the NC cannot yet re-enter. When the program is interrupted, the NC notes the last block that was processed that can then be searched for via the HMI user interface. Syntax IPTRLOCK IPTRUNLOCK...
Work preparation 3.14 Path traversing behavior Command "IPTRLOCK" freezes the interruption pointer at a single block executable in the main run (SB1). This block will be referred to as the hold block below. If the program is aborted after "IPTRLOCK", this hold block can be searched for from the HMI user interface. Continuing from the current block The interruption pointer is placed on the current block with "IPTRUNLOCK"...
Page 854
Work preparation 3.14 Path traversing behavior REPOSQA DISR=… : Repositioning to the contour with the geometry axes along a quadrant of radius DISR. All other channel axes are also repositioned. REPOSH DISR=… : Repositioning to the contour with the geometry axes along a semicircle of diameter DISR.
Page 855
Work preparation 3.14 Path traversing behavior Interruption point REPOSL Block start point Repositioning to the contour along a quadrant, REPOSQ, REPOSQA The tool approaches the repositioning point along a quadrant with a radius of DISR=…. The control automatically calculates the necessary intermediate point between the start and repositioning point.
Page 856
Work preparation 3.14 Path traversing behavior Repositioning to the contour along a semicircle, REPOSH, REPOSHA The tool approaches the repositioning point along a semi-circle with a diameter of DISR=…. The control automatically calculates the necessary intermediate point between the start and repositioning point.
Page 857
Work preparation 3.14 Path traversing behavior RMIBL DISPR=… or RME DISPR=… allows you to select a repositioning point which lies before the interruption point or the block end point. DISPR=… allows you to describe the contour distance in mm/inch between the repositioning point and the interruption before the end point.
Page 858
Work preparation 3.14 Path traversing behavior SERUPRO approach with RMNBL If an abort is forced during machining at any position, the shortest path from the abort point is approached with SERUPRO approach and RMNBL so that afterward only the distance-to-go is processed.
Page 859
Work preparation 3.14 Path traversing behavior Approach from the nearest path point RMNBL When REPOSA is interpreted, the repositioning block with RMNBL is not started again in full after an interruption, but only the distance-to-go processed. The nearest path point of the interrupted block is approached.
Page 860
Work preparation 3.14 Path traversing behavior Approach contour The motion with which the tool is repositioned on the contour can be programmed. Enter zero for the addresses of the axes to be traversed. The REPOSA, REPOSQA and REPOSHA commands automatically reposition all axes. Individual axis names need not be specified.
Work preparation 3.14 Path traversing behavior In the following cases, there is an automatic switchover to linear approach REPOSL: ● You have not specified a value for DISR. ● No defined approach direction is available (program interruption in a block without travel information).
Work preparation 3.14 Path traversing behavior Meaning Adapting the jerk limit value JERKLIM: Machine axis whose jerk limit value is to be adapted <Ax>: Percentage correction value <Value>: The correction value refers to the configured maximum axis jerk for path motion (MD32431 $MA_MAX_AX_JERK).
Page 863
Work preparation 3.14 Path traversing behavior Syntax VELOLIM[<Ax>]=<Value> Meaning Adapting the velocity or speed limit value VELOLIM: Axis or spindle whose velocity or speed limit value should be adapted. <Ax>: Using MD30455 $MA_MISC_FUNCTION_MASK, bit 6, it can be set as to whether VELOLIM is effective independent of whether used as spindle or axis (bit 6 = 1) - or is able to be programmed separately for each operating mode (bit 6 = 0).
Work preparation 3.14 Path traversing behavior Program code Comment Example 2: Speed limiting, spindle 1 (AX5) Configuring: ● MD35130 $MA_GEAR_STEP_MAX_VELO_LIMIT[ 1, AX5 ] = 1000 (Maximum speed of gear unit stage 1 = 1000 rpm) ● MD30455 $MA_MISC_FUNCTION_MASK[ AX5 ], bit 6 = 1 (Programming VELOLIM acts together for spindle and axis operation independent of the programmed identifier) Programming:...
Page 865
Work preparation 3.14 Path traversing behavior Meaning Address to program the contour tolerance CTOL: Applications: ● All compressor functions ● All rounding types except G641 and G644 Preprocessing stop: Effective: Modal The value for the contour tolerance is specified as a length. <Value>: Type: REAL...
Page 866
Work preparation 3.14 Path traversing behavior Address for programming an axis-specific tolerance ATOL: Applications: ● All compressor functions ● ORISON orientation smoothing ● All smoothing types except G641, G644 and OSD Preprocessing stop: Effective: Modal Name of the channel axis to which the programmed tolerance will <Axis>: apply The value for the axis tolerance will be specified as a length or an...
Page 867
Work preparation 3.14 Path traversing behavior Program code Comment X... Y... Z... X... Y... Z... X... Y... Z... CTOL=–1 ; The machine and setting data is applied again starting from here. X... Y... Z... X... Y... Z... X... Y... Z... System variables Reading with preprocessing stop Using the following system variables, the currently active tolerances can be read in the part...
Work preparation 3.14 Path traversing behavior Reading without preprocessing stop Using the following system variables, the currently active tolerances can be read in the part program: ● $P_CTOL Currently active channel-specific contour tolerance. ● $P_OTOL Currently active channel-specific orientation tolerance. ●...
Page 869
Work preparation 3.14 Path traversing behavior Meaning Block change criterion with active coupling CPBC: Axis identifier of the following axis <following axis>: Block change criterion <criterion>: Type: STRING Value Meaning: Block change is performed "NOC" Irrespective of the coupling status "IPOSTOP"...
Work preparation 3.15 Axis functions 3.15 Axis functions 3.15.1 Axis replacement, spindle replacement (RELEASE, GET, GETD) One or more axes or spindles can only ever be interpolated in one channel. If an axis has to alternate between two different channels (e.g. pallet changer) it must first be enabled in the current channel and then transferred to the other channel.
Page 871
Work preparation 3.15 Axis functions If, following a GET request without preprocessing stop, the axis is enabled again with RELEASE(axis) or WAITP(axis), a subsequent GET will induce a GET with preprocessing stop. CAUTION Axis assignment changed An axis or spindle accepted with GET remains assigned to this channel even after a key or program RESET.
Page 872
Work preparation 3.15 Axis functions Example 2: Axis exchange without synchronization If the axis does not have to be synchronized no preprocessing stop is generated by GET. Programming Comment N01 G0 X0 N02 RELEASE(AX5) N03 G64 X10 N04 X20 N05 GET(AX5) ;...
Page 873
Work preparation 3.15 Axis functions Description Release axis: RELEASE When enabling the axis please note: 1. The axis must not be involved in a transformation. 2. All the axes involved in an axis link (tangential control) must be enabled. 3. A concurrent positioning axis cannot be replaced in this situation. 4.
Work preparation 3.15 Axis functions ● When an intermediate block is inserted in the main run, a check will be made to determine whether or not reorganization is required. Reorganization is only necessary if the axis states of this block do not match the current axis states. ●...
Work preparation 3.15 Axis functions Program code Comment N121 M0 N130 AXTOCHAN(Y,2,X,2) ;Move Y axis and X axis to the second channel (axes are neutral). N131 M0 N140 AXTOCHAN(Y,2) ; Move Y axis to the second channel (NC program). N141 M0 Further information AXTOCHAN in the NC program A GET is only executed in the event of the axis being requested for the NC program in the same...
Page 876
Work preparation 3.15 Axis functions AXTOSPI(A) or AXTOSPI(B) or AXTOSPI(C) AXSTRING( SPI(n) ) ISAXIS(<geometry axis number>) <Modulo position>=MODAXVAL(<axis>,<axis position>) Meaning Converts an input string into axis identifiers; the input string must contain a valid AXNAME: axis name. Variable axis identifier Converts the spindle number into an axis identifier;...
Work preparation 3.15 Axis functions Example 2: AXSTRING When programming with AXSTRING[SPI(n)], the axis index of the axis, which is assigned to the spindle, is no longer output as spindle number, but instead the string "Sn" is output. Program code Comment AXSTRING[SPI(2)] ;...
Page 878
Work preparation 3.15 Axis functions Meaning Function for switching geometry axes. GEOAX(...) Note: GEOAX() without parameter specification activates the basic configuration of the geometry axes parameterized in the machine data again. Number of the geometry axis that is to be replaced by the specified channel axis. <n>...
Page 879
Work preparation 3.15 Axis functions Program code Comment N110 G1 ... N120 GEOAX(3,Z1) ; Channel axis Z1 acts as 3rd geometry axis (Z). Example 2: Changing over the geometry axes for six channel axes A machine has six channel axes with the names XX, YY, ZZ, U, V, W. The basic setting of the geometry axis configuration via machine data is: Channel axis XX = 1st geometry axis (X axis) Channel axis YY = 2nd geometry axis (Y axis)
Page 880
Work preparation 3.15 Axis functions Machine data Axis configuration Assignment of geometry, special and machine axes to channel axes: ● MD10000 $MN_AXCONF_MACHAX_NAME_TAB ● MD20050 $MC_AXCONF_GEOAX_ASIGN_TAB ● MD20060 $MC_AXCONF_GEOAX_NAME_TAB ● MD20070 $MC_AXCONF_MACHAX_USED ● MD20080 $MC_AXCONF_CHANAX_NAME_TAB ● MD35000 $MA_SPIND_ASSIGN_TO_MACHAX Reset behavior Reset behavior of changed geometry axis assignments: ●...
Page 881
Work preparation 3.15 Axis functions Axis state after replacing An axis replaced by the changeover in the geometry axis group can be programmed as supplementary axis after the changeover operation via its channel axis names. Frames, protection areas, working area limits All frames, protection areas and working area limits are deleted after changing over the geometry axes.
Work preparation 3.15 Axis functions JOG mode, REF machine function When switching over to the JOG mode, REF machine function (reference point approach), the geometry axis configuration parameterized in the machine data takes effect 3.15.5 Axis container (AXCTSWE, AXCTSWED, AXCTSWEC) The "AXCTSWE"...
Work preparation 3.15 Axis functions Note Increment The increment of a axis container rotation is set via the setting data: SD41700 $SN_AXCT_SWWIDTH Further information Diagnostics The current status of a axis container can be read via the following system variables: System variable Type Description...
Page 884
Work preparation 3.15 Axis functions An interruption can take place in the wait state, e.g. by starting an ASUB or by changing the operating mode to JOG. When the program is continued, where relevant, the wait state is resumed. Note In the user interface, the wait state is displayed using the hold state "Wait for measuring system".
Work preparation 3.15 Axis functions 3.15.7 Programmable parameter set changeover (SCPARA) The changeover to a specific parameter set can be requested for an axis using the SCPARA command. Note No parameter set changeover during thread cutting During thread cutting G33 and tapping G331/G332, the parameter set is selected by the control and cannot be changed.
Work preparation 3.15 Axis functions Read parameter set number The number of the selected parameter set (specified parameter set) can be read via the system variable $AA_SCPAR. 3.15.8 Activate/deactivate adaptation (CADAPTON, CADAPTOF) Using the predefined CADAPTON() and CADAPTOF() procedures, predefined adaptations for adjusting the dynamic response or control parameters can be activated, updated and deactivated from the part program.
Page 887
Work preparation 3.15 Axis functions Input variable of the adaptation relationship <InVar>: Data type: Value: Inertia of the axis Axis position: Axis speed Input value of the adaptation relationship <InVal>: Optional parameter for intelligent load adjustment (<InVar>=1). Data type: REAL Value: >...
Work preparation 3.15 Axis functions Block search ● Block search without calculation CADAPTON/CADAPTOF instructions that are programmed between the beginning of the program and target block are ignored. Users must select the search target so that the adaptations relevant for the machining section are selected. ●...
Page 889
Work preparation 3.15 Axis functions Requirements ● Option "Top Speed" is set. Note To achieve optimum results with "Top Speed", it is recommended that option "Top Surface" is also used. ● The following conditions must be satisfied for axes in the interpolation group: –...
Page 890
Work preparation 3.15 Axis functions Boundary conditions Use in synchronized actions CALCFIR cannot be programmed in synchronized actions. NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Work preparation 3.16 Axis couplings 3.16 Axis couplings 3.16.1 Coupled motion (TRAILON, TRAILOF) When a defined leading axis is moved, the coupled motion axes (= following axes) assigned to it traverse through the distances described by the leading axis, allowing for a coupling factor. Together, the leading axis and following axis represent coupled axes.
Page 892
Work preparation 3.16 Axis couplings Parameter 3: Coupling factor <coupling factor>: The coupling factor specifies the desired relationship between the paths of the coupled-motion axis and the leading axis: <coupling factor> = path of coupled-motion axis/path of leading axis Type: REAL Default: The input of a negative value causes the master and coupled axes to tra‐...
Page 893
Work preparation 3.16 Axis couplings Example The workpiece is to be machined on two sides with the axis configuration shown in the diagram. To do this, you create two combinations of coupled axes. Axis Axis Axis Axis Axis Program code Comment …...
Page 894
Work preparation 3.16 Axis couplings Dynamics limit The dynamics limit is dependent on the type of activation of the coupled axis grouping: ● Activation in part program If activation is performed in the part program and all leading axes are active as program axes in the activated channel, the dynamic response of all coupled-motion axes is taken into account during traversing of the leading axis to avoid overloading the coupled-motion axes.
Work preparation 3.16 Axis couplings Program code Comment G91 B360 ; B=360, C=360 G91 B720 ; B=720, C=1080 G91 B360 ; B=360, C=1440 3.16.2 Curve tables (CTAB) Curve tables can be used to program position and velocity relationships between two axes (leading and following axis).
Page 896
Work preparation 3.16 Axis couplings Requirement The MD must be configured accordingly to ensure that sufficient memory space is reserved for the definition of curve tables (→ machine manufacturer). Syntax CTABDEF(<following axis>,<leading axis>,<n>,<periodicity>[,<memory location>]) CTABEND Meaning Start of curve table definition CTABDEF( ): End of curve table definition CTABEND:...
Page 897
Work preparation 3.16 Axis couplings Specification of memory location (optional) <memory location>: The curve table is created in the static NC memory. "SRAM" The curve table is created in the dynamic NC memory. "DRAM" Note: If a value is not programmed for this parameter, the default memory location set with MD20905 $MC_CTAB_DEFAULT_MEMORY_TYPE is used.
Page 898
Work preparation 3.16 Axis couplings Example 2: Definition of a non-periodic curve table 5 20 Program code Comment N100 CTABDEF(Y,X,3,0) ; Beginning of the definition of a ;non-periodic curve table with number 3. N110 X0 Y0 ; 1st motion operation, defines the starting values and 1st intermediate point: Master value: 0, Following value: 0 N120 X20 Y0...
Page 899
Work preparation 3.16 Axis couplings Program code Comment N20 DEF REAL GRADIENT N30 CTABDEF(Y,X,2,1) ; Start of definition. N40 G1 X=0 Y=0 N50 POLY N60 PO[X]=(45.0) N70 PO[X]=(90.0) PO[Y]=(45.0,135.0,-90) N80 PO[X]=(270.0) N90 PO[X]=(315.0) PO[Y]=(0.0,-135.0,90) N100 PO[X]=(360.0) N110 CTABEND ; End of the definition. ;Test of the curve by coupling Y to X: N120 G1 F1000 X0 N130 LEADON(Y,X,2)
Page 900
Work preparation 3.16 Axis couplings Available language scope Within the definition of the curve table, you have use of the entire NC language. Note The following entries are not permitted in curve table definitions: ● Preprocessing stop ● Jumps in the leading axis movement (e.g. on changing transformations) ●...
Work preparation 3.16 Axis couplings Program code X10 Y40 CTABEND Repeated use of curve tables The functional relationship between the leading axis and the following axis calculated using the curve table will be retained under the selected table number after the end of the part program and POWER OFF if the table has been saved to the static NC memory (SRAM).
Work preparation 3.16 Axis couplings Syntax CTABEXISTS(<n>) Meaning Checks for the presence of curve table number <n> in the static or dynamic NC CTABEXISTS: memory. Table does not exist Table exists Number (ID) of curve table <n>: 3.16.2.3 Delete curve tables (CTABDEL) CTABDEL can be used to delete curve tables.
Work preparation 3.16 Axis couplings If CTABDEL is programmed without specification of the curve table to be deleted, then all curve tables or all curve tables in the specified memory will be deleted: Deletes all curve tables in the static and the dynamic NC memory CTABDEL(): Deletes all curve tables in the static NC memory CTABDEL(,,"SRAM"):...
Work preparation 3.16 Axis couplings When a curve table range CTABLOCK(<n>,<m>)/CTABUNLOCK(<n>,<m>) <m>: is locked/unlocked, <m> is used to specify the number of the last curve table in the range. <m> has to be greater than <n>. Specification of memory location (optional) <memory location>: In the case of locking/unlocking without a memory location being specified, the...
Work preparation 3.16 Axis couplings Meaning Returns the table number entered as the <p>th curve table in the specified CTABID: memory. Example: CTABID(1,"SRAM") returns the number of the first curve table in the static NC memory. In this context the first curve table is the curve table with the highest table number.
Page 906
Work preparation 3.16 Axis couplings ● Leading axis value for a following axis value ● Following axis minimum and maximum values – In the entire definition range of the curve table – In a defined curve table interval Syntax CTABTSV(<n>,<gradient>[,<following axis>]) CTABTEV(<n>,<gradient>[,<following axis>]) CTABTSP(<n>,<gradient>[,<leading axis>]) CTABTEP(<n>,<gradient>[,<leading axis>])
Page 907
Work preparation 3.16 Axis couplings Axis whose motion is to be calculated using the curve table (optional) <following axis>: Axis providing the master values for the calculation of the following axis <leasing axis>: motion (optional) Following axis value for reading the associated leading axis value <following value>: for CTABINV Leading axis value:...
Page 908
Work preparation 3.16 Axis couplings Program code Comment N220 STARTPARA=CTABTSP(1,GRADIENT) ; Master axis value at start of curve table = N230 ENDPARA=CTABTEP(1,GRADIENT) ; Master axis value at end of curve table = 80 N240 MINVAL=CTABTMIN(1) ; Minimum value of following axis with Y=5 N250 MAXVAL=CTABTMAX(1) ;...
Page 909
Work preparation 3.16 Axis couplings Slave value Master Definition range value CTAB with periodic curve tables If the specified <master value> is outside the definition range, the master value is evaluated modulo of the definition range and the corresponding following value is output: Slave value Master value...
Work preparation 3.16 Axis couplings Incline of the curve table function The output of the gradient (<gradient>) makes it possible to calculate the velocity of the leading or following axis at the corresponding position. Specification of the leading or following axis The optional specification of the leading and/or following axis is important if the leading and following axes are configured in different length units.
Work preparation 3.16 Axis couplings Determine the number of curve segments of the specified <segment CTABSEG: type> used in the specified <memory location> Determine the number of curve segments of the specified <segment CTABFSEG: type> remaining possible in the specified <memory location> Determine the maximum possible number of curve segments of the speci‐...
Page 912
Work preparation 3.16 Axis couplings The leading axis is the axis which supplies the input values for the curve table. The following axis is the axis, which takes the positions calculated by means of the curve table. Actual value and setpoint coupling The following can be used as the master value, i.e.
Page 913
Work preparation 3.16 Axis couplings Curve table number <n>: Switching between setpoint and actual value coupling $SA_LEAD_TYPE: Deactivate master value coupling, LEADOF When you deactivate the master value coupling, the following axis becomes a normal command axis again! Axial master value coupling and different operating states, RESET Depending on the setting in the machine data, the master value couplings are deactivated with RESET.
Page 914
Work preparation 3.16 Axis couplings Fast digital inputs, real-time variables $AC_MARKER and position comparisons are linked using the Boolean operator AND for evaluation as conditions. Note In the following example, line change, indentation and bold type are used for the sole purpose of improving readability of the program.
Page 915
Work preparation 3.16 Axis couplings setpoint speed of the following axis (calculated from master spindle and using the CTAB curve table). Following axis position No synchronism If the following axis position calculated moves away from the current following axis position when the master value coupling is activated, it is not possible to establish synchronization.
Page 916
Work preparation 3.16 Axis couplings NCU 1 NCU 2 Actual value coupling A switchover can be programmed via setting data $SA_LEAD_TYPE. You must always switch between the actual-value and setpoint coupling when the following axis stops. It is only possible to resynchronize after switchover when the axis is motionless. Application example You cannot read the actual values without error during large machine vibrations.
Work preparation 3.16 Axis couplings i flag number n status value 3.16.4 Electronic gear (EG) The "Electronic gear" function allows you to control the movement of a following axis according to linear traversing block as a function of up to five leading axes. The relationship between each leading axis and the following axis is defined by the coupling factor.
Work preparation 3.16 Axis couplings Meaning Definition of an electronic gear EGDEF: Axis that is influenced by the leading axes Following axis: Axes that influence the following axis Leading axis1 ,..., Leading axis5 Coupling type Coupling type1 ,..., The coupling type does not need to be the same for all leading axes and Coupling type5 must be programmed separately for each individual master.
Page 919
Work preparation 3.16 Axis couplings Variant 3: The EG axis group is selectively switched-in with synchronization and the approach mode specified with: EGONSYNE(FA,"block change mode",SynPosFA,approach mode[,LAi,SynPosLAi,Zi,Ni]) Meaning Variant 1: Following axis The following modes can be used: Block change mode: Block change takes place immediately "NOC"...
Page 920
Work preparation 3.16 Axis couplings synchronous . If the electronic gear is not in the synchronized state grouping is interpreted as when the grouping is switched on, the following axis traverses to its defined synchronized position. Variant 3: The parameters correspond to those of variant 2 plus: The following modes can be used: Approach mode: Approach next tooth gap time-optimized...
Work preparation 3.16 Axis couplings Curve tables If a curve table is used for one of the leading axes: The denominator of the coupling factor for linear coupling must be set to 0. (De‐ nominator 0 would be illegal for linear couplings.) Denominator zero tells the control that is the number of the curve table to use.
Work preparation 3.16 Axis couplings Variant 2: Syntax Meaning This command parameter setting made it EGOFS(following axis,leading axis1, possible to selectively remove the influence …,leading axis5) of the individual leading axes on the following axis' motion. At least one leading axis must be specified. The influence of the specified leading axes on the slave is selectively inhibited.
Work preparation 3.16 Axis couplings 3.16.5 Synchronous spindle Synchronous operation involves a following spindle (FS) and a leading spindle (LS), referred to as the synchronous spindle pair. The following spindle imitates the movements of the leading spindle when a coupling is active (synchronous operation) in accordance with the defined functional interrelationship.
Page 924
Work preparation 3.16 Axis couplings Application examples: ● Flying workpiece transfer, e.g. to machine the rear side, transformation ratio: 1:1 ① Synchronize the speed ② Transfer the workpiece ③ Machine the rear side ● Multi-edge machining (polygonal turning), speed synchronism, transformation ratio: n Syntax COUPDEF(<FS>,<LS>,<ZFS>,<NLS>,<block change>,<coupling type>) COUPON(<FS>,<LS>,<POSFS>)
Page 925
Work preparation 3.16 Axis couplings Note Abbreviated notation A shorter notation without specification of the leading spindle is possible for the COUPOF, COUPOFS, COUPRES and COUPDEL statements. Meaning Define/change coupling on user-specific basis COUPDEF: Activate coupling. The following spindle synchronizes to the leading spindle COUPON: based on the actual speed Coupling when activating with previous programming of M3 S...
Page 926
Work preparation 3.16 Axis couplings Block change behavior <block change>: The block change is: Immediately "NOC" On reaching "Synchronism fine" "FINE" On reaching "Synchronism coarse" "COARSE" On reaching IPOSTOP; in other words, after setpoint- "IPOSTOP" based synchronism (default) The block change behavior is effective modally. Coupling type: Coupling between FS and LS <coupling type>: Setpoint linkage (default)
Page 927
Work preparation 3.16 Axis couplings Program code Comment N215 SPOS[2]=IC(180) Traverse with 180 degrees overlay in the posi- tive direction. N220 G4 S50 Dwell time = 50 revolutions of the master spindle N225 FA[S2]=0 Activate configured velocity (MD). N230 SPOS[2]=IC(-7200) 20 revolutions.
Page 928
Work preparation 3.16 Axis couplings 2. Activate coupling during previous programming of following spindle with COUPONC Program code Comment Leading spindle = master spindle = spindle 1 Following spindle = spindle 2 N05 M3 S100 M2=3 S2=200 Leading spindle rotates at 100 rpm, following spindle at 200 rpm.
Page 929
Work preparation 3.16 Axis couplings Further information Configured coupling For the configured coupling, the LS and FS are defined via machine data. The configured spindles cannot be changed in the part program. The coupling can be parameterized in the part program using COUPDEF (on condition that no write protection is valid).
Page 930
Work preparation 3.16 Axis couplings Note The transformation ratio can also be changed on-the-fly (when the coupling is active and the spindles are rotating). Block change behavior NOC, FINE, COARSE, IPOSTOP The following abbreviated notation can be used when programming the block change behavior: ●...
Page 931
Work preparation 3.16 Axis couplings Differential speed A speed difference results in speed control mode and active synchronous spindle coupling through signed overlay of an FS speed because of LS movement and an FS speed because of spindle programming: ● Synchronous spindle coupling with COUPONC ●...
Page 932
Work preparation 3.16 Axis couplings Examples ● Wait for synchronism condition FINE to be fulfilled for following spindle S2 and COARSE to be fulfilled for following spindle S4: WAITC(S2,"FINE",S4,"COARSE") ● Wait for synchronism condition according to COUPDEF to be fulfilled: WAITC( ) Deactivate coupling COUPOF COUPOF can be used to define the turn-off behavior of the coupling: ●...
Work preparation 3.16 Axis couplings <value> Meaning No coupling active Synchronous spindle coupling active Note ● All other values refer to axis mode ● If the spindle is a following spindle or several couplings, then the value of the coupling state of all couplings is returned as a total state.
Page 934
Work preparation 3.16 Axis couplings Note Previous coupling calls for coupled motion (TRAIL*), Master value coupling (LEAD*), Electronic Gearbox (EG*) and Synchronous spindle (COUP*) are supported via adaptive cycles. Overview of all keywords and coupling characteristics The following table gives an overview of all keywords of the generic coupling and the programmable coupling characteristics: Keyword Coupling characteristics / mean‐...
Page 935
Work preparation 3.16 Axis couplings Keyword Coupling characteristics / mean‐ Syntax Block change criterion CPBC CPBC[FAx]="<block change criterion>" Block change is performed "<block change "NOC" irrespective of the coupling criterion>": status. Block change is performed "IPOSTOP" with setpoint synchronism. Block change is performed "COARSE"...
Page 936
Work preparation 3.16 Axis couplings Keyword Coupling characteristics / mean‐ Syntax Synchronization mode CPFMSON CPFMSON[FAx]="<synchronization mode>" The coupling is closed time- "<synchronization "CFAST" optimized. mode>": The coupling is only closed "CCOARSE" when the following axis po‐ sition, required according to the coupling rule, is in the range of the current follow‐...
Page 937
Work preparation 3.16 Axis couplings Keyword Coupling characteristics / mean‐ Syntax Behavior of the following axis CPFMON CPFMON[FAx]= "<switch-on behavior>" when switching on For spindles only! "<switch-on "STOP" behavior>": An active motion of the fol‐ lowing spindle is stopped before switch-on. For spindles and main tra‐...
Page 938
Work preparation 3.16 Axis couplings Keyword Coupling characteristics / mean‐ Syntax Coupling behavior for RESET CPMRESET CPMRESET[FAx]="<Reset behavior>" The current state of the cou‐ "<reset "NONE" pling is retained. behavior>": When the appropriate cou‐ "ON" pling module is created, the coupling is switched on.
Page 939
Work preparation 3.16 Axis couplings Keyword Coupling characteristics / mean‐ Syntax Coupling behavior at part pro‐ CPMSTART CPMSTART[FAx]="<start behavior>" gram start The current state of the cou‐ "<start "NONE" pling is retained. behavior>": Coupling switched-on. All "ON" defined leading axis rela‐ tionships are activated.
Work preparation 3.16 Axis couplings Keyword Coupling characteristics / mean‐ Syntax Response of the following axis CPMBRAKE CPMBRAKE[FAx]=<bit-coded value> to certain stop signals and stop commands Response of the following axis CPMVDI CPMVDI[FAx]=<bit-coded value> to certain NC/PLC interface sig‐ nals Suppression of special cou‐...
Page 941
Work preparation 3.16 Axis couplings Note Coupling factor A coupling factor of 1 does not have to be programmed explicitly. The direction of the tangential axis is rotated using the coupling factor of -1. Syntax TANG(<following axis>, <leading axis_1>, <leading axis_2>, <coupling factor>, <coordinate system>, <optimization>) Meaning Define tangential coupling...
Work preparation 3.16 Axis couplings Optimization type <optimization>: Data type: CHAR Value: Standard (default value) "S": The dynamic response of the rotary axis has no effect on the leading axes If the dy‐ namic response of the rotary axis is greater than required for tracking, this method is sufficiently precise.
Work preparation 3.16 Axis couplings Activating intermediate block generation If TLIFT(...) is programmed after TANG(...), an intermediate block automatically generated by the control is inserted at this point when a corner is detected during preprocessing. When the program is executed, the leading axes are stopped when the intermediate block is reached.
Page 944
Work preparation 3.16 Axis couplings Angle of the following axis The angle of the following axis with respect to the path tangent depends on the transformation ratio specified in TANG(...), the offset angle parameterized in the machine data MD37402 $MA_TANG_OFFSET, and the offset angle specified for TANGON(...), which is applied additively.
Work preparation 3.16 Axis couplings 3.16.7.4 Deactivating the coupling (TANGOF) Via the predefined procedure TANGOF(...), a tangential coupling defined with TANG(...) (Page 940) and activated with TANGON(...) (Page 943) is deactivated. The following axis is then no longer aligned with the path tangent of the leading axis. However, the coupling of the following axis to the leading axes is retained even after deactivation, which prevents the following functions, for example: ●...
Page 946
Work preparation 3.16 Axis couplings Axis name of the following axis whose tangential coupling is to be de‐ <following axis>: leted Data type: AXIS Range of values: Channel axis names Examples Leading axis change Before a new tangential coupling can be defined with another leading axis for the following axis, the existing tangential coupling must first be deleted.
Work preparation 3.16 Axis couplings 3.16.8 Master/slave coupling (MASLDEF, MASLDEL, MASLON, MASLOF, MASLOFS) The "master/slave coupling" enables: ● The coupling of the slave axes to the master axis, when the axes involved are at standstill. ● The coupling/decoupling of rotating, speed-controlled spindles. ●...
Page 948
Work preparation 3.16 Axis couplings Note Coupling behavior for spindles in speed control mode For spindles in the speed control mode, the coupling behavior of MASLON, MASLOF, MASLOFS and MASLDEL are specified explicitly via the following machine data: MD37263 $MA_MS_SPIND_COUPLING_MODE For the default setting with MD37263 = 0, the slave axes are coupled-in and coupled-out only when the axes involved are at standstill.
Page 949
Work preparation 3.16 Axis couplings Program code Comment NEWCONF ; Activate machine data change Example 2: Dynamic configuration of a master/slave coupling To enable coupling with another spindle after axis container rotation, the previous coupling must be uncoupled, the configuration cleared, and a new coupling configured. Figure 3-14 Prior to the axis container rotation Figure 3-15...
Work preparation 3.17 Synchronized actions 3.17 Synchronized actions 3.17.1 Definition of a synchronized action A synchronous action is defined in a block of a part program. Any further commands that are not part of the synchronous action, may not be programmed within this block. A synchronous action consists of the following components: Validity, ID Condition part...
Work preparation 3.18 Oscillation 3.18 Oscillation 3.18.1 Asynchronous oscillation (OS, OSP1, OSP2, OST1, OST2, OSCTRL, OSNSC, OSE, OSB) An oscillating axis travels back and forth between two reversal points 1 and 2 at a defined feedrate, until the oscillating motion is deactivated. Other axes can be interpolated as desired during the oscillating motion.
Page 952
Work preparation 3.18 Oscillation Define position of reversal point 2 OSP2: Note: If incremental movement is active, the position will be calculated incrementally to the last corresponding reversal position programmed in the NC program. Define stopping time in reversal point 1 in [s] OST1: Define stopping time in reversal point 2 in [s] OST2:...
Page 953
Work preparation 3.18 Oscillation Define end position (in workpiece coordinate system) to be approached after deactivation OSE: of oscillation. Note: When programming "OSE" option 4 becomes effective implicitly for "OSCTRL". Define start position (in workpiece coordinate system) to be approached prior to activation OSB: of oscillation.
Page 954
Work preparation 3.18 Oscillation Example 2: Oscillation with online modification of the reversal position The setting data necessary for asynchronous oscillation can be set in the part program. If the setting data is described directly in the program, the change takes effect during preprocessing.
Work preparation 3.18 Oscillation Oscillation reversal points The current offsets must be taken into account when oscillation positions are defined: ● Absolute specification "OSP1[Z]=<value>" Position of reversal point = sum of offsets + programmed value ● Relative specification "OSP1[Z]=IC(<value>)" Position of reversal point = reversal point 1 + programmed value Example: Program code N10 OSP1[Z]=100 OSP2[Z]=110...
Page 956
Work preparation 3.18 Oscillation Meaning Position of reversal point 1 OSP1[<oscillating axis>]= Position of reversal point 2 OSP2[<oscillating axis>]= Stopping time at reversal point 1 in seconds OST1[<oscillating axis>]= Stopping time at reversal point 2 in seconds OST2[<oscillating axis>]= Feed for oscillating axis FA[<oscillating axis>]= Set or reset options OSCTRL[<oscillating axis>]=...
Page 957
Work preparation 3.18 Oscillation Example No infeed must take place at reversal point 1. At reversal point 2, the infeed is to start at a distance of ii2 before reversal point 2 and the oscillating axis is not to wait at the reversal point for the end of the partial infeed.
Page 958
Work preparation 3.18 Oscillation Program code Comment WHENEVER $AA_IM[Z]>=$SA_OSCILL_REVERSE_POS2[Z] ; If the actual position of the os- DO $AA_OVR[Z]=0 cillating axis Z in MCS is greater than the reversal position 2, then always set the axial override of the oscillating axis Z to 0%. WHENEVER $AA_DTEPW[X] == 0 DO $AC_MARKER[0]=1 ;...
Page 959
Work preparation 3.18 Oscillation Define oscillation parameters Assignment of oscillating and infeed axes: OSCILL OSCILL[<oscillating axis>]=(<infeed axis1>,<infeed axis2>,<infeed axis3>) The axis assignments and the start of the oscillation movement are defined with the "OSCILL" command. Up to 3 infeed axes can be assigned to an oscillating axis. Note Before oscillation starts, the synchronization conditions must be defined for the behavior of the axes.
Page 960
Work preparation 3.18 Oscillation Functions You can implement the following functions with the language resources described in detail below: 1. Infeed at reversal point. 2. Infeed at reversal area. 3. Infeed at both reversal points. 4. Stop oscillation movement at reversal point. 5.
Page 961
Work preparation 3.18 Oscillation The following instructions are used subject to the above assumptions: Reversal range 1: WHENEVER $AA_IM[Z]<>$SA_OSCILL_RESERVE_POS1[Z] DO $AA_OVR[X]=0 $AA_OVR[Z]=100 Whenever the actual position of oscillating axis Z in MCS is greater or less than the position reversal point 1, then set the axial override of the infeed axis X to 0% and the axial override of the oscillating axis Z to 100%.
Page 962
Work preparation 3.18 Oscillation Oscillation movement restarting The purpose of this synchronized action is to continue the movement of the oscillation axis on completion of the part infeed movement. The following instructions are used subject to the above assumptions: WHENEVER $AA_DTEPW[X]==0 DO $AA_OVR[Z]= 100 Whenever the remaining distance for the partial infeed of infeed axis X in the WCS is equal to zero, then set the axial override of the oscillating axis to 100%.
Work preparation 3.19 Punching and nibbling 3.19 Punching and nibbling 3.19.1 Activation/deactivation 3.19.1.1 Activate/deactivate punching and nibbling (SPOF, SON, PON, SONS, PONS, PDELAYON, PDELAYOF, PUNCHACC) Activate/deactivate punching and nibbling PON and SON are used to activate the punching and nibble functions. SPOF terminates all punching- and nibble-specific functions.
Page 964
Work preparation 3.19 Punching and nibbling SPIF1 and SPIF2 commands are used to switch over between the first and second punching interface. Note Requirement: A second I/O pair has to be defined for the punching functionality in the machine data (→ see machine manufacturer's specifications). Syntax PON G...
Page 965
Work preparation 3.19 Punching and nibbling Examples Example 1: Activate nibbling Program code Comment N70 X50 SPOF ; Position without punch initiation. N80 X100 SON ; Activate nibbling, initiate a stroke before the mo- tion (X=50) and on completion of the programmed move- ment (X=100).
Page 966
Work preparation 3.19 Punching and nibbling The axis accelerates at a rate corresponding to 50% of maximum acceleration. Distance between holes from 2 mm to 10 mm: Acceleration is increased to 100%, proportional to the spacing. Distance between holes more than 10 mm: Traverse at an acceleration of 100%.
Page 967
Work preparation 3.19 Punching and nibbling Machining with rotatable tools Note Use the tangential control function if you wish to position rotatable tools at a tangent to the programmed path. Use of M commands As in earlier versions, macro technology allows special M functions to be used instead of language commands (compatibility).
Work preparation 3.19 Punching and nibbling 3.19.2 Automatic path segmentation Segmentation into path segments When punching or nibbling is activated, both SPP and SPN segment the total traversing section programmed for the path axes into a number of path segments with the same length (equidistant path segmentation).
Page 969
Work preparation 3.19 Punching and nibbling Example 1 The programmed nibbling segments should be automatically split-up into path segments. 62.5 <=4 62.5 <=3 <=3 Program code Comment N100 G90 X130 Y75 F60 SPOF ; Positioning at starting point 1 N110 G91 Y125 SPP=4 SON ;...
Work preparation 3.19 Punching and nibbling Example 2 Automatic path segmentation should be made for the individual series of holes. The maximum path segment length (SPP value) is specified for the segmentation. 37.79 Program code Comment N100 G90 X75 Y75 F60 PON ;...
Page 971
Work preparation 3.19 Punching and nibbling N10 SON X0 Y0 N20 SPP=2 X10 The total traversing distance of 10 mm will be divided into five path sections each of 2 mm (SPP=2). Note The path segments effected by SPP are always equidistant, i.e. all segments are equal in length.
Work preparation 3.19 Punching and nibbling 3.19.2.2 Path segmentation for single axes If single axes are defined as punching/nibbling axes in addition to path axes, then the automatic path segmentation function can be activated for them. Behavior of the single axis for SPP The programmed path segment length (SPP) basically refers to the path axes.
Page 973
Work preparation 3.19 Punching and nibbling ● Circular interpolation: Path segmentation ● Linear interpolation: no path segmentation Behavior for SPN The programmed number of path segments also applies if a path axis is not simultaneously programmed. Precondition: The single axis is defined as punching-nibbling axis. NC programming Programming Manual, 12/2019, 6FC5398-2EP40-0BA0...
Work preparation 3.20 Grinding 3.20 Grinding 3.20.1 Activate/deactivate grinding-specific tool monitoring (TMON, TMOF) With the predefined procedures TMON(...) and TMOF(...), the grinding-specific tool monitoring is activated or deactivated (geometry and speed monitoring). Requirement The tool-specific parameters $TC_TPG1 to $TC_TPG9 must be set. Syntax TMON(<TNo>) TMOF(<TNo>)
Work preparation 3.21 Extended stop and retract (ESR) 3.21 Extended stop and retract (ESR) The extended stop and retract function - subsequently called ESR - offers the possibility of flexibly responding when a fault situation occurs as a function of the process: ●...
Work preparation 3.21 Extended stop and retract (ESR) Activation Function enable The functions generator operation, shutdown, retraction are released by setting the corresponding control signal $AA_ESR_ENABLE. This control signal can be changed by synchronized actions. Function triggering ESR is triggered jointly for all enabled axes by setting the system variable $AC_ESR_TRIGGER.
Page 977
Work preparation 3.21 Extended stop and retract (ESR) Meaning Address for specifying the target position of the retraction axis POLF: POLF is modal. Name of the geometry or channel/machine axis that retracts <axis>: Retraction position <position>: Type: REAL WCS is valid for geometry axes, otherwise MCS. With the same identifiers for geometry and channel/machine axes, retraction is in the WCS.
Page 978
Work preparation 3.21 Extended stop and retract (ESR) Note The positions programmed with POLF and the activation by POLFMASK or POLFMLIN are deleted when the part program is started. This means that the user must reprogram the values for POLF and the selected axes in POLFMASK or POLFMLIN in each part program. Note If, when using the abbreviated form POLFA only the type is changed, then the user must ensure that either the retraction position or the retraction path contains a practical and sensible value.
Work preparation 3.21 Extended stop and retract (ESR) The sum of the MD21380 $MC_ESR_DELAY_TIME1 and MD21381 $MC_ESR_DELAY_TIME2 times is the maximum available for the retraction. When this time has expired, rapid deceleration with follow-up is also initiated for the retraction axis. Note The extended retraction (i.e.
Work preparation 3.21 Extended stop and retract (ESR) Requirements ● A stopping axis is configured for the NC-controlled stopping in the channel: MD37500 $MA_ESR_REACTION = 22 ● ESR must be enabled for this axis: $AA_ESR_ENABLE = 1 ● Delay times are defined: MD21380 $MC_ESR_DELAY_TIME1 (delay time, ESR axes) MD21381 $MC_ESR_DELAY_TIME2 (ESR time for interpolatory braking) Execution...
Work preparation 3.21 Extended stop and retract (ESR) Meaning Function to write to the drive parameters for the ESR function "stop‐ ESRS(...): ping" The function: ● Must be alone in the block. ● Triggers a preprocessing stop. ● Cannot be used in synchronized actions. Axis for which drive-integrated stopping should be configured <axis_1>, ...,...
Page 982
Work preparation 3.21 Extended stop and retract (ESR) Meaning Function to write to the drive parameters for the ESR function "re‐ ESRR(...): tract" The function: ● Must be alone in the block. ● Triggers a preprocessing stop. ● Cannot be used in synchronized actions. Axis for which drive-integrated retraction should be configured <axis_1>, ...,...
Work preparation 3.22 Program runtime/part counter 3.22 Program runtime/part counter Information on the program runtime and workpiece counter is provided to support the machine tool operator. This information can be processed as system variables in the NC and/or PLC program. This information is also available to be displayed on the operator interface.
Page 984
Work preparation 3.22 Program runtime/part counter System variable Meaning Activity $AC_ACT_PROG_NET_TIME Actual net runtime of the current NC program in sec‐ ● Always active onds. ● Only AUTOMATIC Is automatically reset to "0" when a new NC program mode starts. $AC_OLD_PROG_NET_TIME Net runtime in seconds of the program that has just be correctly ended with M30...
Page 985
Work preparation 3.22 Program runtime/part counter Note Residual time for a workpiece If the same workpieces are machined one after the other, using the following timer values, the remaining residual time for a workpiece can be determined. ● Processing time for the last workpiece produced (see $AC_OLD_PROG_NET_TIME) ●...
Work preparation 3.22 Program runtime/part counter The value from $AC_OLD_PROG_NET_TIME: ● is kept beyond M30. ● is updated each time the loop is run through. Example 2: Measuring the duration of "mySubProgrammA" and "mySubProgrammC" Program code N10 DO $AC_PROG_NET_TIME_TRIGGER=2 N20 mySubProgrammA N30 DO $AC_PROG_NET_TIME_TRIGGER=3 N40 mySubProgrammB N50 DO $AC_PROG_NET_TIME_TRIGGER=4...
Page 987
Work preparation 3.22 Program runtime/part counter Note All workpiece counters are set to "0" when the control powers up with default values and can be read and written independent of their activation. Note Channel-specific machine data can be used to control counter activation, counter reset timing and the counting algorithm.
Work preparation 3.23 Additional functions 3.23 Additional functions 3.23.1 Activate machine data (NEWCONF) The NEWCONF command activates all machine data. The function can also be activated in the HMI user interface by pressing the "MD data effective" softkey. When the "NEWCONF" function is executed there is an implicit preprocessing stop; in other words, path movement is interrupted.
Work preparation 3.23 Additional functions 3.23.2 Check scope of NC language present (STRINGIS) Using the function "STRINGIS(...)" it can be checked as to whether the specified string is available as element of the NC programming language in the actual language scope. Definition INT STRINGIS(STRING <Name>) Syntax...
Page 990
1) Depending on the control, under certain circumstances, only a subset of the Siemens NC language commands are known, e.g. SINUMERIK 802D sl. For these controls, for strings that are principally Siemens NC language commands, a value of 0 is returned. This behavior can be changed using MD10711 $MN_NC_LANGUAGE_CONFIGURATION. For MD10711 = 1, then a value of 100 is always returned for Siemens NC language commands.
Page 991
Work preparation 3.23 Additional functions 5. String "$MC_GCODE_RESET_VALUES" is defined as machine data: 206 == STRINGIS("$MC_GCODE_RESET_VALUES") 6. String "GETMDACT" is an NC language function: 203 == STRINGIS("GETMDACT ") 7. String "DEFINE" is a keyword: 205 == STRINGIS("DEFINE") 8. String "$TC_DP3" is a system parameter (tool length component): 207 == STRINGIS("$TC_DP3") 9.
Work preparation 3.23 Additional functions Example The machine data, relevant for the function STRINGIS(...), has the following values: ● MD10711 $MN_NC_LANGUAGE_CONFIGURATION = 2 (only the NC language commands whose options are set are considered to be known) ● MD19410 $ON_TRAFO_TYPE_MASK = 'H0' (option: transformations) ●...
Page 993
Work preparation 3.23 Additional functions Operating area in which the configured user dialog boxes are implemented <ADDRESS>: Function Operating areas "Run MyScreens" user dialog CYCLES "Easy XML" user dialog CYCLES User XML Pop-up window "Run MyScreens" POPUPDLG Popup window "Easy XML" POPUPDLG Command to be executed <COMMAND>:...
Page 994
Work preparation 3.23 Additional functions Supplementary conditions ● The definition files *.com of the dialogs must be saved in the "proj" folder. ● The Easy XML definition files *.xml of the dialogs must be saved in the "appl" folder. If the definition files are saved in a different directory, the path must be specified indirectly, starting from the "appl"...
Page 995
Work preparation 3.23 Additional functions Program code Comment END: Example 2 The display time of a dialog is defined in the NC program via a dwell time, for example. Program code Comment F1000 G94 MMC("POPUPDLG,PICTURE_ON,xmldial_emb.xml,main","N") ; Display dialog X200 MMC("POPUPDLG,PICTURE_OFF","N") ;...
Work preparation 3.23 Additional functions 3.23.4 Process DataShare - Output to an external device/file (EXTOPEN, WRITE, EXTCLOSE): The writing of data from a part program to an external device/file is performed in three steps: 1. Open the external device/file The external device/file is opened for the channel for writing using the EXTOPEN command. 2.
Page 998
Work preparation 3.23 Additional functions Meaning Pre-defined procedure to open an external device/file EXTOPEN: Parameter 1: Result variable <Result>: By using the result variable value, it can be evaluated in the program as to wheth‐ er the operation was successful and processing is then appropriately continued. Type: Values: No error...
Page 999
2. where relevant, followed by a file path (attached using "/"). The following logical device names have been defined: Local CF card (pre-defined) "LOCAL_DRIVE": Reserved drive name for use in SIEMENS cycles (pre- "CYC_DRIVE": defined) "/dev/ext/1", ... Available network drives "/dev/ext/9":...
Page 1000
Work preparation 3.23 Additional functions Parameter 4: Usage mode for this device/file <AccessMode>: Type: STRING Values: Device/file is requested in the "shared" mode. Other "SHARED": channels can also use the device, i.e. also open in this mode. Device/file is exclusively used in the channel; no other "EXCL": channel can use the device.