I have never programmed Mach3 so this might not fit exact. Do you know if your control supports variables #1,#2, #100 ect.?
There is a few different ways that you can go about this. From what you have said the only variable from job to job will be the distance to travel in the X from punch to punch? And I would assume the number of punches in a given job? What is your code for activating the punch? I would look at programming it like this as long as the control can support IF,THEN,WHILE statements.
O0001(punch macro)
#100=1.2---------------hole to hole X distance
#101=50----------------number of holes to punch
WHILE[#101GT0]DO1
G0G91X#100-----------INCREMENTAL this can be set up absolute if you want
M123------------------code to activate the punch
#101=#101-1
END1
M30
This will keep looping through moving the X1.2" at a time then punching. It will do this 50 times or what ever you set #101 equal to. Then it will end.
Stevo |