OR you could make it programable like this
'M79.m1s
Setvar(550,Param1)
Code"#551=[#550/2]"
Code"G90 G92 X0. Y0."
Code"G01 X[#551] Y[#551]"
Code"G03 X.0 Y[#550] I[-1* #551] J.0 G90"
Code"G03 X.0 Y[#550]I.0 J[-1*#550] G90"
Code"G03 X [-1*#551] Y[#551] I.0 J[-1*#551] G90"
Code"G01 G90 X.0 Y.0"
Code"G92.1"
End
and it will bore any size hole by calling it like this
G0G90X1.Y1. (Position to hole center)
G01Z-.5 F10. (feed to depth)
M79 P1.000
G0Z0
Yep Parametric programing is FUN and can be very usefull . It would be nice to get a MACH collection of usefull macros. There are all type of macros out there for OTHER systems. There are macros to do serial numbers , engraving, elispes, facing, circles, squares, drill patterns. thread milling, TAPER thread milling, etc
We have learned a few more unpublished mach tricks as well. Such as conditional programming inside Gcode with directional code. You can do the conditional part from a macro and from inside the macro you can redirect anywhere back inside the gcode by the use of a M98 call to the Oword in the gcode. Doing it this way allows you to move around inside the Gcode without the use of the M99(return). Also if you make the macro a simple phase it can be a generic programable macro that can be used many differrent ways.
M502 P3 Q1
' Macro.M1s
IF Param1 < Param2 Code" M98 P100" The macro checks the condition of the statement and then redirects mach to the O100 word in the Gcode file.
Note : mach limits us to ONLY 3 arguments doing it this way. It would be really NICE if we had a least 5 arguments instead of 3 OR 26 like is available in FANUC macroB
OF course you can always do it this way.
M502 #1=1 #2=2 #3=3 , etc that way allows you as many var inputs as the single block will hold, It just looks UGLY .
Just a thought, (;-) TP