SINUMERIK
SINUMERIK 840D sl / 828D Job Planning
Programming Manual
Valid for
Control
SINUMERIK 840D sl / 840DE sl SINUMERIK 828D
Software |
Version |
CNC software |
4.5 SP2 |
03/2013
6FC5398-2BP40-3BA1
Preface
Flexible NC programming |
1 |
|
File and Program |
|
|
2 |
||
Management |
||
|
|
|
Protection zones |
3 |
|
|
|
|
Special motion commands |
4 |
|
Coordinate transformations |
|
|
5 |
||
(frames) |
||
|
|
|
Transformations |
6 |
|
|
|
|
Kinematic chains |
7 |
|
Collision avoidance with |
|
|
8 |
||
kinematic chains |
||
|
|
|
Tool offsets |
9 |
|
|
|
|
Path traversing behavior |
10 |
|
|
|
|
Axis couplings |
11 |
|
|
|
|
Synchronized actions |
12 |
|
|
|
|
Oscillation |
13 |
|
|
|
|
Punching and nibbling |
14 |
|
|
|
|
Grinding |
15 |
|
|
|
|
Additional functions |
16 |
|
User stock removal |
|
|
17 |
||
programs |
||
Programming cycles |
|
|
18 |
||
externally |
||
|
|
|
Tables |
19 |
|
|
|
|
Appendix |
A |
|
|
|
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems. The permissible ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this publication is reviewed regularly and any necessary corrections are included in subsequent editions.
Siemens AG |
Order number: 6FC5398-2BP40-3BA1 |
Copyright © Siemens AG 1995 - 2013. |
Industry Sector |
04/2013 Technical data subject to change |
All rights reserved |
Postfach 48 48 |
|
|
90026 NÜRNBERG |
|
|
GERMANY |
|
|
SINUMERIK documentation
The SINUMERIK documentation is organized in the following categories:
●General documentation
●User documentation
●Manufacturer/service documentation
Additional information
You can find information on the following topics at www.siemens.com/motioncontrol/docu:
●Ordering documentation/overview of documentation
●Additional links to download documents
●Using documentation online (find and search in manuals/information)
Please send any questions about the technical documentation (e.g. suggestions for improvement, corrections) to the following address:
docu.motioncontrol@siemens.com
My Documentation Manager (MDM)
Under the following link you will find information to individually compile OEM-specific machine documentation based on the Siemens content:
www.siemens.com/mdm
Training
For information about the range of training courses, refer under:
●www.siemens.com/sitrain
SITRAIN - Siemens training for products, systems and solutions in automation technology
●www.siemens.com/sinutrain
SinuTrain - training software for SINUMERIK
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
3 |
Preface
FAQs
You can find Frequently Asked Questions in the Service&Support pages under Product Support. http://support.automation.siemens.com
SINUMERIK
You can find information on SINUMERIK under the following link: www.siemens.com/sinumerik
Target group
This publication is intended for:
●Programmers
●Project engineers
Benefits
With the programming manual, the target group can develop, write, test, and debug programs and software user interfaces.
Standard scope
This Programming Manual describes the functionality afforded by standard functions. Extensions or changes made by the machine tool manufacturer are documented by the machine tool manufacturer.
Other functions not described in this documentation might be executable in the control. This does not, however, represent an obligation to supply such functions with a new control or when servicing.
Further, for the sake of simplicity, this documentation does not contain all detailed information about all types of the product and cannot cover every conceivable case of installation, operation or maintenance.
Technical Support
You will find telephone numbers for other countries for technical support in the Internet under http://www.siemens.com/automation/service&support
|
Job Planning |
4 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Preface
Information on structure and contents
"Fundamentals" and "Job planning" Programming Manual
The description of the NC programming is divided into two manuals:
1.Fundamentals
The "Fundamentals" Programming Manual is intended for use by skilled machine operators with the appropriate expertise in drilling, milling and turning operations. Simple programming examples are used to explain the commands and statements which are also defined according to DIN 66025.
2.Job planning
This "Job planning" Programming Manual is intended for use by technicians with in-depth, comprehensive programming knowledge. By virtue of a special programming language, the SINUMERIK control enables the user to program complex workpiece programs (e.g. for free-form surfaces, channel coordination, ...) and makes programming of complicated operations easy for technologists.
Availability of the described NC language elements
All NC language elements described in the manual are available for the SINUMERIK 840D sl. The availability regarding SINUMERIK 828D can be found in table "Operations: Availability for SINUMERIK 828D (Page 778)".
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
5 |
Preface
|
Job Planning |
6 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
|
Preface |
...................................................................................................................................................... |
3 |
1 |
Flexible ........................................................................................................................NC programming |
17 |
|
|
1.1 ...................................................................................................................................... |
Variables |
17 |
|
1.1.1 ............................................................................................................................ |
System variable |
17 |
|
1.1.2 ................................................................. |
Predefined user variables: Arithmetic parameters (R) |
20 |
|
1.1.3 .................................................................................... |
Predefined user variables: Link variables |
21 |
|
1.1.4 ................................................................................................ |
Definition of user variables (DEF) |
24 |
|
1.1.5 ......... |
Redefinition of system variables, user variables, and NC language commands (REDEF) |
29 |
|
1.1.6 ......................................................................................................... |
Attribute: Initialization value |
32 |
|
1.1.7 ................................................................................................... |
Attribute: Limit values (LLI, ULI) |
35 |
|
1.1.8 ...................................................................................................... |
Attribute: Physical unit (PHU) |
37 |
|
1.1.9 .......................................... |
Attribute: Access rights (APR, APW, APRP, APWP, APRB, APWB) |
39 |
|
1.1.10 ......................................................................... |
Overview of definable and redefinable attributes |
44 |
|
1.1.11 ................................................. |
Definition and initialization of array variables (DEF, SET, REP) |
45 |
|
1.1.12 ................. |
Definition and initialization of array variables (DEF, SET, REP): Further Information |
49 |
|
1.1.13 .................................................................................................................................... |
Data types |
52 |
|
1.1.14 ................................................................. |
Explicit data type conversions (AXTOINT, INTTOAX) |
53 |
|
1.1.15 ...................................................................................... |
Check availability of a variable (ISVAR) |
54 |
1.1.16Read attribute values / data type (GETVARPHU, GETVARAP, GETVARLIM,
|
GETVARDFT, GETVARTYP)...................................................................................................... |
56 |
1.2 |
Indirect programming................................................................................................................... |
61 |
1.2.1 |
Indirectly programming addresses............................................................................................... |
61 |
1.2.2 |
Indirectly programming G codes.................................................................................................. |
64 |
1.2.3 |
Indirectly programming position attributes (GP) .......................................................................... |
65 |
1.2.4 |
Indirectly programming part program lines (EXECSTRING)....................................................... |
68 |
1.3 |
Arithmetic functions...................................................................................................................... |
69 |
1.4 |
Comparison and logic operations................................................................................................ |
71 |
1.5 |
Precision correction on comparison errors (TRUNC).................................................................. |
73 |
1.6 |
Variable minimum, maximum and range (MINVAL, MAXVAL and BOUND) .............................. |
74 |
1.7 |
Priority of the operations.............................................................................................................. |
76 |
1.8 |
Possible type conversions ........................................................................................................... |
77 |
1.9 |
String operations.......................................................................................................................... |
78 |
1.9.1 |
Type conversion to STRING (AXSTRING).................................................................................. |
78 |
1.9.2 |
Type conversion from STRING (NUMBER, ISNUMBER, AXNAME).......................................... |
79 |
1.9.3 |
Concatenation of strings (<<)....................................................................................................... |
81 |
1.9.4 |
Conversion to lower/upper case letters (TOLOWER, TOUPPER).............................................. |
82 |
1.9.5 |
Determine length of string (STRLEN).......................................................................................... |
83 |
1.9.6 |
Search for character/string in the string (INDEX, RINDEX, MINDEX, MATCH).......................... |
83 |
1.9.7 |
Selection of a substring (SUBSTR) ............................................................................................. |
85 |
1.9.8 |
Reading and writing of individual characters............................................................................... |
85 |
1.9.9 |
Formatting a string (SPRINT) ...................................................................................................... |
87 |
Job Planning |
|
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
7 |
Table of contents
1.10 |
Program jumps and branches..................................................................................................... |
96 |
|
1.10.1 |
Return jump to the start of the program (GOTOS)...................................................................... |
96 |
|
1.10.2 |
Program jumps to jump markers (GOTOB, GOTOF, GOTO, GOTOC)...................................... |
97 |
|
1.10.3 |
Program branch (CASE |
... OF ... DEFAULT ...)........................................................................ |
100 |
1.11 |
Repeat program section (REPEAT, REPEATB, ENDLABEL, P).............................................. |
102 |
|
1.12 |
Check structures....................................................................................................................... |
|
108 |
1.12.1 |
Conditional statement and branch (IF, ELSE, ENDIF) ............................................................. |
110 |
|
1.12.2 |
Continuous program loop (LOOP, ENDLOOP)......................................................................... |
111 |
|
1.12.3 |
Count loop (FOR ... TO ... |
, ENDFOR) ...................................................................................... |
112 |
1.12.4 |
Program loop with condition at start of loop (WHILE, ENDWHILE).......................................... |
114 |
|
1.12.5 |
Program loop with condition at the end of the loop (REPEAT, UNTIL).................................... |
115 |
|
1.12.6 |
Program example with nested check structures....................................................................... |
115 |
|
1.13 |
Program coordination (INIT, START, WAITM, WAITMC, WAITE, SETM, CLEARM).............. |
116 |
|
1.14 |
Interrupt routine (ASUB)............................................................................................................ |
|
121 |
1.14.1 |
Function of an interrupt routine................................................................................................. |
121 |
|
1.14.2 |
Creating an interrupt routine..................................................................................................... |
123 |
|
1.14.3 |
Assign and start interrupt routine (SETINT, PRIO, BLSYNC) .................................................. |
124 |
|
1.14.4 |
Deactivating/reactivating the assignment of an interrupt routine (DISABLE, ENABLE)........... |
125 |
|
1.14.5 |
Delete assignment of interrupt routine (CLRINT) ..................................................................... |
126 |
|
1.14.6 |
Fast retraction from the contour (SETINT LIFTFAST, ALF)..................................................... |
127 |
|
1.14.7 |
Traversing direction for fast retraction from the contour........................................................... |
129 |
|
1.14.8 |
Motion sequence for interrupt routines ..................................................................................... |
132 |
|
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)......................................................................................... |
138 |
|
1.18 |
Write file (WRITE)..................................................................................................................... |
|
139 |
1.19 |
Delete file (DELETE)................................................................................................................. |
|
144 |
1.20 |
Read lines in the file (READ).................................................................................................... |
146 |
|
1.21 |
Check for presence of file (ISFILE)........................................................................................... |
148 |
|
1.22 |
Read out file information (FILEDATE, FILETIME, FILESIZE, FILESTAT, FILEINFO)............. |
150 |
|
1.23 |
Roundup (ROUNDUP).............................................................................................................. |
|
153 |
1.24 |
Subprogram technique.............................................................................................................. |
|
154 |
1.24.1 |
General information................................................................................................................... |
|
154 |
1.24.1.1 |
Subprogram .............................................................................................................................. |
|
154 |
1.24.1.2 |
Subprogram names................................................................................................................... |
|
155 |
1.24.1.3 |
Nesting of subprograms............................................................................................................ |
|
156 |
1.24.1.4 |
Search path............................................................................................................................... |
|
157 |
1.24.1.5 |
Formal and actual parameters.................................................................................................. |
158 |
|
1.24.1.6 |
Parameter transfer.................................................................................................................... |
|
159 |
1.24.2 |
Definition of a subprogram........................................................................................................ |
161 |
|
1.24.2.1 |
Subprogram without parameter transfer................................................................................... |
161 |
|
1.24.2.2 |
Subprogram with call-by-value parameter transfer (PROC)..................................................... |
162 |
|
1.24.2.3 |
Subprogram with call-by-reference parameter transfer (PROC, VAR)..................................... |
163 |
|
1.24.2.4 |
Save modal G functions (SAVE)............................................................................................... |
166 |
|
1.24.2.5 |
Suppress single block execution (SBLOF, SBLON)................................................................. |
167 |
|
|
|
|
Job Planning |
8 |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Table of contents
|
1.24.2.6 |
Suppress current block display (DISPLOF, DISPLON, ACTBLOCNO)..................................... |
172 |
|
1.24.2.7 |
Identifying subprograms with preparation (PREPRO)............................................................... |
175 |
|
1.24.2.8 |
Subprogram return M17............................................................................................................. |
176 |
|
1.24.2.9 |
RET subprogram return............................................................................................................. |
177 |
|
1.24.2.10 |
Parameterizable subprogram return jump (RET ...) ............................................................. |
178 |
|
1.24.3 |
Subprogram call......................................................................................................................... |
184 |
|
1.24.3.1 |
Subprogram call without parameter transfer.............................................................................. |
184 |
|
1.24.3.2 |
Subprogram call with parameter transfer (EXTERN)................................................................. |
187 |
|
1.24.3.3 |
Number of program repetitions (P)............................................................................................ |
189 |
|
1.24.3.4 |
Modal subprogram call (MCALL)............................................................................................... |
191 |
|
1.24.3.5 |
Indirect subprogram call (CALL)................................................................................................ |
193 |
|
1.24.3.6 |
Indirect subprogram call with specification of the calling program part (CALL BLOCK ... |
|
|
|
TO ...)......................................................................................................................................... |
194 |
|
1.24.3.7 |
Indirect call of a program programmed in ISO language (ISOCALL)........................................ |
195 |
|
1.24.3.8 |
Call subprogram with path specification and parameters (PCALL)........................................... |
196 |
|
1.24.3.9 |
Extend search path for subprogram calls (CALLPATH)............................................................ |
197 |
|
1.24.3.10 Execute external subprogram (840D sl) (EXTCALL)............................................................ |
198 |
|
|
1.24.3.11 Execute external subprogram (828D) (EXTCALL)............................................................... |
202 |
|
|
1.25 |
Macro technique (DEFINE ... AS).............................................................................................. |
205 |
2 |
File and Program Management ............................................................................................................. |
209 |
|
|
2.1 |
Program memory....................................................................................................................... |
209 |
|
2.2 |
Working memory (CHANDATA, COMPLETE, INITIAL)............................................................ |
213 |
3 |
Protection zones.................................................................................................................................... |
217 |
|
|
3.1 |
Defining the protection zones (CPROTDEF, NPROTDEF)....................................................... |
217 |
|
3.2 |
Activating/deactivating protection zones (CPROT, NPROT)..................................................... |
220 |
3.3Checking for protection zone violation, working area limitation and software limit switches
|
|
(CALCPOSI)............................................................................................................................... |
224 |
4 |
Special motion commands..................................................................................................................... |
229 |
|
|
4.1 |
Approaching coded positions (CAC, CIC, CDC, CACP, CACN)............................................... |
229 |
4.2Spline interpolation (ASPLINE, BSPLINE, CSPLINE, BAUTO, BNAT, BTAN, EAUTO,
|
ENAT, ETAN, PW, SD, PL) ....................................................................................................... |
230 |
4.3 |
Spline group (SPLINEPATH)..................................................................................................... |
240 |
4.4 |
NC block compression (COMPON, COMPCURV, COMPCAD, COMPOF).............................. |
241 |
4.5 |
Polynomial interpolation (POLY, POLYPATH, PO, PL)............................................................. |
244 |
4.6 |
Settable path reference (SPATH, UPATH)................................................................................ |
250 |
4.7 |
Measuring with touch-trigger probe (MEAS, MEAW)................................................................ |
253 |
4.8 |
Axial measurement (MEASA, MEAWA, MEAC) (option)........................................................... |
256 |
4.9 |
Special functions for OEM users (OMA1 ... OMA5, OEMIPO1, OEMIPO2, G810 ... G829)..... |
266 |
4.10 |
Feedrate reduction with corner deceleration (FENDNORM, G62, G621)................................. |
267 |
4.11Programmable end of motion criteria (FINEA, COARSEA, IPOENDA, IPOBRKA,
ADISPOSA)................................................................................................................................ |
268 |
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
9 |
Table of contents
5 |
Coordinate transformations (frames) ..................................................................................................... |
271 |
|
|
5.1 |
Coordinate transformation via frame variables......................................................................... |
271 |
|
5.1.1 |
Predefined frame variable ($P_IFRAME, $P_BFRAME, $P_PFRAME, $P_ACTFRAME)....... |
273 |
|
5.2 |
Frame variables / assigning values to frames........................................................................... |
278 |
|
5.2.1 |
Assigning direct values (axis value, angle, scale) .................................................................... |
278 |
|
5.2.2 |
Reading and changing frame components (TR, FI, RT, SC, MI).............................................. |
280 |
|
5.2.3 |
Linking complete frames........................................................................................................... |
282 |
|
5.2.4 |
Defining new frames (DEF FRAME)......................................................................................... |
283 |
|
5.3 |
Coarse and fine offsets (CFINE, CTRANS).............................................................................. |
284 |
|
5.4 |
External zero offset................................................................................................................... |
286 |
|
5.5 |
Preset offset with PRESETON.................................................................................................. |
287 |
|
5.6 |
Frame calculation from three measuring points in space (MEAFRAME)................................. |
288 |
|
5.7 |
NCU global frames.................................................................................................................... |
292 |
|
5.7.1 |
Channel-specific frames ($P_CHBFR, $P_UBFR)................................................................... |
293 |
|
5.7.2 |
Frames active in the channel.................................................................................................... |
294 |
6 |
Transformations..................................................................................................................................... |
299 |
|
|
6.1 |
General programming of transformation types......................................................................... |
299 |
|
6.1.1 |
Orientation movements for transformations.............................................................................. |
301 |
|
6.1.2 |
Overview of orientation transformation TRAORI....................................................................... |
305 |
|
6.2 |
Three, four and five axis transformation (TRAORI).................................................................. |
307 |
|
6.2.1 |
General relationships of universal tool head............................................................................. |
307 |
|
6.2.2 |
Three, four and five axis transformation (TRAORI).................................................................. |
310 |
|
6.2.3 |
Variants of orientation programming and initial setting (ORIRESET)....................................... |
311 |
|
6.2.4 |
Programming the tool orientation (A..., B..., C..., LEAD, TILT)................................................. |
313 |
|
6.2.5 |
Face milling (A4, B4, C4, A5, B5, C5)....................................................................................... |
319 |
|
6.2.6 |
Reference of the orientation axes (ORIWKS, ORIMKS):.......................................................... |
321 |
6.2.7Programming orientation axes (ORIAXES, ORIVECT, ORIEULER, ORIRPY, ORIRPY2,
ORIVIRT1, ORIVIRT2).............................................................................................................. |
323 |
6.2.8Orientation programming along the peripheral surface of a taper (ORIPLANE,
ORICONCW, ORICONCCW, ORICONTO, ORICONIO).......................................................... |
326 |
6.2.9Specification of orientation for two contact points (ORICURVE, PO[XH]=, PO[YH]=,
|
PO[ZH]=)................................................................................................................................... |
329 |
6.3 |
Orientation polynomials (PO[angle], PO[coordinate])............................................................... |
331 |
6.4 |
Rotations of the tool orientation (ORIROTA, ORIROTR, ORIROTT, ORIROTC, THETA)....... |
333 |
6.5 |
Orientations relative to the path................................................................................................ |
336 |
6.5.1 |
Orientation types relative to the path........................................................................................ |
336 |
6.5.2Rotation of the tool orientation relative to the path (ORIPATH, ORIPATHS, angle of
|
rotation)..................................................................................................................................... |
337 |
6.5.3 |
Interpolation of the tool rotation relative to the path (ORIROTC, THETA)................................ |
339 |
6.5.4 |
Smoothing of orientation characteristic (ORIPATHS A8=, B8=, C8=)...................................... |
341 |
6.6 |
Compression of the orientation (COMPON, COMPCURV, COMPCAD).................................. |
342 |
6.7 |
Smoothing the orientation characteristic (ORISON, ORISOF)................................................. |
344 |
6.8 |
Kinematic transformation .......................................................................................................... |
347 |
6.8.1 |
Milling on turned parts (TRANSMIT):........................................................................................ |
347 |
|
|
Job Planning |
10 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Table of contents
|
6.8.2 |
Cylinder surface transformation (TRACYL)............................................................................... |
349 |
|
6.8.3 |
Inclined axis (TRAANG)............................................................................................................. |
357 |
|
6.8.4 |
Inclined axis programming (G5, G7).......................................................................................... |
360 |
|
6.9 |
Cartesian PTP travel.................................................................................................................. |
362 |
|
6.9.1 |
PTP for TRANSMIT ................................................................................................................... |
366 |
|
6.10 |
Constraints when selecting a transformation............................................................................. |
370 |
|
6.11 |
Deselecting a transformation (TRAFOOF) ................................................................................ |
371 |
|
6.12 |
Chained transformations (TRACON, TRAFOOF)...................................................................... |
371 |
7 |
Kinematic chains.................................................................................................................................... |
375 |
|
|
7.1 |
Deletion of components (DELOBJ)............................................................................................ |
375 |
|
7.2 |
Index determination by means of names (NAMETOINT).......................................................... |
377 |
8 |
Collision avoidance with kinematic chains............................................................................................. |
379 |
|
|
8.1 |
Check for collision pair (COLLPAIR) ......................................................................................... |
379 |
|
8.2 |
Requesting a recalculation of the collision model (PROTA)...................................................... |
380 |
|
8.3 |
Setting the protection zone status (PROTS).............................................................................. |
382 |
|
8.4 |
Determining the clearance of two protection zones (PROTD)................................................... |
383 |
9 |
Tool offsets............................................................................................................................................ |
385 |
|
|
9.1 |
Offset memory............................................................................................................................ |
385 |
|
9.2 |
Additive offsets........................................................................................................................... |
388 |
|
9.2.1 |
Selecting additive offsets (DL)................................................................................................... |
388 |
|
9.2.2 |
Specify wear and setup values ($TC_SCPxy[t,d], $TC_ECPxy[t,d])......................................... |
389 |
|
9.2.3 |
Delete additive offsets (DELDL)................................................................................................. |
390 |
|
9.3 |
Special handling of tool offsets.................................................................................................. |
391 |
|
9.3.1 |
Mirroring of tool lengths ............................................................................................................. |
393 |
|
9.3.2 |
Wear sign evaluation ................................................................................................................. |
394 |
9.3.3Coordinate system of the active machining operation (TOWSTD, TOWMCS, TOWWCS,
|
TOWBCS, TOWTCS, TOWKCS)............................................................................................... |
395 |
9.3.4 |
Tool length and plane change.................................................................................................... |
398 |
9.4 |
Online tool offset (PUTFTOCF, FCTDEF, PUTFTOC, FTOCON, FTOCOF)............................ |
399 |
9.5 |
Activate 3D tool offsets (CUT3DC..., CUT3DF...)...................................................................... |
404 |
9.5.1 |
Activating 3D tool offsets (CUT3DC, CUT3DF, CUT3DFS, CUT3DFF, ISD)............................ |
404 |
9.5.2 |
3D tool offset peripheral milling, face milling ............................................................................. |
406 |
9.5.3 |
3D tool offset Tool shapes and tool data for face milling........................................................... |
408 |
9.5.4 |
3D tool offset Offset on the path, path curvature, insertion depth (CUT3DC, ISD)................... |
409 |
9.5.5 |
3D tool offset Inside/outside corners and intersection procedure (G450/G451) ....................... |
412 |
9.5.6 |
3D tool offset 3D circumferential milling with limitation surfaces............................................... |
413 |
9.5.7 |
3D tool offset: Taking into consideration a limitation surface (CUT3DCC, CUT3DCCD).......... |
414 |
9.6 |
Tool orientation (ORIC, ORID, OSOF, OSC, OSS, OSSE, ORIS, OSD, OST)......................... |
418 |
9.7 |
Free assignment of D numbers, cutting edge numbers............................................................. |
424 |
9.7.1 |
Free assignment of D numbers, cutting edge numbers (CE address)...................................... |
424 |
9.7.2 |
Free assignment of D numbers: Checking D numbers (CHKDNO)........................................... |
424 |
9.7.3 |
Free assignment of D numbers: Rename D numbers (GETDNO, SETDNO)........................... |
425 |
Job Planning |
|
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
11 |
Table of contents
9.7.4Free assignment of D numbers: Determine T number to the specified D number
|
(GETACTTD) ............................................................................................................................ |
426 |
9.7.5 |
Free assignment of D numbers: Invalidate D numbers (DZERO) ............................................ |
427 |
9.8 |
Toolholder kinematics............................................................................................................... |
427 |
9.9Tool length compensation for orientable toolholders (TCARR, TCOABS, TCOFR,
|
TCOFRX, TCOFRY, TCOFRZ)................................................................................................. |
433 |
9.10 |
Online tool length compensation (TOFFON, TOFFOF)............................................................ |
436 |
9.11 |
Cutting data modification for tools that can be rotated (CUTMOD).......................................... |
439 |
10 Path traversing behavior........................................................................................................................ |
445 |
|
10.1 |
Tangential control (TANG, TANGON, TANGOF, TLIFT, TANGDEL)....................................... |
445 |
10.2 |
Feedrate characteristic (FNORM, FLIN, FCUB, FPO).............................................................. |
452 |
10.3 |
Acceleration behavior................................................................................................................ |
457 |
10.3.1 |
Acceleration mode (BRISK, BRISKA, SOFT, SOFTA, DRIVE, DRIVEA) ................................ |
457 |
10.3.2 |
Influence of acceleration on following axes (VELOLIMA, ACCLIMA, JERKLIMA)................... |
459 |
10.3.3Activation of technology-specific dynamic values (DYNNORM, DYNPOS, DYNROUGH,
|
DYNSEMIFIN, DYNFINISH) ..................................................................................................... |
461 |
10.4 |
Traversing with feedforward control (FFWON, FFWOF).......................................................... |
463 |
10.5 |
Programmable contour accuracy (CPRECON, CPRECOF)..................................................... |
464 |
10.6Program sequence with preprocessing memory (STOPFIFO, STARTFIFO, FIFOCTRL,
|
STOPRE).................................................................................................................................. |
466 |
10.7 |
Program sections that can be conditionally interrupted (DELAYFSTON, DELAYFSTOF)....... |
469 |
10.8 |
Prevent program position for SERUPRO (IPTRLOCK, IPTRUNLOCK)................................... |
474 |
10.9Repositioning to the contour (REPOSA, REPOSL, REPOSQ, REPOSQA, REPOSH,
|
REPOSHA, DISR, DISPR, RMIBL, RMBBL, RMEBL, RMNBL)............................................... |
476 |
10.10 |
Influencing the motion control................................................................................................... |
484 |
10.10.1 |
Percentage jerk correction (JERKLIM) ..................................................................................... |
484 |
10.10.2 |
Percentage velocity correction (VELOLIM)............................................................................... |
486 |
10.10.3 |
Program example for JERKLIM and VELOLIM......................................................................... |
488 |
10.11 |
Programmable contour/orientation tolerance (CTOL, OTOL, ATOL)....................................... |
488 |
10.12 |
Tolerance for G0 motion (STOLF)............................................................................................ |
492 |
10.13 |
Block change behavior with active coupling (CPBC)................................................................ |
494 |
11 Axis couplings........................................................................................................................................ |
495 |
|
11.1 |
Coupled motion (TRAILON, TRAILOF)..................................................................................... |
495 |
11.2 |
Curve tables (CTAB)................................................................................................................. |
500 |
11.2.1 |
Define curve tables (CTABDEF, CATBEND)............................................................................ |
501 |
11.2.2 |
Check for presence of curve table (CTABEXISTS).................................................................. |
507 |
11.2.3 |
Delete curve tables (CTABDEL)............................................................................................... |
507 |
11.2.4 |
Locking curve tables to prevent deletion and overwriting (CTABLOCK, CTABUNLOCK)....... |
509 |
11.2.5Curve tables: Determine table properties (CTABID, CTABISLOCK, CTABMEMTYP,
CTABPERIOD).......................................................................................................................... |
510 |
11.2.6Read curve table values (CTABTSV, CTABTEV, CTABTSP, CTABTEP, CTABSSV,
|
CTABSEV, CTAB, CTABINV, CTABTMIN, CTABTMAX) |
......................................................... 512 |
|
|
Job Planning |
12 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Table of contents
11.2.7Curve tables: Check use of resources (CTABNO, CTABNOMEM, CTABFNO, CTABSEGID, CTABSEG, CTABFSEG, CTABMSEG, CTABPOLID, CTABPOL,
|
CTABFPOL, CTABMPOL)......................................................................................................... |
517 |
11.3 |
Axial master value coupling (LEADON, LEADOF) .................................................................... |
518 |
11.4 |
Electronic gear (EG) .................................................................................................................. |
523 |
11.4.1 |
Defining an electronic gear (EGDEF)........................................................................................ |
524 |
11.4.2 |
Switch-in the electronic gearbox (EGON, EGONSYN, EGONSYNE)....................................... |
525 |
11.4.3 |
Switching-in the electronic gearbox (EGOFS, EGOFC)............................................................ |
529 |
11.4.4 |
Deleting the definition of an electronic gear (EGDEL)............................................................... |
530 |
11.4.5 |
Rotational feedrate (G95) / electronic gear (FPR)..................................................................... |
530 |
11.5 |
Synchronous spindle.................................................................................................................. |
531 |
11.5.1Synchronous spindle: Programming (COUPDEF, COUPDEL, COUPON, COUPONC,
|
|
COUPOF, COUPOFS, COUPRES, WAITC)............................................................................. |
531 |
|
11.6 |
Generic coupling (CP...)............................................................................................................. |
541 |
|
11.7 |
Master/slave coupling (MASLDEF, MASLDEL, MASLON, MASLOF, MASLOFS)................... |
549 |
12 |
Synchronized actions............................................................................................................................. |
553 |
|
|
12.1 |
Definition of a synchronized action............................................................................................ |
553 |
13 |
Oscillation.............................................................................................................................................. |
555 |
13.1Asynchronous oscillation (OS, OSP1, OSP2, OST1, OST2, OSCTRL, OSNSC, OSE,
|
|
OSB) .......................................................................................................................................... |
555 |
|
13.2 |
Oscillation controlled by synchronized actions (OSCILL).......................................................... |
560 |
14 |
Punching and nibbling ........................................................................................................................... |
569 |
|
|
14.1 |
Activation, deactivation.............................................................................................................. |
569 |
14.1.1Punching and nibbling on or off (SPOF, SON, PON, SONS, PONS, PDELAYON,
|
|
PDELAYOF, PUNCHACC) ........................................................................................................ |
569 |
|
14.2 |
Automatic path segmentation .................................................................................................... |
574 |
|
14.2.1 |
Path segmentation for path axes ............................................................................................... |
577 |
|
14.2.2 |
Path segmentation for single axes ............................................................................................. |
579 |
15 |
Grinding |
................................................................................................................................................. |
581 |
|
15.1 |
Grinding - specific tool monitoring in the part program (TMON, TMOF) ...................................... |
581 |
16 |
Additional ................................................................................................................................functions |
583 |
|
|
16.1 ................. |
Axis functions (AXNAME, AX, SPI, AXTOSPI, ISAXIS, AXSTRING, MODAXVAL) |
583 |
|
16.2 ...................................................................................... |
Replaceable geometry axes (GEOAX) |
585 |
|
16.3 .......................................................... |
Axis container (AXCTSWE, AXCTSWED, AXCTSWEC) |
590 |
|
16.4 ..................................................................................... |
Wait for valid axis position (WAITENC) |
592 |
|
16.5 .............................................................. |
Programmable parameter set changeover (SCPARA) |
593 |
|
16.6 ................................................................... |
Check scope of NC language present (STRINGIS) |
594 |
|
16.7 ...................................................... |
Interactively call the window from the part program (MMC) |
598 |
|
16.8 .................................................................................................... |
Program runtime/part counter |
600 |
|
16.8.1 .................................................................................. |
Program runtime/part counter (overview) |
600 |
Job Planning |
|
|
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
13 |
Table of contents
16.8.2 |
Program runtime ....................................................................................................................... |
600 |
16.8.3 |
Workpiece counter.................................................................................................................... |
604 |
16.9 |
Process DataShare - output to an external device/file (EXTOPEN, WRITE, EXTCLOSE)...... |
605 |
16.10 |
Alarms (SETAL)........................................................................................................................ |
614 |
16.11 |
Extended stop and retract (ESR).............................................................................................. |
616 |
16.11.1 |
NC-controlled ESR.................................................................................................................... |
617 |
16.11.1.1 NC-controlled retraction (POLF, POLFA, POLFMASK, POLFMLIN) .................................. |
617 |
|
16.11.1.2 |
NC-controlled stopping ........................................................................................................ |
621 |
16.11.2 |
Drive-integrated ESR................................................................................................................ |
622 |
16.11.2.1 Configuring drive-integrated stopping (ESRS)..................................................................... |
622 |
|
16.11.2.2 Configuring drive-integrated retraction (ESRS)................................................................... |
623 |
|
17 User stock removal programs................................................................................................................ |
625 |
|
17.1 |
Supporting functions for stock removal..................................................................................... |
625 |
17.2 |
Generate contour table (CONTPRON)..................................................................................... |
626 |
17.3 |
Generate coded contour table (CONTDCON).......................................................................... |
632 |
17.4 |
Determine point of intersection between two contour elements (INTERSEC) ......................... |
635 |
17.5 |
Execute the contour elements of a table block-by-block (EXECTAB)...................................... |
637 |
17.6 |
Calculate circle data (CALCDAT) ............................................................................................. |
638 |
17.7 |
Deactivate contour preparation (EXECUTE) ............................................................................ |
640 |
18 Programming cycles externally.............................................................................................................. |
641 |
|
18.1 |
Technology cycles..................................................................................................................... |
641 |
18.1.1 |
Introduction ............................................................................................................................... |
641 |
18.1.2 |
Drilling, centering - CYCLE81................................................................................................... |
642 |
18.1.3 |
Drilling, counterboring - CYCLE82............................................................................................ |
643 |
18.1.4 |
Reaming - CYCLE85................................................................................................................. |
644 |
18.1.5 |
Deep-hole drilling - CYCLE83................................................................................................... |
645 |
18.1.6 |
Boring - CYCLE86..................................................................................................................... |
648 |
18.1.7 |
Tapping without compensating chuck - CYCLE84 ................................................................... |
649 |
18.1.8 |
Tapping with compensating chuck - CYCLE840....................................................................... |
652 |
18.1.9 |
Thread milling - CYCLE78 ........................................................................................................ |
654 |
18.1.10 |
Freely programmable positions - CYCLE802 ........................................................................... |
656 |
18.1.11 |
Row of holes - HOLES1............................................................................................................ |
657 |
18.1.12 |
Grid or frame - CYCLE801........................................................................................................ |
658 |
18.1.13 |
Circle of holes - HOLES2.......................................................................................................... |
659 |
18.1.14 |
Face milling - CYCLE61............................................................................................................ |
661 |
18.1.15 |
Milling a rectangular pocket - POCKET3.................................................................................. |
662 |
18.1.16 |
Milling a circular pocket - POCKET4......................................................................................... |
665 |
18.1.17 |
Rectangular spigot milling - CYCLE76...................................................................................... |
667 |
18.1.18 |
Circular spigot milling - CYCLE77............................................................................................. |
669 |
18.1.19 |
Multiple-edge - CYCLE79 ......................................................................................................... |
671 |
18.1.20 |
Longitudinal slot - SLOT1.......................................................................................................... |
673 |
18.1.21 |
Circumferential slot - SLOT2..................................................................................................... |
675 |
18.1.22 |
Mill open slot - CYCLE899........................................................................................................ |
677 |
18.1.23 |
Elongated hole - LONGHOLE................................................................................................... |
679 |
18.1.24 |
Thread milling - CYCLE70 ........................................................................................................ |
681 |
18.1.25 |
Engraving cycle - CYCLE60...................................................................................................... |
683 |
|
Job Planning |
|
14 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Table of contents
|
18.1.26 |
Contour call - CYCLE62............................................................................................................. |
685 |
|
18.1.27 |
Path milling - CYCLE72............................................................................................................. |
685 |
|
18.1.28 |
Predrilling a contour pocket - CYCLE64.................................................................................... |
688 |
|
18.1.29 |
Milling a contour pocket - CYCLE63.......................................................................................... |
689 |
|
18.1.30 |
Stock removal - CYCLE951....................................................................................................... |
692 |
|
18.1.31 |
Groove - CYCLE930.................................................................................................................. |
694 |
|
18.1.32 |
Undercut forms - CYCLE940..................................................................................................... |
696 |
|
18.1.33 |
Thread turning - CYCLE99 ........................................................................................................ |
699 |
|
18.1.34 |
Thread chain - CYCLE98........................................................................................................... |
702 |
|
18.1.35 |
Cut-off - CYCLE92..................................................................................................................... |
705 |
|
18.1.36 |
Contour cutting - CYCLE95 ....................................................................................................... |
706 |
|
18.1.37 |
Contour grooving - CYCLE952.................................................................................................. |
708 |
|
18.1.38 |
Swiveling - CYCLE800............................................................................................................... |
712 |
|
18.1.39 |
High Speed Settings - CYCLE832............................................................................................. |
714 |
19 |
Tables.................................................................................................................................................... |
|
717 |
|
19.1 |
Operations.................................................................................................................................. |
717 |
|
19.2 |
Operations: Availability for SINUMERIK 828D .......................................................................... |
778 |
|
19.3 |
Currently set language in the HMI............................................................................................. |
802 |
A |
Appendix..................................................... |
........................................................................................... |
803 |
|
A.1 |
List of abbreviations................................................................................................................... |
803 |
|
A.2 |
Documentation overview............................................................................................................ |
812 |
|
Glossary ................................................................................................................................................ |
|
813 |
|
Index...................................................................................................................................................... |
|
835 |
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
15 |
Table of contents
|
Job Planning |
16 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Flexible NC programming |
1 |
The use of variables, especially in conjunction with arithmetic functions and check structures, enables part programs and cycles to be set up with extremely high levels of flexibility. The system provides three different types of variables.
●System variables
System variables are variables with a fixed predefined meaning; they are defined in the system and made available to the user. They are also read and written by the system software. Example: Machine data
The meaning of a system variable is permanently set by the system. However, minor modifications can be made to the properties by the user in the form of redefinition. See "Redefinition of system variables, user variables, and NC language commands (REDEF) (Page 29)"
●User variables
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 29)".
–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 24)"
System variables are variables which are predefined in the system and enable access to the current parameter settings of the control, as well as to machine, control, and process states, in part programs and cycles.
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
17 |
Flexible NC programming
1.1 Variables
Preprocessing variables
Preprocessing variables are system variables that are read and written in the context of preprocessing; in other words, at the point in time at which the part program block in which the system variable is programmed is interpreted. Preprocessing variables do not trigger preprocessing stops.
Main run variables
Main run variables are system variables which are read and written in the context of the main run; in other words at the point in time at which the part program block in which the system variable is programmed is executed. The following are main run variables:
●System variables which can be programmed in synchronized actions (read/write)
●System variables which can be programmed in the part program and trigger preprocessing stops (read/write)
●System variables which can be programmed in the part program and whose value is calculated during preprocessing but not written until the main run (main run synchronized: write only)
Prefix system
In order that they can be specifically identified, the names of system variables are usually preceded by a prefix comprising the $ sign followed by one or two letters and an underscore.
|
$ + 1st letter |
Meaning: Data type |
|
System variables which are read/written during preprocessing |
|
|
$M |
Machine data 1) |
|
$S |
Setting data, protection zones 1) |
|
$T |
Tool management data |
|
$P |
Programmed values |
|
$C |
Cycle variables of ISO envelope cycles |
|
$O |
Option data |
|
R |
R-parameters (arithmetic parameters) 2) |
|
System variables which are read/written during the main run |
|
|
$$M |
Machine data 1) |
|
$$S |
Setting data 1) |
|
$A |
Current main run data |
|
$V |
Servo data |
|
$R |
R-parameters (arithmetic parameters) 2) |
|
1) Whether machine and setting data is treated as preprocessing or main run variables depends on |
|
|
whether they are written with one or two $ characters. The notation is freely selectable for the specific |
|
|
application. |
|
|
2) When an R-parameter is used in the part program/cycle as a preprocessing variable, the prefix is |
|
|
omitted, e.g. R10. When it is used in a synchronized action as a main run variable, a $ sign is written |
|
|
as a prefix, e.g. $R10. |
|
|
|
Job Planning |
18 |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Flexible NC programming
1.1 Variables
2nd letter |
Meaning: Visibility |
NNCK-global variable (NCK)
CChannel-specific variable (Channel)
AAxis-specific variable (Axis)
Supplementary conditions
Exceptions in the prefix system
The following system of variables deviate from the prefix system specified above:
●$TC_...: Here, the 2nd letter C does not refer to channel-specific system variables but to toolholder-specific system variables (TC= tool carrier).
●$P_ ...: Channel-specific system variables
Use of machine and setting data in synchronized actions
When machine and setting data is used in synchronized actions, the prefix can be used to define whether the machine or setting data will be read/written synchronous to the preprocessing run or the main run.
If the data remains unchanged during machining, it can be read synchronous to the preprocessing run. For this purpose, the machine or setting data prefix is written with a $ sign:
ID=1 WHENEVER $AA_IM[z] < $SA_OSCILL_REVERSE_POS2[Z]–6 DO $AA_OVR[X]=0
If the data changes during machining, it must be read/written synchronous to the main run. For this purpose, the machine or setting data prefix is written with two $ signs:
ID=1 WHENEVER $AA_IM[z] < $$SA_OSCILL_REVERSE_POS2[Z]–6 DO $AA_OVR[X]=0
Note
Writing machine data
When writing an item of machine or setting data, it is important to ensure that the access level which is active when the part program/cycle is executed permits write access and that the data is set to take "IMMEDIATE" effect.
References
A list of the properties of all system variables appears in:
Parameter Manual, System Variables
See also
Variables (Page 17)
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
19 |
Flexible NC programming
1.1 Variables
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>]
Meaning
R: |
Identifier when used as a preprocessing variable, e.g. in the part program |
|
$R: |
Identifier when used as a main run variable, e.g. in synchronized actions |
|
|
Type: |
REAL |
|
Range of values: For a non-exponential notation: |
|
|
|
± (0.000 0001 ... 9999 9999) |
|
|
Note: |
|
|
A maximum of 8 decimal places are permitted. |
|
|
For an exponential notation: |
|
|
± (1*10-300 ... 1*10+300) |
|
|
Note: |
|
|
Notation: <Mantisse>EX<exponent> e.g. 8.2EX-3 |
|
|
A maximum of 10 characters are permitted including |
|
|
sign and decimal point. |
<n>: |
Number of the R parameter |
|
|
Type: |
INT |
|
Range of values: 0 - MAX_INDEX |
|
|
|
Note |
|
|
MAX_INDEX is calculated from the parameterized number |
|
|
of R-parameters: |
|
|
MAX_INDEX = (MD28050 $MN_MM_NUM_R_PARAM) - 1 |
<expression>: |
Array index |
|
|
Any expression can be used as an array index, as long as the result of the |
|
|
expression can be converted to the INT data type (INT, REAL, BOOL, |
|
|
CHAR). |
|
|
|
Job Planning |
20 |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Flexible NC programming
1.1 Variables
Example
Assignments to R-parameters and use of R-parameters in mathematical functions:
Program code |
Comment |
|
|
R0=3.5678 |
; |
Assignment in |
preprocessing |
R[1]=-37.3 |
; |
Assignment in |
preprocessing |
R3=-7 |
; |
Assignment in |
preprocessing |
$R4=-0.1EX-5 |
; |
Assignment in |
main run: R4 = -0.1 * 10^-5 |
$R[6]=1.874EX8 |
; |
Assignment in |
main run: R6 = 1.874 * 10^8 |
R7=SIN(25.3) |
; |
Assignment in |
preprocessing |
R[R2]=R10 |
; |
Indirect addressing using R-parameter |
|
R[(R1+R2)*R3]=5 |
; Indirect addressing using math. expression |
||
X=(R1+R2) |
; |
Traverse axis |
X to the position resulting from the |
|
|
sum of R1 and |
R2 |
Z=SQRT(R1*R1+R2*R2) |
; |
Traverse axis |
Z to the square root position (R1^2 + |
|
|
R2^2) |
|
See also
Variables (Page 17)
Function
Link variables can be used in the context of the "NCU-Link" function for cyclic data exchange between NCUs which are linked on a network. They facilitate data-format-specific access to the link variables memory. The link variables memory is defined both in terms of size and data structure on a system-specific basis by the user/machine manufacturer.
Link variables are system-global user variables which can be read and written in part programs and cycles by all NCUs involved in a link if link communication has been configured. Unlike global user variables (GUD), link variables can also be used in synchronized actions.
On systems without an active NCU link, link variables can be used locally on the controller as additional global user variables alongside global user variables (GUD).
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
21 |
Flexible NC programming
1.1 Variables
Syntax
$A_DLB[<index>] $A_DLW[<index>] $A_DLD[<index>] $A_DLR[<index>]
Meaning
$A_DLB: Link variable for BYTE data format (1 byte)
Data type: |
UINT |
Range of values: 0 ... 255
$A_DLW: Link variable for WORD data format (2 bytes)
Data type: |
INT |
Range of values: -32768 ... 32767
$A_DLD: Link variable for DWORD data format (4 bytes)
Data type: |
INT |
Range of values: -2147483648 ... 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)
<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, ...
–$A_DLW[i]: i = 0, 2, 4, ...
–$A_DLD[i]: i = 0, 4, 8, ...
–$A_DLR[i]: i = 0, 8, 16, ...
Example
An automation system contains 2 NCUs (NCU1 and NCU2). Machine axis AX2 is connected to NCU1. It is traversed as a link axis of NCU2.
NCU1 writes the actual current value ($VA_CURR) of axis AX2 cyclically to the link variables memory. NCU2 reads the actual current value transmitted via link communication cyclically and displays alarm 61000 if the limit value is exceeded.
|
Job Planning |
22 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Flexible NC programming
1.1 Variables
The data structure in the link variables memory is illustrated in the following figure. The actual current value is transmitted in the REAL value.
/LQN YDULDEOHV PHPRU\ 0' 01B00B6,=(2)B/,1.9$5B'$7$
,QGH[ |
%<7( |
%<7( |
|
:25' |
|
':25' |
|
|
|
|
|
|
|
|
':25' |
|
|
':25' |
||
|
|
|
|
|
|
|
|
|
|
|
|
5($/ |
|
|
|
|
|
|
|
|
NCU1
NCU1 uses link variable $A_DLR[ 16 ] to write the actual current value of axis AX2 to the link variables memory cyclically in the interpolation cycle in a static synchronized action.
Program code
N111 IDS=1 WHENEVER TRUE DO $A_DLR[16]=$VA_CURR[AX2]
NCU2
NCU2 uses link variable $A_DLR[ 16 ] to read the actual current value of axis AX2 from the link variables memory cyclically in the interpolation cycle in a static synchronized action. If the actual current value is greater than 23.0 A, alarm 61000 is displayed.
Program code
N222 IDS=1 WHEN $A_DLR[16] > 23.0 DO SETAL(61000)
See also
Variables (Page 17)
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
23 |
Flexible NC programming
1.1 Variables
Function
The DEF command is used to define user-specific variables and assign values to them. To set them apart from system variables, these are called user-defined variables or user variables (user data).
According to the range of validity (in other words, the range in which the variable is visible) there are the following categories of user variable:
●Local user variables (LUD)
Local user variables (LUD) are variables defined in a part program which is not the main program at the time of execution. They are created when the part program is called and deleted at the end of the part program or when the NC is reset. Local user variables can only be accessed within the part program in which they are defined.
●Program-global user variables (PUD)
Program-global user variables (PUD) are user variables defined in a part program used as the main program. They are created when the part program starts up and deleted at the end of the part program or when the NC is reset. It is possible to access PUD in the main program and in all subprograms of the main program.
●Global user variables (GUD)
Global user variables (GUD) are NC or channel-global variables which are defined in a data block (SGUD, MGUD, UGUD, GUD4 to GUD9) and are retained following shutdown and restart. GUD can be accessed in all part programs.
User variables must be defined before they can be used (read/write). The following rules must be observed in this context:
●GUD have to be defined in a definition file, e.g. _N_DEF_DIR/_M_SGUD_DEF.
●PUD and LUD have to be defined in a definition section of the part program.
●The data must be defined in a dedicated block.
●Only one data type may be used for each data definition.
●Several variables of the same data type can be defined for each data definition.
Syntax
LUD and PUD
DEF <type> <phys_unit> <limit values> <name>[<value_1>, <value_2>, <value_3>]=<init_value>
GUD
DEF <range> <pp_stop> <access_rights> <type> <phys_unit> <limit values> <name>[<value_1>, <value_2>, <value_3>]=<init_value>
|
Job Planning |
24 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Flexible NC programming
1.1 Variables
Meaning
DEF: |
Command for defining GUD, PUD, LUD user variables |
||
<range>: |
Range of validity, only relevant for GUD: |
||
|
NCK: |
NC-global user variable |
|
<PP_stop>: |
CHAN: |
Channel-global user variable |
|
Preprocessing stop, only relevant for GUD (optional) |
|||
|
SYNR: |
Preprocessing stop when reading |
|
|
SYNW: |
Preprocessing stop when writing |
|
<access rights>: |
SYNRW: |
Preprocessing stop when reading/writing |
|
Protection level for reading/writing GUD via part program or OPI |
|||
|
(optional) |
|
|
|
APRP <protection level>: Read: Part program |
||
|
APWP <protection level>: Write: Part program |
||
|
APRB <protection level>: Read: OPI |
||
|
APWB <protection level>: Write: OPI |
||
|
<protection level>: |
Range of values: 0 ... 7 |
|
|
See "Attribute: Access rights (APR, APW, APRP, APWP, APRB, |
||
|
APWB) (Page 39)" |
|
|
<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 52)" |
||
<phys_unit>: |
Physical unit (optional) |
|
|
|
PHU <unit>: |
|
Physical unit |
|
See "Attribute: Physical unit (PHU) (Page 37)" |
||
<limit values>: |
Lower/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 35)" |
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
25 |
Flexible NC programming
1.1 Variables
<name>: |
Name of variable |
|
Note |
|
Maximum 31 characters |
|
The first two characters must be a letter and/or an underscore. |
|
The $ sign is reserved for system variables and must not be |
|
used. |
[<value_1>, <value_2>,
<value_3>]:
<init_value>:
Specification of array sizes for 1- to max. 3-dimensional array variables (optional)
For the Initialization of array variables see "Definition and initialization of array variables (DEF, SET, REP) (Page 45)"
Initialization value (optional)
See "Attribute: Initialization value (Page 32)"
For the Initialization of array variables see "Definition and initialization of array variables (DEF, SET, REP) (Page 45)"
Examples
Example 1: Definition of user variables in the data block for machine manufacturers
Program code |
Comment |
%_N_MGUD_DEF |
; GUD block: Machine manufacturer |
$PATH=/_N_DEF_DIR |
|
DEF CHAN REAL PHU 24 LLI 0 ULI 10 STROM_1, STROM_2 |
|
;Description |
|
;Definition of two GUD items: STROM_1, STROM_2 |
|
;Range of validity: Throughout the channel ;Data type: REAL
PP stop: Not programmed => default value = no PP stop ;Physical unit: 24 = [A]
;Limit values: Low = 0.0, high = 10.0
;Access rights: Not programmed => default value = 7 = key-operated switch position 0 ;Initialization value: Not programmed => default value = 0.0
DEF NCK REAL PHU 13 LLI 10 APWP 3 APRP 3 APWB 0 APRB 2 ZEIT_1=12, ZEIT_2=45 ;Description
;Definition of two GUD items: ZEIT_1, ZEIT_2 ;Range of validity: Throughout the NCK
;Data type: REAL
PP stop: Not programmed => default value = no PP stop ;Physical unit: 13 = [s]
;Limit values: low = 10.0, high = not programmed => upper definition range limit
|
Job Planning |
26 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Flexible NC programming
1.1 Variables
Program |
code |
|
|
|
|
Comment |
;Access |
rights: |
|
|
|
|
|
;Part program: Write/read = 3 |
= |
end |
user |
|||
;OPI: Write = 0 |
= Siemens, read |
= 3 |
= |
end user |
||
;Initialization |
value: ZEIT_1 |
= |
12.0, |
ZEIT_2 = 45.0 |
DEF NCK APWP 3 APRP 3 APWB 0 APRB 3 STRING[5] GUD5_NAME = "COUNTER" ;Description
;Definition of one GUD item: GUD5_NAME ;Range of validity: Throughout the NCK ;Data type: STRING, max. 5 characters
PP stop: Not programmed => default value = no PP stop
;Physical unit: Not programmed => default value = 0 = no phys. unit
;Limit values: Not programmed => definition range limits: low = 0, high = 255 ;Access rights:
;Part program: Write/read = 3 = end user
;OPI: Write = 0 = Siemens, read = 3 = end user ;Initialization value: "COUNTER"
M30
Example 2: Global program and local user variables (PUD/LUD)
Program code |
Comment |
PROC MAIN |
;Main program |
DEF INT VAR1 |
;PUD definition |
... |
|
SUB2 |
;Subprogram call |
... |
|
M30 |
|
Program code |
Comment |
PROC SUB2 |
;Subprogram SUB2 |
DEF INT VAR2 |
;LUD DEFINITION |
... |
|
IF (VAR1==1) |
;Read PUD |
VAR1=VAR1+1 |
;Read & write PUD |
VAR2=1 |
;Write LUD |
ENDIF |
|
SUB3 |
;subprogram call |
... |
|
M17 |
|
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
27 |
Flexible NC programming
1.1 Variables
Program code |
Comment |
PROC SUB3 |
;Subprogram SUB3 |
... |
|
IF (VAR1==1) |
;Read PUD |
VAR1=VAR1+1 |
;Read & write PUD |
VAR2=1 |
;Error: LUD from SUB2 not known |
ENDIF |
|
... |
|
M17 |
|
Example 3: Definition and use of user variables of data type AXIS
Program code |
Comment |
DEF AXIS ABSCISSA |
;1st geometry axis |
DEF AXIS SPINDLE |
;Spindle |
... |
|
IF ISAXIS(1) == FALSE GOTOF CONTINUE |
|
ABSCISSA = $P_AXN1 |
|
CONTINUE: |
|
... |
|
SPINDLE=(S1) |
;1st spindle |
OVRA[SPINDLE]=80 |
;Spindle override = 80% |
SPINDLE=(S3) |
;3rd spindle |
Supplementary conditions
Global user variables (GUD)
In the context of the definition of global user variables (GUD), the following machine data has to be taken into account:
|
No. |
Identifier: $MN_ |
Meaning |
|
11140 |
GUD_AREA_ SAVE_TAB |
Additional save for GUD blocks |
|
18118 1) |
MM_NUM_GUD_MODULES |
Number of GUD files in the active file system |
|
18120 1) |
MM_NUM_GUD_NAMES_NCK |
Number of global GUD names |
|
18130 1) |
MM_NUM_GUD_NAMES_CHAN |
Number of channel-spec. GUD names |
|
18140 1) |
MM_NUM_GUD_NAMES_AXIS |
Number of axis-spec. GUD names |
|
18150 1) |
MM_GUD_VALUES_MEM |
Memory location for global GUD values |
|
18660 1) |
MM_NUM_SYNACT_GUD_REAL |
Number of configurable GUD of the REAL data type |
|
18661 1) |
MM_NUM_SYNACT_GUD_INT |
Number of configurable GUD of the INT data type |
|
18662 1) |
MM_NUM_SYNACT_GUD_BOOL |
Number of configurable GUD of the BOOL data type |
|
18663 1) |
MM_NUM_SYNACT_GUD_AXIS |
Number of configurable GUD of the AXIS data type |
|
18664 1) |
MM_NUM_SYNACT_GUD_CHAR |
Number of configurable GUD of the CHAR data type |
|
18665 1) |
MM_NUM_SYNACT_GUD_STRING |
Number of configurable GUD of the STRING data type |
|
1) For SINUMERIK 828D, MD can only be read! |
|
|
|
|
|
Job Planning |
28 |
|
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
Flexible NC programming
1.1 Variables
Program-global user variables (PUD)
Note
Visibility of program-global user variables (PUD)
Program-global user variables (PUD) defined in the main program will only be visible in subprograms if the following machine data is set:
MD11120 $MN_LUD_EXTENDED_SCOPE = 1
If MD11120 = 0 the program-global user variables defined in the main program will only be visible in the main program.
Cross-channel use of an NCK-global user variable of the AXIS data type
An NCK-global user variable of the AXIS data type initialized during definition in the data block with an axis identifier can then only be used in other NC channels if the axis has the same channel axis number in these channels.
If this is not the case, the variable has to be loaded at the start of the part program or, as in the following example, the AXNAME(...) function has to be used.
Program |
code |
Comment |
|
|
DEF NCK |
STRING[5] ACHSE="X" |
;Definition |
in the data block |
|
... |
|
|
|
|
N100 AX[AXNAME(ACHSE)]=111 G00 |
;Use in |
the |
part program |
Function
The REDEF command can be used to change the attributes of system variables, user variables and NC language commands. A fundamental condition of redefinition is that it has to post-date the corresponding definition.
Multiple attributes cannot be changed simultaneously during redefinition. A separate REDEF statement has to be programmed for each attribute to be changed.
If two or more concurrent attribute changes are programmed, the last change is always active.
Job Planning |
|
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |
29 |
Flexible NC programming
1.1 Variables
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:
●Access rights: Protection level 7
●Initialization time: No initialization or retention of the current value
Redefinable attributes
See "Overview of definable and redefinable attributes (Page 44)"
Local user variables (PUD/LUD)
Redefinitions are not permitted for local user variables (PUD/LUD).
Syntax
REDEF <name> <PP_stop>
REDEF <name> <phys_unit>
REDEF <name> <limit_values>
REDEF <name> <access_rights>
REDEF <name> <init_time>
REDEF <name> <init_time> <init_value>
REDEF <name>
Meaning
REDEF: |
Command for redefinition of a certain attribute or to reset the |
|
|
"Access rights" and/or "Initialization time" attributes of system |
|
|
variables, user variables and NC language commands |
|
<name>: |
Name of an already defined variable or an NC language |
|
|
command |
|
<PP stop>: |
Preprocessing stop |
|
|
SYNR: |
Preprocessing stop when reading |
|
SYNW: |
Preprocessing stop when writing |
<phys_unit>: |
SYNRW: |
Preprocessing stop when reading/writing |
Physical unit |
||
|
PHU <unit>: |
Physical unit |
|
See "Attribute: Physical unit (PHU) (Page 37)" |
|
|
Note |
|
|
Cannot be redefined for: |
|
|
System variables |
|
|
Global user data (GUD) of the data types: BOOL, AXIS, STRING, |
|
FRAME |
|
Job Planning |
30 |
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1 |