Now if I choose to peck drill in W axis instead of Z axis.
Is there anything that I'm missing? And if I could ask what a FEED MODE is? Not familiar with that. In the example G183 I95.
I assume this is "W" axis as in machines equipped with a Quill Axis, as opposed to the Incremental equivalent to the Z axis of a lathe. That being so, you would have to replace all references to:
1. the current "Z" with "W", that is currently "PERCENTAGE REDUCTION FACTOR OF PECK VALUE",
2. the current #26, Local Variable corresponding to Z Argument, with #23, Local Variable corresponding to W Argument
3. the current #23 with another Local Variable that's not being used; "C" would be OK. In this case, any reference to the current #23 in the Macro Program would have to be changed to #3.
The Feed Mode being referred to is Feed Per Minute and Feed Per Rev, G94 and G95 respectively. I included this as a Required Argument in the Calling Block to ensure the User was clear as to the type of feed method wanted. You could instead do the following, and it would be more intuitive.
G94 (or G95) G183 Z-50.0 R1.0 Q5.0 K-35.0 U0.5 V2.5 A1.0 B0.5 W0.6 E0.15 F0.25 H20. S-40. T4.
1. Delete the "I" argument in the Calling Block
2. Delete all reference to #4 in the Error Traps
3. Delete N200#3000=5(INVALID FEED MODE) from the Error Message area
4. At the top of the (PRE-MAIN LOOP FUNCTIONS) add:
#4 = #4005
If G94/G95 is omitted from just before the Macro Call Statement, #4 will take on the value of whatever Feed Method was Modal in the program prior to the Macro Program being called.
Regards,
Bill