7 Programming with Q Parameters
L
7.8 Examples for Exercise
27 LBL 1 ..................................................................... Subprogram bolt hole circle
28 FN 0: 010 = +0 ..................................................... Set the counter for finished holes
29 FN 10: IF +Q6 NE +0 GOT0 LBL 10 .................... If the hole angle increment has been entered, jump to LBL 10
30 FN 4: 06 = +360 DIV +Q3 ....................................
Calculate the hole angle increment, distribute holes over 360”
31 LBL 10
32 FN 1 : Ql 1 = +Q5 + +Q6..
.....................................
Calculate second hole position from the start angle and hole
angle increment
33 CC X+Ql Y+Q2 .................................................... Set pole at bolt hole circle center
34 LP PR+Q4 PA+QS RO F MAX M3 ........................ Move in the plane to 1 st hole
35 L Z+Q7 RO F MAX M99 ........................................
Move in Z to setup clearance, call cycle
36 FN 1 : 010 = +QlO + +I ....................................... Count finished holes
37 FN 9: IF +QlO EQU +Q3 GOT0 LBL 99.. ............. Finished?
38 LBL 2
39 LP PR+Q4 PA+Ql 1 RO F MAX M99 .................... Make a second and further holes
40 FN 1 : 010 = +QlO + +I ....................................... Count finished holes
41 FN 1: 01 1 = +Ql 1 + +Q6.. ................................... Calculate angle for next hole
(update)
42 FN 12: IF + 010 LT + Q3 GOT0 LBL 2 ................ Not finished?
43 LBL 99
44 L Z+200 RO F MAX ............................................... Retract in Z
45 LBL 0.
....................................................................
End of subprogram
46 END PGM 3600715 MM
TNC 370
7-l 7