Example

This example combines various control structures with each other, and also uses nesting:

NC programs contained in this User's Manual are suggestions for solutions. The NC programs or individual NC blocks must be adapted before being used on a machine.

Change the following contents as needed:

  • Tools
  • Cutting parameters
  • Feed rates
  • Clearance height or safe position
  • Machine-specific positions (e.g., with M91)
  • Paths of program calls

Some NC programs depend on the machine kinematics. Adapt these NC programs to your machine kinematics before the first test run.

In addition, test the NC programs using the simulation before the actual program run.

 
Tip

With a program test you determine whether the NC program can be used with the available software options, the active machine kinematics and the current machine configuration.

 0 BEGIN PGM EXAMPLE MM

 1 * - ...

; The purpose of this program is to finish the milling of hardened workpieces

 2 Q1400 = +19.995

; Lower tolerance

 3 Q1401 = +20

; Nominal dimension

 4 Q1402 = +20.005

; Upper tolerance

 5 BLK FORM 0.1 Z X-50 Y-50 Z-20

 6 BLK FORM 0.2 X+50 Y+50 Z+0

 7 CALL LBL "measure"

; Measure circular pocket

 8 IF Q966 < Q1400

; Check whether circular pocket is smaller than the lower tolerance

 9 WHILE Q966 < Q1400

; Program loop for reworking the circular pocket

10 CALL LBL "rework"

; Mill the circular pocket

11 CALL LBL "measure"

; Measure circular pocket

12 END WHILE

; End of the program loop

13 ELSE

; If the condition in NC block 8 is not fulfilled, the circular pocket is larger than the lower tolerance

14 IF Q966 <= Q1402

; Check whether circular pocket is larger than the upper tolerance

15 FN 16: F-PRINT pass.a / SCREEN:

; Output on screen: Circular pocket is OK

16 ELSE

; If the condition in NC block 14 is not fulfilled, the circular pocket is larger than the upper tolerance

17 FN 16: F-PRINT scrap.a / SCREEN:

; Output on screen: Circular pocket is too large

18 END IF

19 END IF

20 L Z+100 R0 FMAX

21 M30

22 LBL "measure"

23 TOOL CALL 600 Z

; Call touch probe

24 L Z+100 R0 FMAX

25 TCH PROBE 1401 CIRCLE PROBING ~

Q1100=+0

;1ST POINT REF AXIS ~

Q1101=+0

;1ST POINT MINOR AXIS ~

Q1102=-5

;1ST POINT TOOL AXIS ~

Q1116=+20

;DIAMETER 1 ~

Q1115=+0

;GEOMETRY TYPE ~

Q423=+4

;NO. OF PROBE POINTS ~

Q325=+0

;STARTING ANGLE ~

Q1119=+360

;ANGULAR LENGTH ~

Q320=+0

;SET-UP CLEARANCE ~

Q260=+100

;CLEARANCE HEIGHT ~

Q1125=+2

;CLEAR. HEIGHT MODE ~

Q309=+0

;ERROR REACTION ~

Q1120=+0

;TRANSFER POSITION

26 * - ...

; The control stores the diameter in Q966

27 LBL 0

28 LBL "rework"

29 Q1500 = ( Q1401 - Q966 ) / +2

; Calculate tool compensation from the nominal dimension and the measured diameter

30 TOOL CALL 5 Z S2000 F200 DR-Q1500

; Call milling tool

31 L Z+100 R0 FMAX M3

32 CYCL DEF 252 CIRCULAR POCKET ~

Q215=+2

;MACHINING OPERATION ~

Q223=+20

;CIRCLE DIAMETER ~

Q368=+0.1

;ALLOWANCE FOR SIDE ~

Q207=AUTO

;FEED RATE MILLING ~

Q351=+1

;CLIMB OR UP-CUT ~

Q201=-20

;DEPTH ~

Q202=+5

;PLUNGING DEPTH ~

Q369=+0

;ALLOWANCE FOR FLOOR ~

Q206=+150

;FEED RATE FOR PLNGNG ~

Q338=+0

;INFEED FOR FINISHING ~

Q200=+2

;SET-UP CLEARANCE ~

Q203=+0

;SURFACE COORDINATE ~

Q204=+50

;2ND SET-UP CLEARANCE ~

Q370=+1

;TOOL PATH OVERLAP ~

Q366=+1

;PLUNGE ~

Q385=AUTO

;FINISHING FEED RATE ~

Q439=+0

;FEED RATE REFERENCE

33 L X+0 Y+0 R0 FMAX M99

34 LBL 0

35 END PGM EXAMPLE MM