siemens 840D Programming Manual

4 (1)

SINUMERIK

SINUMERIK

840D sl/840Di sl/840D/840Di/810D Job planning

Programming Manual

Valid for

Control

SINUMERIK 840D sl/840DE sl SINUMERIK 840Di sl/840DiE sl

SINUMERIK 840D powerline/840DE powerline SINUMERIK 840Di powerline/840DiE powerline SINUMERIK 810D powerline/810DE powerline

Software

Version

NCU system software for 840D sl/840DE sl 1.4

NCU system software for 840Di sl/DiE sl

1.0

NCU system software for 840D/840DE

7.4

NCU system software for 840Di/840DiE

3.3

NCU system software for 810D/810DE

7.4

11/2006

 

6FC5398-2BP10-2BA0

 

Preface

Flexible NC programming

1

 

 

Subroutines, Macros

2

File and Program

 

3

Management

 

 

Protection zones

4

 

 

Special Motion Commands

5

 

 

Frames

6

 

 

Transformations

7

 

 

Tool offsets

8

 

 

Path traversing behavior

9

 

 

Motion synchronous actions

10

 

 

Oscillation

11

 

 

Punching and nibbling

12

 

 

Additional functions

13

User stock removal

 

14

programs

 

 

Tables

15

 

 

Appendix

A

 

 

siemens 840D Programming Manual

Safety Guidelines

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 device/system may only be set up and used in conjunction with this documentation. Commissioning and operation of a device/system may only be performed by qualified personnel. Within the context of the safety notes in this documentation qualified persons are defined as persons who are authorized to commission, ground and label devices, systems and circuits in accordance with established safety practices and standards.

Prescribed Usage

Note the following:

Warning

This device may only be used for the applications described in the catalog or the technical description and only in connection with devices or components from other manufacturers which have been approved or recommended by Siemens. Correct, reliable operation of the product requires proper transport, storage, positioning and assembly as well as careful operation and maintenance.

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

Order No.: 6FC5398-2BP10-2BA0

Copyright © Siemens AG 2006.

Automation and Drives

11/2006

Technical data subject to change

Postfach 48 48

 

 

90437 NÜRNBERG

 

 

GERMANY

 

 

Preface

Foreword

SINUMERIK® Documentation

The SINUMERIK documentation is organized in 3 parts:

General Documentation

User Documentation

Manufacturer/service documentation

An overview of publications (updated monthly) indicating the language versions available can be found on the Internet at:

http://www.siemens.com/motioncontrol

Select the menu items "Support" → "Technical Documentation" → "Overview of Publications".

The Internet version of DOConCD (DOConWEB) is available at: http://www.automation.siemens.com/doconweb

Information about training courses and FAQs (Frequently Asked Questions) can be found at the following website:

http://www.siemens.com/motioncontrol under menu option "Support"

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.

Job planning

3

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Preface

Standard scope

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.

Technical Support

If you have any technical questions, please contact our hotline:

 

Europe/Africa

 

Asia/Australia

America

Phone

+49 180 5050 222

+86 1064 719 990

+1 423 262 2522

Fax

+49 180 5050 223

+86 1064 747 474

+1 423 262 2289

Internet

http://www.siemens.com/automation/support-request

E-Mail

mailto:adsupport@siemens.com

 

Note

Country telephone numbers for technical support are provided under the following Internet address:

Enter http://www.siemens.com/automation/service&support

Questions about the manual

If you have any queries (suggestions, corrections) in relation to this documentation, please fax or e-mail us:

Fax:

+49 (0) 9131 / 98 - 63315

E-mail: mailto:docu.motioncontrol@siemens.com

Fax form: See the reply form at the end of this publication

SINUMERIK Internet address

http://www.siemens.com/sinumerik

4

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Preface

EC declaration of conformity

The EC Declaration of Conformity for the EMC Directive can be found/obtained from:

the internet: http://www.ad.siemens.de/csinfo under product/order no. 15257461

the relevant branch office of the A&D MC group of Siemens AG.

Export version

The following functions are not available in the export version:

Function

810DE

840DE sl

840DE

840DiE sl

840DiE

Helical interpolation 2D+6

(Basic version, no options)

 

 

 

 

 

Milling machining package

Five axis machining package

Handling transformation package

Multi-axis interpolation (> 4 interpolating axes)

OA NCK compile cycles

Clearance control 1D/3D in position-control cycle 1)

Synchronized actions 1)

#

#

#

#

#

(Basic version, no options)

 

 

 

 

 

Master-value coupling and curve-table interpolation

#

#

#

#

#

Sag compensation, multi-dimensional

#

#

#

#

#

Synchronized actions, stage 2 1)

#

#

Electronic gear 1)

#

#

Electronic transfer

#

#

 

# Restricted functionality

 

 

 

-Function not available

1)The restricted functions for the SINUMERIK 810DE powerline/SINUMERIK 840DE sl/SINUMERIK 840DE powerline/ SINUMERIK 840DiE sl/SINUMERIK 840DiE powerline export versions impose a limit of "max. 4 interpolating axes".

Description

Fundamentals

This Programming Guide "Fundamentals" is intended for use by skilled machine operators with the appropriate expertise in drilling, milling and turning operations. Simple programming examples are used to explain the commands and statements which are also defined according to DIN 66025.

Job planning

5

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Preface

Job planning

The Programming Guide "Job Planning" is intended for use by technicians with in-depth, comprehensive programming knowledge. By virtue of a special programming language, the SINUMERIK 840D sl/840Di sl/840D/840Di/810D control enables the user to program complex workpiece programs (e.g., for free-form surfaces, channel coordination, etc.) and greatly facilitates the programming of complicated operations.

The commands and statements described in this Programming Guide are not specific to one particular technology.

They can be used for a variety of tasks, such as

Turning, milling and grinding

Cyclical machines (packaging, woodworking)

Laser power controls.

6

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Table of contents

 

Preface......................................................................................................................................................

3

1

Flexible NC programming........................................................................................................................

15

1.1Variables and arithmetic parameters (user-defined variables, arithmetic parameters,

 

system variables).........................................................................................................................

15

1.2

Variable definition (DEF user-defined variables LUD, GUD, PUD).............................................

17

1.3

Array definitions (DEF, SET, REP)..............................................................................................

21

1.4

Indirect programming...................................................................................................................

28

1.4.1

Run string as parts program line (EXECSTRING).......................................................................

31

1.5

Assignments.................................................................................................................................

32

1.6

Arithmetic operations/functions....................................................................................................

33

1.7

Comparison and logical operations .............................................................................................

36

1.7.1

Precision correction on comparison errors (TRUNC)..................................................................

39

1.7.2

Variable minimum, maximum and range (MINVAL, MAXVAL and BOUND) ..............................

40

1.8

Priority of the operations..............................................................................................................

42

1.9

Possible type conversions ...........................................................................................................

43

1.10

String operations..........................................................................................................................

44

1.10.1

Type conversion to STRING........................................................................................................

45

1.10.2

Type conversion of STRING........................................................................................................

46

1.10.3

Concatenation of strings..............................................................................................................

47

1.10.4

Conversion to lower/upper case..................................................................................................

48

1.10.5

Length of the string......................................................................................................................

49

1.10.6

Look for character/string in the string ..........................................................................................

49

1.10.7

Selection of a substring................................................................................................................

51

1.10.8

Selection of a single character.....................................................................................................

51

1.11

CASE statement ..........................................................................................................................

53

1.12

Control structures.........................................................................................................................

55

1.13

Program coordination...................................................................................................................

59

1.14

Interrupt routine (SETINT, DISABLE, ENABLE, CLRINT)...........................................................

64

1.15

Axis replacement, spindle replacement (RELEASE, GET, GETD) .............................................

73

1.16

Transfer axis to another channel (AXTOCHAN)..........................................................................

77

1.17

NEWCONF: Setting machine data effective................................................................................

78

1.18

WRITE: Write file..........................................................................................................................

79

1.19

DELETE: Delete file.....................................................................................................................

81

1.20

READ: Read lines in the file.........................................................................................................

83

1.21

ISFILE: File present in the NCK user memory.............................................................................

85

Job planning

 

 

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

7

Table of contents

 

1.22

FILEDATE/TIME/SIZE/STAT/INFO: File information..................................................................

86

 

1.23

CHECKSUM: Form the checksum over an array........................................................................

88

 

1.24

ROUNDUP: Round up ................................................................................................................

89

2

Subroutines, Macros................................................................................................................................

91

 

2.1

Using subroutines .......................................................................................................................

91

 

2.2

Subroutines with SAVE mechanism ...........................................................................................

94

 

2.3

Subroutines with parameter transfer (PROC, VAR) ...................................................................

95

 

2.4

Call subroutines (L or EXTERN).................................................................................................

99

 

2.5

Parameterized subroutine return (RET)....................................................................................

104

 

2.6

Subroutine with program repetition (P).....................................................................................

108

 

2.7

Modal subroutine (MCALL).......................................................................................................

110

 

2.8

Indirect subroutine call (CALL)..................................................................................................

112

 

2.9

Repeating program sections with indirect programming (CALL)..............................................

112

 

2.10

Indirect call of a program programmed in ISO language (ISOCALL) .......................................

114

 

2.11

Calling subroutine with path specification and parameters (PCALL)........................................

115

 

2.12

Extend search path for subroutine calls with CALLPATH.........................................................

116

 

2.13

Execute external subroutine (EXTCALL)..................................................................................

118

 

2.14

Suppress individual block (SBLOF, SBLON)............................................................................

122

 

2.15

Suppress current block display (DISPLOF)..............................................................................

126

 

2.16

Identifying subprograms with preparation (PREPRO)..............................................................

128

 

2.17

Cycles: Setting parameters for user cycles...............................................................................

129

 

2.18

Macro technique (DEFINE...AS)...............................................................................................

132

3

File and Program Management .............................................................................................................

135

 

3.1

Program memory ......................................................................................................................

135

 

3.2

Working memory.......................................................................................................................

140

 

3.3

Defining user data.....................................................................................................................

142

 

3.4

Protection levels for user data, MD, SD and NC commands....................................................

145

 

3.4.1

Defining protection levels for user data (GUD).........................................................................

145

 

3.4.2

Automatic activation of GUDs and MACs.................................................................................

147

 

3.4.3

Change the protection data for the machine and setting data (REDEF MD, SD).....................

148

 

3.4.4

Protection levels for NC commands (REDEF)..........................................................................

150

 

3.5

REDEF Changing the attributes of the NC language elements................................................

152

 

3.6

SEFORM structuring statement in the Step editor....................................................................

158

4

Protection zones....................................................................................................................................

159

 

4.1

Definition of the protection zones (CPROTDEF, NPROTDEF) ................................................

159

 

4.2

Activating, deactivating protection zones (CPROT, NPROT)...................................................

162

 

4.3

Checking for protection zone violation, working area limitation and software limits.................

166

8

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

 

 

 

Table of contents

5

Special Motion Commands....................................................................................................................

173

 

5.1

Approaching coded positions (CAC, CIC, CDC, CACP, CACN)...............................................

173

 

5.2

Spline interpolation (ASPLINE, BSPLINE, CSPLINE, BAUTO, BNAT, BTAN).........................

174

 

5.3

Spline grouping (SPLINEPATH)................................................................................................

183

 

5.4

Compressor (COMPOF/ON, COMPCURV, COMPCAD)..........................................................

185

 

5.5

Polynomial interpolation (POLY, POLYPATH) ..........................................................................

189

 

5.6

Settable path reference (SPATH, UPATH)................................................................................

195

 

5.7

Measurements with touch trigger probe (MEAS, MEAW) .........................................................

197

 

5.8

Extended measuring function (MEASA, MEAWA, MEAC) (option)...........................................

200

 

5.9

Special functions for OEM users (OEMIPO1, OEMIPO2, G810 to G829)................................

209

 

5.10

Feed reduction with corner deceleration (FENDNORM, G62, G621)........................................

209

5.11Programmed end-of-motion criterion (FINEA, COARSEA, IPOENDA, IPOBRKA,

 

 

ADISPOSA) ................................................................................................................................

210

 

5.12

Programmable servo parameter set (SCPARA) ........................................................................

214

6

Frames

..................................................................................................................................................

217

 

6.1

Coordinate transformation via frame variables ..........................................................................

217

 

6.1.1

Predefined frame variable ( $ P _ BFRAME, $ P _ IFRAME, $ P _ PFRAME, $ P _ ACTFRAME) ........

219

 

6.2 ...........................................................................

Frame variables / assigning values to frames

224

 

6.2.1 .....................................................................

Assigning direct values (axis value, angle, scale)

224

 

6.2.2 ...............................................

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

226

 

6.2.3 ............................................................................................................

Linking complete frames

228

 

6.2.4 ..........................................................................................

Defining new frames (DEF FRAME)

229

 

6.3 ...............................................................................

Coarse and fine offsets (CFINE; CTRANS)

230

 

6.4 ..................................................................................................................................

DRF offset

232

 

6.5 ....................................................................................................................

External zero offset

233

 

6.6 ........................................................................................................

Preset offset (PRESETON)

234

 

6.7 ..................................

Frame calculation from three measuring points in space (MEAFRAME)

235

 

6.8 .....................................................................................................................

NCU global frames

238

 

6.8.1 ....................................................................

Channel - specific frames ( $ P _ CHBFR, $ P _ UBFR)

239

 

6.8.2 .....................................................................................................

Frames active in the channel

241

7

Transformations.....................................................................................................................................

247

 

7.1 ..........................................................................

General programming of transformation types

247

 

7.1.1 ...............................................................................

Orientation movements for transformations

249

 

7.1.2 .......................................................................

Overview of orientation transformation TRAORI

253

 

7.2 ...................................................................

Three, four and five axis transformation (TRAORI)

255

 

7.2.1 ..............................................................................

General relationships of universal tool head

255

 

7.2.2 ...................................................................

Three, four and five axis transformation (TRAORI)

258

 

7.2.3 ........................................

Variants of orientation programming and initial setting (OTIRESET)

259

 

7.2.4 ... ... ... ..............................................

Programming of the tool orientation (A , B , C , LEAD, TILT)

261

 

7.2.5 ......................................................................

Face milling (3D - milling A4, B4, C4, A5, B5, C5)

267

 

7.2.6 .......................................................................

Orientation axis reference (ORIWKS, ORIMKS)

268

 

7.2.7 ...................

Programming the orientation axes (ORIAXES, ORIVECT, ORIEULER, ORIRPY)

271

Job planning

9

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Table of contents

7.2.8Orientation programming along the peripheral surface of a taper (ORIPLANE,

ORICONxx)...............................................................................................................................

273

7.2.9Specification of orientation for two contact points (ORICURVE, PO[XH]=, PO[YH]=,

 

PO[ZH]=)...................................................................................................................................

276

7.3

Orientation polynomials (PO[angle], PO[coordinate])...............................................................

279

7.4

Rotations of the tool orientation (ORIROTA, ORIROTR/TT, ORIROTC, THETA)....................

281

7.5

Orientations relative to the path................................................................................................

283

7.5.1

Orientation types relative to the path........................................................................................

283

7.5.2Rotation of the tool orientation relative to the path (ORIPATH, ORIPATHS, angle of

 

 

rotation).....................................................................................................................................

285

 

7.5.3

Interpolation of the tool rotation relative to the path (ORIROTC, THETA)................................

286

 

7.5.4

Smoothing of orientation characteristic (ORIPATHS A8=, B8=, C8=)......................................

288

 

7.6

Compression of the orientation COMPON (A..., B..., C..., THETA)..........................................

289

 

7.7

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

293

 

7.8

Kinematic transformation ..........................................................................................................

295

 

7.8.1

Milling on turned parts (TRANSMIT).........................................................................................

295

 

7.8.2

Cylinder surface transformation (TRACYL) ..............................................................................

299

 

7.8.3

Inclined axis (TRAANG)............................................................................................................

307

 

7.8.4

Inclined axis programming (G05, G07).....................................................................................

310

 

7.9

Cartesian PTP travel.................................................................................................................

312

 

7.9.1

PTP for TRANSMIT...................................................................................................................

316

 

7.10

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

320

 

7.11

Deselect transformation (TRAFOOF) .......................................................................................

321

 

7.12

Chained transformations (TRACON, TRAFOOF).....................................................................

321

 

7.13

Replaceable geometry axes (GEOAX).....................................................................................

323

8

Tool offsets............................................................................................................................................

327

 

8.1

Offset memory...........................................................................................................................

327

 

8.2

Language commands for tool management .............................................................................

330

 

8.3

Online tool compensation (PUTFTOCF, PUTFTOC, FTOCON, FTOCOF) .............................

333

 

8.4

Keep tool radius compensation constant (CUTCONON)..........................................................

338

 

8.5

Activate 3D tool offsets (CUT3DC..., CUT3DF...).....................................................................

340

 

8.5.1

Activate 3D tool offsets (CUT3DC, CUT3DF, CUT3DFS, CUT3DFF)......................................

340

 

8.5.2

3D tool radius compensation: peripheral milling, face milling...................................................

342

 

8.5.3

Tool types/tool change with changed dimensions (G40, G41, G42)........................................

343

8.5.4Compensation on the path, path curvature, and insertion depth ISD and tool status

 

(CUT3DC).................................................................................................................................

345

8.5.5

Inside corners/outside corners and intersection procedure (G450/G451)................................

347

8.5.6

3D circumferential milling with limitation surfaces general use.................................................

349

8.5.7

Consideration of a limitation surface (CUT3DCC, CUT3DCCD)..............................................

349

8.6

Tool orientation (ORIC, ORID, OSOF, OSC, OSS, OSSE, OSD, OST)...................................

353

8.7

Free assignment of D numbers, cutting edge numbers............................................................

359

8.7.1

Free assignment of D numbers, cutting edge numbers (CE address) .....................................

359

8.7.2

Checking D numbers (CHKDNO) .............................................................................................

360

8.7.3

Renaming D numbers (GETDNO, SETDNO)...........................................................................

360

8.7.4

Deriving the T number from the specified D number (GETACTTD).........................................

361

10

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

 

 

 

Table of contents

 

8.7.5

Invalidate D numbers (DZERO).................................................................................................

362

 

8.8

Tool holder kinematics...............................................................................................................

363

9

Path traversing behavior........................................................................................................................

369

 

9.1

Tangential control (TANG, TANGON, TANGOF, TANGDEL)...................................................

369

 

9.2

Coupled motion (TRAILON, TRAILOF) .....................................................................................

375

 

9.3

Curve tables (CTAB)..................................................................................................................

379

 

9.3.1

Curve tables: general relationships ...........................................................................................

379

 

9.3.2

Principal functions curve tables (CTABDEF, CTABEND, CTABDEL).......................................

380

9.3.3Curve table forms (CTABDEL, CTABNOMEM, CTABFNO, CTABID, CTABLOCK,

 

CTABUNLOCK).........................................................................................................................

385

9.3.4

Behavior at the edges of curve tables (CTABTSV, CTABTSP, CTABMIN, CTABMAX)...........

390

9.3.5Access to curve table positions and table segments (CTAB, CTABINV, CTABSSV,

 

CTABSEV).................................................................................................................................

394

9.4

Axial leading value coupling (LEADON, LEADOF)....................................................................

397

9.5

Feedrate response (FNORM, FLIN, FCUB, FPO).....................................................................

403

9.6

Program run with preprocessing memory (STARTFIFO, STOPFIFO, STOPRE).....................

410

9.7

Conditionally interruptible program sections (DELAYFSTON, DELAYFSTOF) ........................

412

9.8

Preventing program position for SERUPRO (IPTRLOCK, IPTRUNLOCK)...............................

417

9.9

Repositioning at contour (REPOSA/L, REPOSQ/H, RMI, RMN, RMB, RME) ..........................

419

10 Motion synchronous actions ..................................................................................................................

429

10.1

Structure, basic information.......................................................................................................

429

10.1.1

Programming and command elements......................................................................................

431

10.1.2

Validity range: Identification number ID.....................................................................................

432

10.1.3

Cyclic checking of the condition.................................................................................................

433

10.1.4

Actions .......................................................................................................................................

435

10.2

Operators for conditions and actions.........................................................................................

436

10.3

Main run variables for synchronized actions..............................................................................

437

10.3.1

General information on system variables ..................................................................................

437

10.3.2

Implicit type conversion..............................................................................................................

438

10.3.3

GUD variables for synchronous actions ....................................................................................

440

10.3.4

Default axis identifier (NO_AXIS)...............................................................................................

441

10.3.5

Synchronized action marker $AC_MARKER[n].........................................................................

442

10.3.6

Synchronized action parameters $AC_PARAM[n].....................................................................

443

10.3.7

Arithmetic parameter $R[n]........................................................................................................

444

10.3.8

Read and write NC machine and NC setting data.....................................................................

445

10.3.9

Timer-Variable $AC_Timer[n] ....................................................................................................

446

10.3.10

FIFO variable $AC_FIFO1[n] ... $AC_FIFO10[n].......................................................................

447

10.3.11

Information about the block types in the interpolator.................................................................

449

10.4

Actions in synchronized actions.................................................................................................

451

10.4.1

Overview....................................................................................................................................

451

10.4.2

Output of auxiliary functions.......................................................................................................

454

10.4.3

Set read-in disable (RDISABLE)................................................................................................

455

10.4.4

Cancel preprocessing stop (STOPREOF).................................................................................

456

10.4.5

Delete distance-to-go (DELDTG)...............................................................................................

456

10.4.6

Polynomial definition (FCTDEF) ................................................................................................

458

Job planning

11

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Table of contents

 

10.4.7

Synchronized function (SYNFCT).............................................................................................

460

 

10.4.8

Clearance control with limited compensation $AA_OFF_MODE..............................................

463

 

10.4.9

Online tool offset (FTOC)..........................................................................................................

465

 

10.4.10

Online tool length offset ($AA_TOFF[tool direction])................................................................

467

 

10.4.11

Positioning movements.............................................................................................................

468

 

10.4.12

Position axis (POS)...................................................................................................................

469

 

10.4.13

Position in specified reference range (POSRANGE)................................................................

470

 

10.4.14

Start/stop axis (MOV)................................................................................................................

471

 

10.4.15

Axis replacement (RELEASE, GET).........................................................................................

472

 

10.4.16

Axial feed (FA) ..........................................................................................................................

476

 

10.4.17

Software limit switch..................................................................................................................

476

 

10.4.18

Axis coordination.......................................................................................................................

476

 

10.4.19

Set actual values (PRESETON) ...............................................................................................

477

 

10.4.20

Spindle motions.........................................................................................................................

478

 

10.4.21

Coupled motion (TRAILON, TRAILOF).....................................................................................

479

 

10.4.22

Leading value coupling (LEADON, LEADOF)...........................................................................

481

 

10.4.23

Measuring (MEAWA, MEAC)....................................................................................................

483

 

10.4.24

Initialization of array variables with SET, REP..........................................................................

484

 

10.4.25

Set/delete wait markers with SETM, CLEARM.........................................................................

485

 

10.4.26

Error responses during SETAL cycle alarms............................................................................

485

 

10.4.27

Travel to fixed stop (FXS and FOCON/FOCOF).......................................................................

486

 

10.4.28

Determining the path tangent in synchronized actions.............................................................

488

 

10.4.29

Determining the current override ..............................................................................................

488

 

10.4.30

Time use evaluation of synchronized actions...........................................................................

489

 

10.5

Technology cycles.....................................................................................................................

491

 

10.5.1

Context variable ($P_TECCYCLE)...........................................................................................

493

 

10.5.2

Call by value parameters ..........................................................................................................

494

 

10.5.3

Default parameter initialization..................................................................................................

495

 

10.5.4

Control processing of technology cycles (ICYCOF, ICYCON) .................................................

495

 

10.5.5

Cascading technology cycles....................................................................................................

496

 

10.5.6

Technology cycles in non-modal synchronized actions............................................................

497

 

10.5.7

IF check structures....................................................................................................................

497

 

10.5.8

Jump instructions (GOTO, GOTOF, GOTOB)..........................................................................

497

 

10.5.9

Lock, unlock, reset (LOCK, UNLOCK, RESET)........................................................................

498

 

10.6

Delete synchronized action (CANCEL).....................................................................................

499

 

10.7

Restrictions ...............................................................................................................................

500

11

Oscillation..............................................................................................................................................

505

 

11.1

Asynchronous oscillation...........................................................................................................

505

 

11.2

Control oscillation via synchronized actions .............................................................................

510

12

Punching and nibbling ...........................................................................................................................

519

 

12.1

Activation, deactivation .............................................................................................................

519

 

12.1.1

Punching and nibbling On or Off (SPOF, SON, PON, SONS, PONS, PDELAYON/OF) .........

519

 

12.2

Automatic path segmentation....................................................................................................

522

 

12.2.1

Path segmentation for path axes..............................................................................................

525

 

12.2.2

Path segmentation for single axes............................................................................................

527

12

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

 

 

Table of contents

13 Additional functions................................................................................................................................

529

13.1

Axis functions (AXNAME, AX, SPI, AXTOSPI, ISAXIS, AXSTRING)........................................

529

13.2

Check scope of NC language present (STRINGIS)...................................................................

531

13.3

ISVAR ( ) function call and read machine array index...............................................................

535

13.4

Learn compensation characteristics (QECLRNON, QECLRNOF)............................................

538

13.5

Synchronous spindle..................................................................................................................

540

13.5.1Synchronous spindle (COUPDEF, COUPDEL, COUPON/ONC, COUPOF/OFS,

 

COUPRES)................................................................................................................................

540

13.6

Electronic gear (EG) ..................................................................................................................

552

13.6.1

Defining an electronic gear (EGDEF)........................................................................................

552

13.6.2

Activate electronic gear (EGON)................................................................................................

553

13.6.3

Deactivate electronic gear (EGOFS).........................................................................................

557

13.6.4

Revolutional feedrate (G95)/electronic gear (FPR) ...................................................................

558

13.7

Extended stop and retract..........................................................................................................

558

13.7.1

Drive-independent responses to ESR .......................................................................................

560

13.7.2

NC-controlled reactions to retraction.........................................................................................

562

13.7.3

NC-controlled reactions to stoppage .........................................................................................

566

13.7.4

Generator operation/DC link backup .........................................................................................

566

13.7.5

Drive-independent stopping.......................................................................................................

567

13.7.6

Drive-independent retraction......................................................................................................

568

13.8

Link communication...................................................................................................................

568

13.8.1

Access to a global NCU memory area.......................................................................................

569

13.9

Axis container (AXCTWE, AXCTWED) .....................................................................................

570

13.10

Program runtime/Workpiece counter.........................................................................................

573

13.10.1

General ......................................................................................................................................

573

13.10.2

Program runtime........................................................................................................................

573

13.10.3

Workpiece counter.....................................................................................................................

574

13.11

Interactive window call from parts program, command:............................................................

576

13.12

Influencing the motion control....................................................................................................

577

13.12.1

Percentage jerk correction (JERKLIM)......................................................................................

577

13.12.2

Percentage velocity correction (VELOLIM)................................................................................

578

13.13

Master/slave grouping (MASLDEF, MASLDEL, MASLOF, MASLOF, MASLOFS)...................

579

14 User stock removal programs................................................................................................................

583

14.1

Supporting function for stock removal .......................................................................................

583

14.2

Contour preparation (CONTPRON)...........................................................................................

584

14.3

Contour decoding (CONTDCON)..............................................................................................

591

14.4

Intersection of two contour elements (INTERSEC) ...................................................................

595

14.5

Traversing a contour element from the table (EXECTAB).........................................................

597

14.6

Calculate circle data (CALCDAT) ..............................................................................................

597

15 Tables....................................................................................................................................................

 

599

15.1

List of statements.......................................................................................................................

599

Job planning

13

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Table of contents

A

Appendix

................................................................................................................................................

641

 

A.1

List of abbreviations ..................................................................................................................

642

 

A.2

Publication - specific information ................................................................................................

647

 

A.2.1 .................................................................................................

Correction sheet - fax template

647

 

A.2.2 ...................................................................................................................................

Overview

649

 

Glossary ................................................................................................................................................

 

651

 

Index......................................................................................................................................................

 

675

14

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming

1

1.1Variables and arithmetic parameters (user-defined variables, arithmetic parameters, system variables)

Function

Using variables in place of constant values makes a program more flexible. You can respond to signals such as measured values or, by storing setpoints in the variables, you can use the same program for different geometries.

With variable calculation and jump instructions a skilled programmer is able to create a very flexible program archive and save a lot of programming work.

Variable types

The control uses 3 classes of variable:

User-defined variables

Name and type of variable defined by the user, e.g., arithmetic

 

parameter.

Arithmetic variables

Special, predefined arithmetic variable whose address is R plus a

 

number. The predefined arithmetic variables are of the REAL type.

System variables

Variable provided by the control that can be processed in the

 

program (write, read). System variables provide access to zero

 

offsets, tool offsets, actual values, measured values on the axes,

 

control states, etc.

 

(See Appendix for the meaning of the system variables).

Variable types

Type

Meaning

Value range

INT

Integers with leading sign

±(231 - 1)

REAL

Real numbers (fractions with decimal

±(10-300 … 10+300)

 

point, LONG REAL in acc. with IEEE)

 

Job planning

15

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming

1.1 Variables and arithmetic parameters (user-defined variables,arithmetic parameters, system variables)

BOOL

Boolean values: TRUE (1) and

1.0

 

FALSE (0)

 

CHAR

ASCII character specified by the

0 … 255

 

code

 

STRING

Character string, number of

Sequence of values with 0 ... 255

 

characters in [...], maximum of

 

 

200 characters

 

AXIS

Axis identifiers only (axis addresses)

Any axis identifiers in the channel

FRAME

Geometric data for translation,

 

 

rotation, scaling, mirroring, see the

 

 

"Frames" Chapter

 

Arithmetic variables

Address R provides 100 arithmetic variables of type REAL by default.

The exact number of arithmetic variables (up to 32535) is defined in machine data.

Example: R10=5

System variables

The control provides system variables that can be contained and processed in all running programs.

System variables provide machine and control states. Some system variables cannot be assigned values.

Summary of system variables

Special identifiers of system variables always begin with a "$" sign. The specific names then follow.

1st letter

Meaning

$M

Machine data

$S

Setting data

$T

Tool management data

$P

Programmed values

$A

Current values

$V

Service data

 

 

2nd letter

Meaning

N

NCK global

C

Channel-specific

A

Axis-specific

Example: $AA_IM

Meaning: Current axis-specific value in the machine coordinate system.

16

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming

1.2Variable definition (DEF user-defined variables LUD, GUD, PUD)

1.2Variable definition (DEF user-defined variables LUD, GUD, PUD)

Function

In addition to the predefined variables, programmers can define and initialize their own variables.

Local variables (LUD) are only valid in the program where they are defined. Global variables (GUD) are valid in all programs.

Machine data are used to redefine the local user variables (LUD) defined in the main program as program-global user variables (PUD).

Machine manufacturer

See machine manufacturer's specifications.

Programming

Variable type INT

DEF INT name or

DEF INT name=value

Variable type REAL

DEF REAL name or

DEF REAL name1,name2=3,name4 or

DEF REAL name[array_index1,array_index2]

Variable type BOOL

DEF BOOL name

Variable type CHAR

DEF CHAR name or

DEF CHAR name[array_index]=("A","B",…)

Variable type STRING

DEF STRING[string_length] name

Variable type AXIS

DEF AXIS name or

DEF AXIS name[array_index]

Variable type FRAME

DEF FRAME name

Job planning

17

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming

1.2 Variable definition (DEF user-defined variables LUD, GUD, PUD)

Note

If a variable is not assigned a value on definition, the system sets zero as the default.

Variables must be defined at the beginning of the program before they are used. The definition must be made in a separate block; only one variable type can be defined per block.

Parameter

INT

Variable type integer, i.e., whole number

REAL

Variable type real, i.e., factional number with decimal point

BOOL

Variable type Boolean, i.e., 1 or 0 (TRUE or FALSE)

CHAR

Variable type char, i.e., ASCII-coded character

 

(0 to 255)

STRING

Variable type string, i.e., character string

AXIS

Variable type axis, i.e., axis addresses and spindles

FRAME

Variable type frame, i.e., geometric data

Example:

Variable type

Description

INT

 

DEF INT NUMBER

This creates a variable of type integer with the

 

name NUMBER.

 

System initializes with zero.

DEF INT NUMBER=7

This creates a variable of type integer with the

 

name NUMBER. The system initializes the

 

variable with 7.

REAL

 

DEF REAL DEPTH

This creates a variable of type real with the name

 

DEPTH.

 

System initializes with zero (0.0).

DEF REAL DEPTH=6.25

This creates a variable of type real with the name

 

DEPTH. The variable is initialized with 6.25.

DEF REAL DEPTH=3.1,LENGTH=2,NUMBER

More than one variable can be defined in a line.

BOOL

 

DEF BOOL IF_TOO_MUCH

This creates a variable of type BOOL with the

 

name IF_TOO_MUCH.

 

System initializes with zero (FALSE).

DEF BOOL IF_TOO_MUCH=1 or

This creates a variable of type BOOL with the

DEF BOOL IF_TOO_MUCH=TRUE or

name IF_TOO_MUCH.

DEF BOOL IF_TOO_MUCH=FALSE

 

CHAR

 

18

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming 1.2 Variable definition (DEF user-defined variables LUD, GUD, PUD)

DEF CHAR GUSTAV_1=65

A code value for the corresponding ASCII

 

character or the ASCII character itself

DEF CHAR GUSTAV_1="A"

can be assigned to a variable of type CHAR

 

(code value 65 corresponds to letter "A").

STRING

 

DEF STRING[6] MUSTER_1="BEGIN"

Variables of type string can contain a string

 

(sequence of characters). The maximum number

 

of characters is enclosed in square brackets after

 

the variable type.

AXIS

 

DEF AXIS AXIS_NAME=(X1)

Variables of type AXIS have the name

 

AXIS_NAME and are assigned the axis identifier

 

of a channel - X1 in this case.

 

(Axis names with an extended address must be

 

enclosed in parentheses.)

FRAME

 

DEF FRAME BEVEL_1

Variables of type FRAME have names like

 

BEVEL_1.

Note

A variable of type AXIS can contain an axis identifier and a spindle identifier of a channel.

Note

Axis names with an extended address must be enclosed in parentheses.

Example Redefine local (LUD) and program-global user variables (PUD)

If they are defined in the main program, they will also be valid at all levels of the subprograms called. They are created with part-program start and deleted with part-program end or RESET.

If machine data $MN_LUD_EXTENDED_SCOPE is set, it is not possible to define a variable with the same name in the main and subprograms.

 

$MN_LUD_EXTENDED_SCOPE=1

;Main program

 

PROC MAIN

 

DEF INT VAR1

;PUD definition

 

...

;Subprogram call

 

SUB2

 

 

...

 

 

M30

 

 

PROC SUB2

;Subprogram SUB2

 

DEF INT VAR2

;LUD DEFINITION

 

...

;Read PUD

 

IF (VAR1==1)

Job planning

19

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming

1.2 Variable definition (DEF user-defined variables LUD, GUD, PUD)

VAR1=VAR1+1

;Read & write PUD

VAR2=1

;Write LUD

ENDIF

;Subprogram call

SUB3

 

...

 

M17

 

PROC SUB3

;Subprogram SUB3

...

;Read PUD

IF (VAR1==1)

VAR1=VAR1+1

;Read & write PUD

VAR2=1

;Error: LUD from SUB2 not known

ENDIF

 

...

 

M17

Variable names

A variable name consists of up to 31 characters. The first two characters must be a letter or an underscore.

The "$" sign can not be used for user-defined variables because it is used for system variables.

Example: Program-local variables

DEF INT COUNTER

;Loop

LOOP: G0 X…

COUNT=COUNT+1

 

IF COUNT<50 GOTOB LOOP

 

M30

 

20

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

 

 

Flexible NC programming

 

 

1.3 Array definitions (DEF, SET, REP)

Example: Querying existing geometry axes

 

 

DEF AXIS ABSCISSA;

;1. Geometry axis

 

 

IF ISAXIS(1) == FALSE GOTOF CONTINUE

 

 

ABSCISSA = $P_AXN1

 

 

CONTINUE:

 

Example: Indirect spindle programming

 

 

DEF AXIS SPINDLE

 

 

 

 

SPINDLE=(S1)

;Spindle override = 80%

 

OVRA[SPINDLE]=80

 

SPINDLE=(S3)

 

 

 

1.3Array definitions (DEF, SET, REP)

Function

An array is a memory area defined using the variable type with name and size. Arrays with up to two dimensions can be defined.

Note

Maximum array size

When defining arrays, the maximum array size of the 1st and 2nd dimension is 32767 for the array index [n, m].

Initialization of arrays

Initialization values can be assigned to the array elements:

during the program execution

or

already with the array definition.

In 2-dimensional arrays, the right array index is incremented first.

Job planning

21

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming

1.3 Array definitions (DEF, SET, REP)

Programming

DEF CHAR NAME[n,m] or

DEF INT NAME[n,m] or

DEF REAL NAME[n,m] or

DEF AXIS NAME[n,m] or

DEF FRAME NAME[n,m] or

DEF STRING[string_length] NAME[m] or

DEF BOOL[n,m]

Initialization with value lists; SET Array definition options

DEF Type VARIABLE = SET(VALUE)

DEF Type ARRAY[n,m] = SET(VALUE, value, …) or

DEF Type VARIABLE = Value

DEF Type ARRAY[n,m] = (value, value, …)

Note

SET is optional in the array definition.

Initializing during the program run

ARRAY[n,m]= SET(value, value, value,…)

ARRAY[n,m]= SET(expression, expression, expression,…)

Initialization with the same values, REP Array definition options

When "Array" variables are created,

DEF Type ARRAY[n,m] = REP(value) initializes all elements. With

DEF Type ARRAY[n,m] = REP(value, no.arrayElements), only the number of array elements defined in "No.arrayElements" is initialized with "Value".

Initialization begins at array index 0. The remaining variable elements are initialized with zero. If "No.arrayElements" = 0, the entire variable array is initialized with zero, as, for example, for all 30 array elements of varName:

DEF REAL varName[30] =REP(3.5, 0)

22

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming 1.3 Array definitions (DEF, SET, REP)

Note

Variables of type FRAME cannot be initialized.

If a value smaller than zero or larger than the number of array elements is programmed as the range, a "Value range exceeded" alarm is output.

Initializing during the program run

ARRAY[n,m] = REP(value) ARRAY[n,m] = REP(expression)

ARRAY[n,m] = REP(value, no.arrayElements) ARRAY[n,m] = REP(expression, no.arrayElements)

If the range definition "No.arrayElements" = 0, the current values of all array variables remain unchanged, e.g.:

varName [12] =REP(44.5, 0)

Note

Variables of type FRAME are permissible and can be initialized very simply in this way.

Parameters

DEF

Variable

type

Array definition

SET

VALUE or

expression

Initialization with value lists for the array definition or in the

 

 

 

program execution

REP VALUE or expression

REP VALUE, no.arrayElem.

CHAR NAME[n,m]

INT NAME[n,m]

REAL NAME[n,m]

AXIS NAME[n,m]

FRAME NAME[n,m]

BOOL[n,m]

STRING[string_length] NAME[m]

NAME

Type VARIABLE

Initialization with the same values for the array definition or in the program execution

Initialization with the same values for a certain number of array elements that are to be overwritten. A value of zero for the second parameter, e.g., REP(10,0) means that initialization values are not overwritten.

Variable type

(CHAR, INTEGER, REAL, AXIS, FRAME, BOOL)

Data type STRING can only be defined for 1-dimensional arrays. The string length is specified after the data type String.

Variable name

Variable type

(CHAR, INTEGER, REAL, AXIS, FRAME, BOOL)

ARRAY[n,m]= SET(value, value,…)

TYPE ARRAY[n,m] = REP(value)

Initialization of all elements of an array with the listed values for the array definition

Initialization of all elements of an array with the same value for the array definition

Job planning

23

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming

1.3 Array definitions (DEF, SET, REP)

ARRAY[n,m]= SET(value, value,

..) ARRAY[n,m] = SET(expression, ...)

Initialization of all elements of an array with the listed values in the program execution

ARRAY[n,m]= REP(value)

ARRAY[n,m]= REP(expression)

ARRAY[n, m]

n

m

Maximum array size

No.arrayElem.

Initialization of all elements of an array with the same value in the program execution

Array index

Array size for 1st dimension Array size for 2nd dimension e.g. DEF INT NAME[32767]

Number of array elements to be overwritten by the REP command with "Value". All array elements are overwritten with "Value".

Arrays with variables of type STRING can only be 1-dimensional. Array_index [n,m]

Elements of an array are accessed via the array index. The array elements can either be read or assigned values using this array index.

The first array element starts with index [0,0]; for example, for array size [3,4] the maximum possible array index is [2,3].

$UUD\ LQGH[

>Q P@

P

P

 

 

 

 

P

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Q

 

 

 

 

 

 

 

 

 

 

 

 

Q

Q

Q

 

Q P

 

 

 

 

 

 

 

 

 

 

 

24

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

 

Flexible NC programming

 

1.3 Array definitions (DEF, SET, REP)

Memory requirements

 

Variable type

Memory requirement per element

BOOL

1 byte

CHAR

1 byte

INT

4 bytes

REAL

8 bytes

STRING

String length + 1

FRAME

400 bytes, depending on the number of axes

AXIS

4 bytes

Note

The maximum array size determines the size of the memory areas in which the variable memory is managed. It should not be set higher than actually required.

Default: 812 bytes

If no large arrays are defined, select: 256 bytes.

Example: Definition of BOOL arrays

Global user data must contain PLC machine data for switching the control on/off.

Example Definition of arrays with maximum array size for the 1st and 2nd dimension

DEF INT NAME[32767,32767]

Example: Initialization of complete variable arrays

The current assignment is shown in the drawing.

N10 DEF REAL ARRAY1[10,3] = SET(0, 0, 0, 10, 11, 12, 20, 20, 20, 30, 30, 30, 40, 40, 40,)

N20 ARRAY1[0,0] = REP(100)

N30 ARRAY1[5,0] = REP(-100)

N40 ARRAY1[0,0] = SET(0, 1, 2, -10, -11, -12, -20, -20, -20, -30, , , ,

-40, -40, -50, -60, -70)

N50 ARRAY1[8,1] = SET(8.1, 8.2, 9.0, 9.1, 9.2)

Job planning

25

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming

1.3 Array definitions (DEF, SET, REP)

 

 

 

$UUD\ LQGH[

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1,QLWLDOL]DWLRQ IRU

 

 

1 1,QLWLDOL]DWLRQ ZLWK

 

1 1 ,QLWLDOL]DWLRQ ZLWK

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

GHILQLWLRQ

 

 

 

LGHQWLFDO YDOXH

 

YDULRXV YDOXHV

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7KH DUUD\ HOHPHQWV > @ WR

 

 

 

 

 

7KH DUUD\ HOHPHQWV > @ WR

 

 

 

 

 

 

 

 

> @ KDYH EHHQ LQLWLDOL]HG

 

 

 

 

 

> @ KDYH EHHQ LQLWLDOL]HG

 

 

 

 

 

 

 

 

ZLWK WKH GHIDXOW YDOXH

 

 

 

 

 

ZLWK WKH GHIDXOW YDOXH

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7KH DUUD\ HOHPHQWV > @ WR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

> @ KDYH QRW EHHQ

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FKDQJHG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Initialization with value lists for the array definition, SET

As many array elements are assigned as initialization values are programmed.

Array elements without values (gaps in the value list) are automatically initialized to 0.

For variables of type AXIS, gaps in the value list are not permitted.

Programming more values than exist in the remaining array elements triggers an alarm. Example

DEF REAL ARRAY[2,3]=(10, 20, 30, 40)

Initialization with value lists in the program execution, SET

Initialization is the same as in array definition.

Expressions are possible values in this case too.

Initialization starts at the programmed array indexes. Values can also be assigned selectively to subarrays.

Example: Assignment of expressions

DEF INT ARRAY[5, 5]

ARRAY[0,0] = SET(1, 2, 3, 4, 5)

26

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming 1.3 Array definitions (DEF, SET, REP)

ARRAY[2,3] = SET(VARIABLE, 4*5.6)

The axis index of axis variables is not traversed: Example: Initialization in one line

$MA_AX_VELO_LIMIT[1, AX1] = SET(1.1, 2.2, 3.3)

Is equivalent to: $MA_AX_VELO_LIMIT[1,AX1] = 1.1 $MA_AX_VELO_LIMIT[2,AX1] = 2.2 $MA_AX_VELO_LIMIT[3,AX1] = 3.3

Initialization with the same values for the array definition, REP

All array elements are assigned the same value (constant). Variables of type FRAME cannot be initialized. Examples:

DEF REAL ARRAY5[10,3] = REP(9.9)

Initialize the variable-array ranges varName[0] to varName[3] with 3.5:

DEF REAL varName[30] =REP(3.5, 4)

Set array variable to a programmed value range by range:

varName[5] = REP(4.5, 10) ;Set varName[5] to varName[14] to value 4. Set R parameters to certain values range by range:

R10 = REP(2.4, 15) ;Set R10 to R24 to value 2.4.

Initialization with the same values in the program execution

Expressions are possible values in this case too.

All array elements are initialized to the same value.

Initialization starts at the programmed array indexes. Values can also be assigned selectively to subarrays.

Example: Initialization of all elements with one value

DEF FRAME FRM[10]

FRM[5] = REP(CTRANS (X,5))

Job planning

27

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming 1.4 Indirect programming

1.4Indirect programming

Function

Indirect programming permits general-purpose use of programs. The extended address (index) is substituted by a variable of suitable type.

Indirect G code programming

Indirect programming of G codes using variables facilitates effective cycle programming. Two parameters

G code groups with integer constants

G code numbers with integer/real type variables are available for this purpose.

Programming

ADDRESS[INDEX] or

G[<group_index>] = <integer/real_variable>

Indirect programming of G codes using variables for effective cycle programming

Parameters

All addresses are parameterizable except:

N - block number

L - subroutine

Indirect programming is not possible for settable addresses.

Example: X[1] in place of X1 is not permissible.

ADDRESS [INDEX] G<group_index

<Integer/real_variable>

Address with parameter details as index Index variable, e.g., spindle no., axis ....

G code groups: Integer constants with which the G code group is selected.

G code numbers: Variable of the integer or real type with which the G code number is selected

Valid G code groups

Only modal G code groups can be programmed indirectly. Non-modal G code groups are rejected with alarm 12470. Valid G code numbers

Arithmetic functions are not permissible in indirect G code programming.

The G code number must be stored in a variable of type integer or real. Invalid G code numbers are rejected with alarm 12475.

28

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming 1.4 Indirect programming

If it is necessary to calculate the G code number, this must be done in a separate parts program line before the indirect G code programming.

Note

All the valid G codes are shown in the PG, in the "List of G functions/preparatory functions" section in various groups. See /PG/ Programming Guide Fundamentals, "Tables"

Example

Spindle

S1=300

DEF INT SPINU=1

S[SPINU]=300

Feed

;Direct programming ;Indirect programming:

;Speed 300 rpm for the spindle whose number is ;stored in the SPINU variable

;(in this example 1).

FA[U]=300

DEF AXIS AXVAR2=U

FA[AXVAR2]=300

Measured value

;Direct programming ;Indirect programming:

;Feedrate for positioning axis whose address name is ;stored in the variable of type AXIS with the variable ;name AXVAR2.

$AA_MM[X]

DEF AXIS AXVAR3=X

$AA_MM[AXVAR3]

Array element

;Direct programming ;Indirect programming:

;Measured value in machine coordinates ;for the axis whose name is stored

;in variable AXVAR3.

DEF INT ARRAY1[4,5]

DEFINE DIM1 AS 4

DEFINE DIM2 AS 5

DEF INT ARRAY[DIM1,DIM2]

ARRAY[DIM1-1,DIM2-1]=5

Axis assignment with axis variables

X1=100 X2=200

DEF AXIS AXVAR1 AXVAR2

AXVAR1=(X1) AXVAR2=(X2)

AX[AXVAR1]=100 AX[AXVAR2]=200

Interpolation parameters with axis variables

G2 X100 I20

;Direct programming ;Indirect programming:

;Array dimensions must be stated ;as constant values.

;Direct programming ;Indirect programming: ;Definition of variables

;Assignment of the axis names, ;traversal of axes that are stored ;in the variables to 100 or 200.

;Direct programming

Job planning

29

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Flexible NC programming 1.4 Indirect programming

DEF AXIS AXVAR1=X

G2 X100 IP[AXVAR1]=20

Indirect subroutine call

;Indirect programming:

;Definition and assignment of the axis name ;Indirect programming of the center

CALL "L" << R10

;Call of the program whose number is in R10

Note

R parameters can also be considered 1-dimensional arrays with abbreviated notation (R10 is equivalent to R[10]).

Example: Indirect G code programming

Settable zero offset G code group 8

 

N1010

DEF INT INT_VAR

 

 

N1020

INT_VAR = 2

 

 

...

 

;G54

 

N1090

G[8] = INT_VAR G1 X0 Y0

 

N1100

INT_VAR = INT_VAR + 1

;G code calculation

 

N1110

G[8] = INT_VAR G1 X0 Y0

;G55

Plane selection G code group 6

 

 

N2010

R10 = $P_GG[6]

;Read G code for current plane

 

 

...

 

;G17

 

N2090

G[6] = R10

30

Job planning

Programming Manual, 11/2006, 6FC5398-2BP10-2BA0

Loading...
+ 658 hidden pages