Siemens Sinumerik 840D sl,Sinumerik 840DE sl,Sinumerik 828D Programming Manual

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

Preface

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

Table of contents

Preface.........................................................................................................................................................3
1 Flexible NC programming .........................................................................................................................17
1.1 Variables.................................................................................................................................... 17
1.1.1 General information about variables .......................................................................................... 17
1.1.2 System variables ....................................................................................................................... 18
1.1.3 Predefined user variables: Arithmetic parameters (R) ............................................................... 21
1.1.4 Predefined user variables: Link variables .................................................................................. 23
1.1.5 Definition of user variables (DEF) .............................................................................................. 25
1.1.6 Redefinition of system variables, user variables, and NC language commands (REDEF) ....... 31
1.1.7 Attribute: Initialization value ....................................................................................................... 34
1.1.8 Attribute: Limit values (LLI, ULI) ................................................................................................ 37
1.1.9 Attribute: Physical unit (PHU) .................................................................................................... 39
1.1.10 Attribute: Access rights (APR, APW, APRP, APWP, APRB, APWB) ........................................ 41
1.1.11 Overview of definable and redefinable attributes ...................................................................... 46
1.1.12 Definition and initialization of array variables (DEF, SET, REP) ............................................... 47
1.1.13 Definition and initialization of array variables (DEF, SET, REP): Further Information .............. 52
1.1.14 Data types ................................................................................................................................. 55
1.2 Indirect programming................................................................................................................. 56
1.2.1 Indirectly programming addresses ............................................................................................ 56
1.2.2 Indirectly programming G codes ................................................................................................ 59
1.2.3 Indirectly programming position attributes (BP) ......................................................................... 60
1.2.4 Indirectly programming part program lines (EXECSTRING) ..................................................... 63
1.3 Arithmetic functions ................................................................................................................... 64
1.4 Comparison and logic operations .............................................................................................. 67
1.5 Precision correction on comparison errors (TRUNC) ................................................................ 69
1.6 Variable minimum, maximum and range (MINVAL, MAXVAL and BOUND)............................. 71
1.7 Priority of the operations............................................................................................................ 73
1.8 Possible type conversions ......................................................................................................... 74
1.9 String operations ....................................................................................................................... 75
1.9.1 Type conversion to STRING (AXSTRING) ................................................................................ 76
1.9.2 Type conversion from STRING (NUMBER, ISNUMBER, AXNAME) ...
1.9.3
1.9.4 Conversion to lower/upper case letters (TOLOWER, TOUPPER) ............................................ 79
1.9.5 Determine length of string (STRLEN) ........................................................................................ 80
1.9.6 Search for character/string in the string (INDEX, RINDEX, MINDEX, MATCH) ........................ 81
1.9.7 Selection of a substring (SUBSTR) ........................................................................................... 82
1.9.8 Selection of a single character (STRINGVAR, STRINGFELD) ................................................. 83
1.9.9 Formatting a string (SPRINT) .................................................................................................... 84
1.10 Program jumps and branches ................................................................................................... 93
1.10.1 Return jump to the start of the program (GOTOS) .................................................................... 93
1.10.2 Program jumps to jump markers (GOTOB, GOTOF, GOTO, GOTOC) .................................... 94
1.10.3 Program branch (CASE ... OF ... DEFAULT ...) ........................................................................ 97
Concatenation of strings (<<) .................................................................................................... 78
..................................... 77
Job planning Programming Manual 02/2011, 6FC5398-2BP40-1BA0
7
Table of contents
1.11 Repeat program section (REPEAT, REPEATB, ENDLABEL, P)............................................... 99
1.12 Check structures...................................................................................................................... 106
1.12.1 Program loop with alternative (IF, ELSE, ENDIF) .................................................................... 107
1.12.2 Continuous program loop (LOOP, ENDLOOP) ....................................................................... 109
1.12.3 Count loop (FOR ... TO ..., ENDFOR) .....................................................................................110
1.12.4 Program loop with condition at start of loop (WHILE, ENDWHILE) ......................................... 112
1.12.5 Program loop with condition at the end of the loop (REPEAT, UNTIL) ................................... 113
1.12.6 Program example with nested check structures ...................................................................... 114
1.13 Program coordination (INIT, START, WAITM, WAITMC, WAITE, SETM, CLEARM) ............. 115
1.14 Interrupt routine (ASUB) .......................................................................................................... 120
1.14.1 Function of an interrupt routine ................................................................................................ 120
1.14.2 Creating an interrupt routine .................................................................................................... 121
1.14.3 Assign and start interrupt routine (SETINT, PRIO, BLSYNC) ................................................. 122
1.14.4 Deactivating/reactivating the assignment of an interrupt routine (DISABLE, ENABLE) .......... 124
1.14.5 Delete assignment of interrupt routine (CLRINT) .................................................................... 125
1.14.6 Fast retraction from the contour (SETINT LIFTFAST, ALF) .................................................... 126
1.14.7 Traversing direction for fast retraction from the contour .......................................................... 128
1.14.8 Motion sequence for interrupt routines .................................................................................... 131
1.15 Axis replacement, spindle replacement (RELEASE, GET, GETD).......................................... 132
1.16 Transfer axis to another channel (AXTOCHAN)...................................................................... 137
1.17 Activate machine data (NEWCONF) ....................................................................................... 139
1.18 Write file (WRITE).................................................................................................................... 140
1.19 Delete file (DELETE) ............................................................................................................... 146
1.20 Read lines in the file (READ) ................................................................................................... 148
1.21 Check for presence of file (ISFILE).......................................................................................... 152
1.22 Read out file information (FILEDATE, FILETIME, FILESIZE, FILESTAT, FILEINFO) ............ 154
1.23 Checksum calculation using an array (CHECKSUM) .............................................................. 158
1.24 Roundup (ROUNDUP)............................................................................................................. 160
1.25 Subprogram technique ............................................................................................................ 161
1.25.1 General information ................................................................................................................. 161
1.25.1.1 Subprogram ............................................................................................................................. 161
1.25.1.2 Subprogram names ................................................................................................................. 162
1.25.1.3 Nesting of subprograms ................................
.................................................................
.......... 163
1.25.1.4 Search path ............................................................................................................................. 164
1.25.1.5 Formal and actual parameters ................................................................................................. 165
1.25.1.6 Parameter transfer ................................................................................................................... 166
1.25.2 Definition of a subprogram ....................................................................................................... 168
1.25.2.1 Subprogram without parameter transfer .................................................................................. 168
1.25.2.2 Subprogram with call-by-value parameter transfer (PROC) .................................................... 169
1.25.2.3 Subprogram with call-by-reference parameter transfer (PROC, VAR) .................................... 170
1.25.2.4 Save modal G functions (SAVE) .............................................................................................. 172
1.25.2.5 Suppress single block execution (SBLOF, SBLON) ................................................................ 173
1.25.2.6 Suppress current block display (DISPLOF, DISPLON, ACTBLOCNO) ................................... 179
1.25.2.7 Identifying subprograms with preparation (PREPRO) ............................................................. 183
1.25.2.8 Subprogram return M17 ........................................................................................................... 184
Job planning
8
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Table of contents
1.25.2.9 RET subprogram return ........................................................................................................... 185
1.25.2.10Parameterizable subprogram return jump (RET ...) ................................................................ 186
1.25.3 Subprogram call ...................................................................................................................... 193
1.25.3.1 Subprogram call without parameter transfer ........................................................................... 193
1.25.3.2 Subprogram call with parameter transfer (EXTERN) .............................................................. 195
1.25.3.3 Number of program repetitions (P) .......................................................................................... 197
1.25.3.4 Modal subprogram call (MCALL) ............................................................................................. 199
1.25.3.5 Indirect subprogram call (CALL) .............................................................................................. 201
1.25.3.6 Indirect subprogram call with specification of the calling program part
(CALL BLOCK ... TO ...) .......................................................................................................... 202
1.25.3.7 Indirect call of a program programmed in ISO language (ISOCALL) ...................................... 203
1.25.3.8 Calling subroutine with path specification and parameters (PCALL) ....................................... 205
1.25.3.9 Extend search path for subprogram calls (CALLPATH) .......................................................... 206
1.25.3.10Execute external subroutine (EXTCALL) ................................................................................. 208
1.25.4 Cycles ...................................................................................................................................... 212
1.25.4.1 Parameterizing user cycles ..................................................................................................... 212
1.26 Macro technique (DEFINE ... AS)............................................................................................ 216
2 File and Program Management ...............................................................................................................219
2.1 Program memory..................................................................................................................... 219
2.2 Working memory (CHANDATA, COMPLETE, INITIAL) .......................................................... 224
2.3 Structuring instruction in step editor (SEFORM) ..................................................................... 227
3 Protection zones .....................................................................................................................................229
3.1 Definition of the protection zones (CPROTDEF, NPROTDEF) ............................................... 229
3.2 Activating/deactivating protection zones (CPROT, NPROT)................................................... 233
3.3 Checking for protection zone violation, working area limitation and software limits
(CALCPOSI) ............................................................................................................................ 237
4 Special Motion Commands .....................................................................................................................245
4.1 Approaching coded positions (CAC, CIC, CDC, CACP, CACN) ............................................. 245
4.2 Spline interpolation (ASPLINE, BSPLINE, CSPLINE, BAUTO, BNAT, BTAN, EAUTO, ENAT,
ETAN, PW, SD, PL)................................................................................................................. 246
4.3 Spline grouping (SPLINEPATH).............................................................................................. 257
4.4 NC block compression (COMPON, COMPCURV, COMPCAD, COMPOF) .....
....................... 259
4.5 Polynomial interpolation (POLY, POLYPATH, PO, PL)........................................................... 262
4.6 Settable path reference (SPATH, UPATH).............................................................................. 268
4.7 Measurements with touch trigger probe (MEAS, MEAW) ....................................................... 271
4.8 Extended measuring function (MEASA, MEAWA, MEAC) (option)......................................... 274
4.9 Special functions for OEM users (OMA1 ... OMA5, OEMIPO1, OEMIPO2, G810 ... G829) ... 283
4.10 Feed reduction with corner deceleration (FENDNORM, G62, G621)...................................... 284
4.11 Programmed end-of-motion criterion (FINEA, COARSEA, IPOENDA, IPOBRKA,
ADISPOSA) ............................................................................................................................. 285
4.12 Programmable servo parameter set (SCPARA)...................................................................... 288
Job planning Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
9
Table of contents
5 Coordinate transformation (FRAMES) ....................................................................................................289
5.1 Coordinate transformation via frame variables ........................................................................ 289
5.1.1 Predefined frame variable ($P_BFRAME, $P_IFRAME, $P_PFRAME, $P_ACTFRAME) ...... 291
5.2 Frame variables / assigning values to frames ......................................................................... 297
5.2.1 Assigning direct values (axis value, angle, scale) ................................................................... 297
5.2.2 Reading and changing frame components (TR, FI, RT, SC, MI) ............................................. 300
5.2.3 Linking complete frames .......................................................................................................... 301
5.2.4 Defining new frames (DEF FRAME) ........................................................................................ 303
5.3 Coarse and fine offsets (CFINE, CTRANS)............................................................................. 304
5.4 External zero offset.................................................................................................................. 306
5.5 Preset offset (PRESETON) ..................................................................................................... 307
5.6 Frame calculation from three measuring points in space (MEAFRAME) ................................ 309
5.7 NCU global frames ................................................................................................................. 313
5.7.1 Channel-specific frames ($P_CHBFR, $P_UBFR) .................................................................. 314
5.7.2 Frames active in the channel ................................................................................................... 315
6 Transformations ......................................................................................................................................321
6.1 General programming of transformation types ........................................................................ 321
6.1.1 Orientation movements for transformations ............................................................................. 324
6.1.2 Overview of orientation transformation TRAORI ..................................................................... 327
6.2 Three, four and five axis transformation (TRAORI) ................................................................. 329
6.2.1 General relationships of universal tool head ............................................................................ 329
6.2.2 Three, four and five axis transformation (TRAORI) ................................................................. 332
6.2.3 Variants of orientation programming and initial setting (ORIRESET) ...................................... 334
6.2.4 Programming of the tool orientation (A..., B..., C..., LEAD, TILT) ............................................ 335
6.2.5 Face milling (3D-milling A4, B4, C4, A5, B5, C5) .................................................................... 342
6.2.6 Orientation axis reference (ORIWKS, ORIMKS) ..................................................................... 344
6.2.7 Programming orientation axes (ORIAXES, ORIVECT, ORIEULER, ORIRPY, ORIRPY2,
ORIVIRT1, ORIVIRT2) ............................................................................................................ 346
6.2.8 Orientation programming along the peripheral surface of a taper (ORIPLANE, ORICONCW,
ORICONCCW, ORICONTO, ORICONIO) ............................................................................... 348
6.2.9 Specification of orientation for two contact points (ORICURVE, PO[XH]=, PO[YH]=,
PO[ZH]=) ................................................................................................................................. 352
6.3 Orientation polynomials (PO[angle], PO[coordinate]).........
6.4
Rotations of the tool orientation (ORIROTA, ORIROTR, ORIROTT, ORIROTC, THETA) ...... 356
..................................................... 354
6.5 Orientations relative to the path............................................................................................... 359
6.5.1 Orientation types relative to the path ....................................................................................... 359
6.5.2 Rotation of the tool orientation relative to the path (ORIPATH, ORIPATHS,
angle of rotation) ...................................................................................................................... 361
6.5.3 Interpolation of the tool rotation relative to the path (ORIROTC, THETA) ............................... 362
6.5.4 Smoothing of orientation characteristic (ORIPATHS A8=, B8=, C8=) ..................................... 364
6.6 Compression of the orientation (COMPON, COMPCURV, COMPCAD)................................. 366
6.7 Smoothing the orientation characteristic (ORISON, ORISOF) ................................................ 369
6.8 Kinematic transformation ......................................................................................................... 371
6.8.1 Milling on turned parts (TRANSMIT) ........................................................................................ 371
10
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Job planning
Table of contents
6.8.2 Cylinder surface transformation (TRACYL) ............................................................................. 375
6.8.3 Inclined axis (TRAANG) .......................................................................................................... 383
6.8.4 Inclined axis programming (G05, G07) .................................................................................... 386
6.9 Cartesian PTP travel ............................................................................................................... 388
6.9.1 PTP for TRANSMIT ................................................................................................................. 393
6.10 Constraints when selecting a transformation........................................................................... 397
6.11 Deselect transformation (TRAFOOF) ...................................................................................... 398
6.12 Chained transformations (TRACON, TRAFOOF).................................................................... 399
7 Tool offsets .............................................................................................................................................401
7.1 Offset memory ......................................................................................................................... 401
7.2 Additive offsets ........................................................................................................................ 404
7.2.1 Selecting additive offsets (DL) ................................................................................................. 404
7.2.2 Specify wear and setup values ($TC_SCPxy[t,d], $TC_ECPxy[t,d]) ....................................... 406
7.2.3 Delete additive offsets (DELDL) .............................................................................................. 407
7.3 Special handling of tool offsets................................................................................................ 408
7.3.1 Mirroring of tool lengths ........................................................................................................... 410
7.3.2 Wear sign evaluation ............................................................................................................... 411
7.3.3 Coordinate system of the active machining operation (TOWSTD, TOWMCS, TOWWCS,
TOWBCS, TOWTCS, TOWKCS) ............................................................................................ 412
7.3.4 Tool length and plane change ................................................................................................. 415
7.4 Online tool offset (PUTFTOCF, FCTDEF, PUTFTOC, FTOCON, FTOCOF) .......................... 416
7.5 Activate 3D tool offsets (CUT3DC..., CUT3DF...).................................................................... 421
7.5.1 Activating 3D tool offsets (CUT3DC, CUT3DF, CUT3DFS, CUT3DFF, ISD) .......................... 421
7.5.2 3D tool offset peripheral milling, face milling ........................................................................... 423
7.5.3 3D tool offset Tool shapes and tool data for face milling ......................................................... 425
7.5.4 3D tool offset Compensation on the path, path curvature, insertion depth (CUT3DC, ISD) .... 426
7.5.5 3D tool offset Inside/outside corners and intersection procedure (G450/G451) ...................... 429
7.5.6 3D tool offset 3D circumferential milling with limitation surfaces ............................................. 430
7.5.7 3D tool offset Taking into consideration a limitation surface (CUT3DCC, CUT3DCCD) ......... 431
7.6 Tool orientation (ORIC, ORID, OSOF, OSC, OSS, OSSE, ORIS, OSD, OST)....................... 435
7.7 Free assignment of D numbers, cutting edge numbers........................................................... 441
7.7.1 Free assignment of D numbers, cutting edge numbers (CE address) .................................... 441
7.7.2 Free assignment of D numbers: Checking D numbers (CHKDNO)
7.7.3
Free assignment of D numbers: Rename D numbers (GETDNO, SETDNO) ......................... 442
......................................... 441
7.7.4 Free assignment of D numbers: Determine T number to the specified D number
(GETACTTD) ........................................................................................................................... 443
7.7.5 Free assignment of D numbers: Invalidate D numbers (DZERO) ........................................... 444
7.8 Tool holder kinematics............................................................................................................. 445
7.9 Tool length compensation for orientable toolholders (TCARR, TCOABS, TCOFR, TCOFRX,
TCOFRY, TCOFRZ) ................................................................................................................ 451
7.10 Online tool length compensation (TOFFON, TOFFOF)........................................................... 454
7.11 Cutting data modification for tools that can be rotated (CUTMOD) ......................................... 457
Job planning Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
11
Table of contents
8 Path traversing behavior .........................................................................................................................463
8.1 Tangential control (TANG, TANGON, TANGOF, TLIFT, TANGDEL)...................................... 463
8.2 Feedrate response (FNORM, FLIN, FCUB, FPO) ................................................................... 470
8.3 Program sequence with preprocessing memory (STOPFIFO, STARTFIFO, FIFOCTRL,
STOPRE)................................................................................................................................. 475
8.4 Conditionally interruptible program sections (DELAYFSTON, DELAYFSTOF)....................... 478
8.5 Preventing program position for SERUPRO (IPTRLOCK, IPTRUNLOCK) ............................. 483
8.6 Repositioning to a contour (REPOSA, REPOSL, REPOSQ, REPOSQA, REPOSH,
REPOSHA, DISR, DISPR, RMI, RMB, RME, RMN)................................................................ 486
8.7 Influencing the motion control.................................................................................................. 495
8.7.1 Percentage jerk correction (JERKLIM) .................................................................................... 495
8.7.2 Percentage velocity correction (VELOLIM) .............................................................................. 496
8.7.3 Program example for JERKLIM and VELOLIM ....................................................................... 499
8.8 Programmable contour/orientation tolerance (CTOL, OTOL, ATOL) ...................................... 500
8.9 Tolerance for G0 motion (STOLF) ........................................................................................... 504
9 Axis couplings .........................................................................................................................................507
9.1 Coupled motion (TRAILON, TRAILOF) ................................................................................... 507
9.2 Curve tables (CTAB)................................................................................................................ 511
9.2.1 Define curve tables (CTABDEF, CATBEND) ........................................................................... 512
9.2.2 Check for presence of curve table (CTABEXISTS) ................................................................. 518
9.2.3 Delete curve tables (CTABDEL) .............................................................................................. 519
9.2.4 Locking curve tables to prevent deletion and overwriting (CTABLOCK, CTABUNLOCK) ....... 520
9.2.5 Curve tables: Determine table properties (CTABID, CTABISLOCK, CTABMEMTYP,
CTABPERIOD) ........................................................................................................................ 521
9.2.6 Read curve table values (CTABTSV, CTABTEV, CTABTSP, CTABTEP, CTABSSV, CTABSEV,
CTAB, CTABINV, CTABTMIN, CTABTMAX) .......................................................................... 523
9.2.7 Curve tables: Check use of resources (CTABNO, CTABNOMEM, CTABFNO, CTABSEGID, CTABSEG, CTABFSEG, CTABMSEG, CTABPOLID, CTABPOL, CTABFPOL, CTABMPOL) 528
9.3 Axial leading value coupling (LEADON, LEADOF).................................................................. 530
9.4 Electronic gear (EG) ................................................................................................................ 536
9.4.1 Defining an electronic gear (EGDEF) ......................................................................................536
9.4.2 Switch-in the electronic gearbox (EGON, EGONSYN, EGONSYNE)
3 Switching-in the electronic gearbox (EGOFS, EGOFC) .......................................................... 541
9.4.
..................................... 538
9.4.4 Deleting the definition of an electronic gear (EGDEL) ............................................................. 542
9.4.5 Rotational feedrate (G95) / electronic gear (FPR) ................................................................... 542
9.5 Synchronous spindle ............................................................................................................... 543
9.5.1 Synchronous spindle: Programming (COUPDEF, COUPDEL, COUPON, COUPONC,
COUPOF, COUPOFS, COUPRES, WAITC) ........................................................................... 544
9.6 Master/slave group (MASLDEF, MASLDEL, MASLON, MASLOF, MASLOFS)...................... 555
10 Motion synchronous actions ....................................................................................................................559
10.1 Basics ...................................................................................................................................... 559
10.1.1 Area of validity and machining sequence (ID, IDS) ................................................................. 561
10.1.2 Cyclically checking the condition (WHEN, WHENEVER, FROM, EVERY) ............................. 563
Job planning
12
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Table of contents
10.1.3 Actions (DO) ............................................................................................................................ 565
10.2 Operators for conditions and actions ....................................................................................... 566
10.3 Main run variables for synchronized actions ........................................................................... 568
10.3.1 System variables ..................................................................................................................... 568
10.3.2 Implicit type conversion ........................................................................................................... 570
10.3.3 GUD variables ......................................................................................................................... 571
10.3.4 Default axis identifier (NO_AXIS) ............................................................................................ 573
10.3.5 Synchronized action marker ($AC_MARKER[n]) .................................................................... 574
10.3.6 Synchronized action parameters ($AC_PARAM[n]) ................................................................ 575
10.3.7 Arithmetic parameter ($R[n]) ................................................................................................... 575
10.3.8 Read and write NC machine and NC setting data ................................................................... 576
10.3.9 Timer variable ($AC_Timer[n]) ................................................................................................ 578
10.3.10 FIFO variables ($AC_FIFO1[n] ... $AC_FIFO10[n]) ................................................................. 579
10.3.11 Information about block types in the interpolator ($AC_BLOCKTYPE,
$AC_BLOCKTYPEINFO, $AC_SPLITBLOCK) ....................................................................... 581
10.4 Actions in synchronized actions .............................................................................................. 584
10.4.1 Overview of possible actions in synchronized actions ............................................................. 584
10.4.2 Output of auxiliary functions .................................................................................................... 586
10.4.3 Set read-in disable (RDISABLE) ............................................................................................. 587
10.4.4 Cancel preprocessing stop (STOPREOF) ............................................................................... 588
10.4.5 Delete distance-to-go (DELDTG) ............................................................................................ 589
10.4.6 Polynomial definition (FCTDEF) .............................................................................................. 591
10.4.7 Synchronized function (SYNFCT) ........................................................................................... 594
10.4.8 Closed-loop clearance control with limited correction ($AA_OFF_MODE) .............................. 597
10.4.9 Online tool offset (FTOC) ........................................................................................................ 600
10.4.10 Online tool length compensation ($AA_TOFF) ........................................................................ 603
10.4.11 Positioning movements ........................................................................................................... 605
10.4.12 Position axis (POS) ................................................................................................................. 606
10.4.13 Position in specified reference range (POSRANGE) ............................................................... 608
10.4.14 Start/stop axis (MOV) .............................................................................................................. 609
10.4.15 Axis replacement (RELEASE, GET) ........................................................................................610
10.4.16 Axial feed (FA) ........................................
..................................................................
............... 614
10.4.17 Software limit switch ................................................................................................................ 614
10.4.18 Axis coordination ..................................................................................................................... 615
10.4.19 Set actual values (PRESETON) .............................................................................................. 616
10.4.20 Withdrawing the enable for the axis container rotation (AXCTSWEC) .................................... 617
10.4.21 Spindle motions ....................................................................................................................... 620
10.4.22 Coupled motion (TRAILON, TRAILOF) ................................................................................... 621
10.4.23 Leading value coupling (LEADON, LEADOF) ......................................................................... 623
10.4.24 Measuring (MEAWA, MEAC) .................................................................................................. 626
10.4.25 Initialization of array variables (SET, REP) ............................................................................. 627
10.4.26 Set/delete wait markers (SETM, CLEARM) ............................................................................. 628
10.4.27 Fault responses (SETAL) ........................................................................................................ 629
10.4.28 Travel to fixed stop (FXS, FXST, FXSW, FOCON, FOCOF) ................................................... 630
10.4.29 Determining the path tangent in synchronized actions ............................................................ 632
10.4.30 Determining the current override ............................................................................................. 633
10.4.31 Time use evaluation of synchronized actions .......................................................................... 634
10.5 Technology cycles ................................................................................................................... 636
10.5.1 Context variable ($P_TECCYCLE) ..........................................................................................639
10.5.2 Call-by-value parameters ........................................................................................................ 640
Job planning Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
13
Table of contents
10.5.3 Default parameter initialization ................................................................................................ 640
10.5.4 Control processing of technology cycles (ICYCOF, ICYCON) ................................................ 641
10.5.5 Cascading technology cycles .................................................................................................. 642
10.5.6 Technology cycles in non-modal synchronized actions ........................................................... 642
10.5.7 Check structures (IF) ............................................................................................................... 643
10.5.8 Jump instructions (GOTO, GOTOF, GOTOB) ......................................................................... 643
10.5.9 Lock, unlock, reset (LOCK, UNLOCK, RESET) ....................................................................... 644
10.6 Delete synchronized action (CANCEL).................................................................................... 646
10.7 Control behavior in specific operating states ........................................................................... 647
11 Oscillation ................................................................................................................................................651
11.1 Asynchronous oscillation (OS, OSP1, OSP2, OST1, OST2, OSCTRL, OSNSC, OSE, OSB) 651
11.2 Oscillation controlled by synchronized actions (OSCILL) ........................................................ 657
12 Punching and nibbling .............................................................................................................................665
12.1 Activation, deactivation ............................................................................................................ 665
12.1.1 Punching and nibbling on or off (SPOF, SON, PON, SONS, PONS, PDELAYON,
PDELAYOF, PUNCHACC) ...................................................................................................... 665
12.2 Automatic path segmentation .................................................................................................. 670
12.2.1 Path segmentation for path axes ............................................................................................. 673
12.2.2 Path segmentation for single axes ........................................................................................... 675
13 Grinding ...................................................................................................................................................677
13.1 Grinding-specific tool monitoring in the part program (TMON, TMOF).................................... 677
14 Additional functions .................................................................................................................................679
14.1 Axis functions (AXNAME, AX, SPI, AXTOSPI, ISAXIS, AXSTRING, MODAXVAL)................ 679
14.2 Replaceable geometry axes (GEOAX) .................................................................................... 682
14.3 Axis container (AXCTSWE, AXCTSWED, AXCTSWEC) ........................................................ 687
14.4 Wait for valid axis position (WAITENC) ................................................................................... 693
14.5 Check scope of NC language present (STRINGIS)................................................................. 695
14.6 Function call ISVAR and read machine data array index ........................................................ 699
14.7 Learn compensation characteristics (QECLRNON, QECLRNOF) .......................................... 701
14.8 Interactively call the window from the part program (MMC) .................................................... 703
14.9 Program runtime/part counter..................................
................................................................ 704
14.9.1 Program runtime/part counter (overview) ................................................................................ 704
14.9.2 Program runtime ...................................................................................................................... 705
14.9.3 Workpiece counter ................................................................................................................... 709
14.10 Output to an external device/file (EXTOPEN, WRITE, EXTCLOSE)....................................... 710
14.11 Alarms (SETAL)....................................................................................................................... 719
14.12 Drive-integrated extended stop and retract (ESR)................................................................... 721
14.12.1 Configuring drive-integrated stopping (ESRS) ......................................................................... 721
14.12.2 Configuring drive-integrated retraction (ESRS) ....................................................................... 722
14
Job planning
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Table of contents
15 User stock removal programs .................................................................................................................725
15.1 Supporting functions for stock removal ................................................................................... 725
15.2 Generate contour table (CONTPRON).................................................................................... 726
15.3 Generate coded contour table (CONTDCON)......................................................................... 732
15.4 Determine point of intersection between two contour elements (INTERSEC) ........................ 736
15.5 Execute the contour elements of a table block-by-block (EXECTAB) ..................................... 738
15.6 Calculate circle data (CALCDAT) ............................................................................................ 739
15.7 Deactivate contour preparation (EXECUTE) ........................................................................... 741
16 Programming cycles externally ...............................................................................................................743
16.1 Technology cycles ................................................................................................................... 743
16.1.1 Introduction .............................................................................................................................. 743
16.1.2 Drilling, centering - CYCLE81 .................................................................................................. 745
16.1.3 Drilling, counterboring - CYCLE82 .......................................................................................... 746
16.1.4 Reaming - CYCLE85 ............................................................................................................... 747
16.1.5 Deep-hole drilling - CYCLE83 ................................................................................................. 748
16.1.6 Boring - CYCLE86 ................................................................................................................... 750
16.1.7 Tapping without compensating chuck - CYCLE84 .................................................................. 751
16.1.8 Tapping with compensating chuck - CYCLE840 ..................................................................... 754
16.1.9 Thread milling - CYCLE78 ....................................................................................................... 756
16.1.10 Freely programmable positions - CYCLE802 .......................................................................... 758
16.1.11 Row of holes - HOLES1 .......................................................................................................... 760
16.1.12 Grid or frame - CYCLE801 ...................................................................................................... 761
16.1.13 Circle of holes - HOLES2 ........................................................................................................ 762
16.1.14 Face milling - CYCLE61 .......................................................................................................... 763
16.1.15 Milling a rectangular pocket - POCKET3 .................................................................................765
16.1.16 Milling a circular pocket - POCKET4 ....................................................................................... 768
16.1.17 Rectangular spigot milling - CYCLE76 .................................................................................... 770
16.1.18 Circular spigot milling - CYCLE77 ........................................................................................... 772
16.1.19 Multiple-edge - CYCLE79 ........................................................................................................ 774
16.1.20 Longitudinal slot - SLOT1 ........................................................................................................ 776
16.1.21 Circumferential slot - SLOT2 ................................................................................................... 779
16.1.22 Mill open slot - CYCLE899 ...................................................................................................... 781
16.1.23 Elongated hole - LONGHOLE ................................................................................................. 783
16.1.24 Thread milling - CYCLE70 ....................................................................................................... 785
16.1.25 Engraving cycle - CYCLE60 ..............................
.................................................................
..... 787
16.1.26 Contour call - CYCLE62 .......................................................................................................... 790
16.1.27 Path milling - CYCLE72 ........................................................................................................... 791
16.1.28 Predrilling a contour pocket - CYCLE64 .................................................................................. 794
16.1.29 Milling a contour pocket - CYCLE63 ........................................................................................ 796
16.1.30 Stock removal - CYCLE951 ..................................................................................................... 798
16.1.31 Groove - CYCLE930 ................................................................................................................ 801
16.1.32 Undercut forms - CYCLE940 ................................................................................................... 804
16.1.33 Thread turning - CYCLE99 ...................................................................................................... 807
16.1.34 Thread chain - CYCLE98 ........................................................................................................ 810
16.1.35 Cut-off - CYCLE92 ................................................................................................................... 813
16.1.36 Contour grooving - CYCLE952 ................................................................................................ 815
16.1.37 Swiveling - CYCLE800 ............................................................................................................ 819
16.1.38 High Speed Settings - CYCLE832 ........................................................................................... 822
Job planning Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
15
16.1.39 High speed cutting (HSC) - CYCLE_HSC ............................................................................... 823
17 Tables .....................................................................................................................................................825
17.1 Operations ............................................................................................................................... 825
17.2 Operations: Availability for SINUMERIK 828D ........................................................................ 877
17.3 Currently set language in the HMI ........................................................................................... 899
A Appendix .................................................................................................................................................901
A.1 List of abbreviations................................................................................................................. 901
A.2 Overview.................................................................................................................................. 906
Glossary...................................................................................................................................................909
16
Job planning
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0

Flexible NC programming

1.1 Variables

1.1.1 General information about variables

The use of variables, especially in conjunction with arithmetic functions and check structures, enables part programs and cycles to be set up with extremely high levels of flexibility. For this purpose the system makes three different types of variable available.
System variables
System variables are variables with a fixed predefined meaning; they are defined in the system and made available to the user. They are also read and written by the system software. Example: Machine data
The meaning of a system variable is, to a large extent, predefined by the system and its properties are fixed. However, minor modifications can be made to the properties by the user in the form of redefinition. See "Redefinition of system variables, user variables, and NC language commands (REDEF) [Page 31]".
User variables
1
User variables are variables whose meaning is not known to the system; they are not evaluated by the system. The meaning is defined exclusively by the user.
User variables are subdivided into:
- Predefined user variables
Predefined user variables are variables which have already been defined in the system and whose number simply has to be parameterized by the user via specific machine data. The user can make significant changes to the properties of these variables. See "Redefinition of system variables, user variables, and NC language commands (REDEF) [Page 31]".
- User-defined variables
User-defined variables are variables which are defined exclusively by the user and are not created by the system until runtime. Their number, data type, visibility, and all other properties are defined exclusively by the user.
See "Definition of user variables (DEF) [Page 25]".
Job planning Programming Manual 02/2011, 6FC5398-2BP40-1BA0
17
Flexible NC programming
1.1 Variables
See also
System variables System variables [Page 18]
Predefined user variables: Arithmetic parameters (R) Predefined user variables: Arithmetic parameters (R) [Page 21]
Predefined user variables: Link variables Predefined user variables: Link variables [Page 23]
Attribute: Initialization value Attribute: Initialization value [Page 34]
Attribute: Limit values (LLI, ULI) Attribute: Limit values (LLI, ULI) [Page 37]
Attribute: Physical unit (PHU) Attribute: Physical unit (PHU) [Page 39]
Attribute: Access rights (APR, APW, APRP, APWP, APRB, APWB) Attribute: Access rights (APR, APW, APRP, APWP, APRB, APWB) [Page 41]
Overview of definable and redefinable attributes Overview of definable and redefinable attributes [Page 46]
Definition and initialization of array variables (DEF, SET, REP) Definition and initialization of array variables (DEF, SET, REP) [Page 47]
Data types Data types [Page 55]

1.1.2 System variables

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

1.1.3 Predefined user variables: Arithmetic parameters (R)

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

1.1.4 Predefined user variables: Link variables

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

1.1.5 Definition of user variables (DEF)

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