(DRILLING WITHOUT 3-D COORDINATE CONVERSION) (X,Y,Z VALUES ARE LOCAL WORKPLANE COORDINATES) (LOCAL WORKPLANE ORIGIN IS HOLE LOCATION) (DRILLING USING 3-D COORDINATE CONVERSION) G68 I1 J0 K0 R#1 (A-AXIS SECONDARY/SLAVE) (SKIP 3-D COORDINATE CONVERSION IF ANGULAR SUM = 0) (POSITION TO HOLE W/CLEARANCE BEFORE 3-D COORDINATE CONVERSION) IF GOTO 9992 (NO LEFT-HAND RIGID TAPPING) IF GOTO 9992 (NO RIGHT-HAND RIGID TAPPING) (INITIALIZE VALUES TO FORCE ABSOLUTE VALUES) (VERIFY ALL REQUIRED VARIABLES ARE SPECIFIED) (R0.1 - INCREMENTAL CLEARANCE PLANE - ALWAYS POSITIVE - REQUIRED) (Q0.1 - INCREMENTAL PECK DEPTH - ALWAYS POSITIVE - REQUIRED FOR G73/G83 CYCLES) (P0 - DWELL IN MILLISECONDS W/O DECIMAL POINT - OPTIONAL FOR G82 CYCLE) (H1.0 - INCREMENTAL HOLE DEPTH - ALWAYS POSITIVE - REQUIRED) (A10.0 B20.0 - ROTARY AXIS COORDINATES - REQUIRED)
(X0 Y0 Z0 - HOLE LOCATION COORDINATES - REQUIRED)
#USING NCPLOT TO WRITE GCODE SERIES#
(THIS MACRO SUPPORTS A FANUC 15M SERIES CONTROL)
#USING NCPLOT TO WRITE GCODE CODE#
G68 was the code for the 3D Coordinate Conversion then. The Macro was written for a 5-Axis Profiler with the B-Axis as the Primary/Master This is a Macro I wrote about 10 years ago for a FANUC 15M as a custom G-Code Cycle for 5-axis drilling. So, I have seen a real use for macro programming and how powerful it is. With the new Probe toolpaths in Mastercam maybe there is less need for these kinds of macros? But I have never used the probe toolpaths since these aren't an option we have so I have no idea. He took an ordinary horizontal program running 24 parts through two operations on one tombstone and made it a really slick program that ran unmanned for like 20+ hours making tight tolerance Aerospace parts. I didn't understand it at all, but seeing it in action made me wish I did. The probe also checked the parts in-process and made offsets if I remember correctly. He also had a custom probing routine that would set 48 fixture offsets. On a part I wrote a program for though he used macros to check for tool breakage and use redundant tooling. I just know it made it impossible for me to see what was going on in the program. He used macros throughout the program, but I can't tell you what they did. He programmed twin spindle/twin turret Mori-Seiki 8 axis machines.
My old boss uses them pretty aggressively, and was amazing at finding uses for macros in his programming. How firm are you in your beliefs on this issue? How many of you actively use "macro" programming? I am curious how many of you agree/disagree with me. so in general, "macro programming" is not necessary for the today's average CNC machinist. I also like to say, there really isn't anything that can't be programmed on the shop floor with standard G-code, conversational programming, or a CAD/CAM system. But, also, learn sub-programming too because it is another tool in your toolbox. My standard answer to my students is, not very many shops use "macro" programming, but if yours does, great, don't buck the system, do what your co-workers are teaching you because making friends with the journeymen is the best way to survive. From what I have seen, custom macro's can be very powerful tools if the person writing them knows their stuff. this usually comes up when I am demonstrating sub-programming and looping and the projects that go along with that.
Typically, a student will say the shop they work at uses a "macro" for certain operations like slot cutting or pocket milling. I have been teaching a CNC course at my local college for about 8 years and the subject of "macro programming" comes up from time to time.