Hi,
I would think that possible in Mach3.
I have started using Mach4 and I know I could program Mach4 to do that, and I presume it could be done in Mach3 as well but I'm no expert in VB
so I cannot help you with it. If you wanted to try Mach4 I would help with a Lua macro which would do as you require.
Ignoring the differences between Mach3 and Mach4 the general idea is:
1) The motion of the Z axis is controlled by a macro, say m111
2) When m111 is called from the Gcode job:
2a)The Z axis (hydraulic cylinder) is directed to move downwards to punch the material
2b) The Z axis completes its move as detected by the lower limit switch. Note that depending on the material will vary in time. That's OK because Mach is going to
wait until the limit switch activates
2c) The Z axis is directed to move upwards, ie retract
2d) The Z axis completes the retraction as signaled by the upper limit switch, Mach waits until the upper limit is activated
2e) The macro m111 is complete and control reverts back to the main Gcode calling program
3) The Gcode job progresses, calling m111 at each instance the Z axis is required to punch a hole.
Craig