View Full Version : Need Help! using variables and subprograms to drill in 4th axis


ggamalski
05-13-2008, 06:10 AM
Fadal 40/20 w/mp32 multi control
Tecnara 4th axis
Format 1
Mastercam V9.sp2


I need to write a program that would have operator-defined variables. The parts are cylinders of various diameters and lengths having holes drilled in a grid around then periphery. Rows of holes will be staggered/shifted from each other. Number of holes in each row will vary for 5-20 holes, based on workpiece diameter, as will the depth of the holes, distance between the holes and the numbers of rows. Larger diameter = more holes per row and more rows per part. Some larger parts may have 5000-8000 holes. Y-axis value will always be Y0.00

I.e.;
A pattern like this around the part

. . . . . . . .
_. . . . . . . .
. . . . . . . .
_. . . . . . . .


I'm thinking the operator would have to input the following:

Diameter of part (?)
X-axis location of first hole
Number of holes per row
Distance between holes (in x) in row
Number of equally spaced rows and/or angular distance between rows.
Stagger/shift amount (in x) between alternating rows
Depth of hole


Ideally I would like to make only one lap around the part but, will do 2 laps if I need to in order to accommodate the stagger/shift of the rows.

Hopefully, I can do it using variables and subprograms and the program would be very short. I'm fairly adept at using the subprogram (i.e.; L101) features, however I have never written using variables. If I can do it in Mastercam that’s fine but would like to be able to re-write programs fast, as needed.

Any help is appreciated.