Hi,
I think the answer is yes but it will be insufficient to protect your probe.
When Mach executes a G31 move it is the motion controller which monitors the probe signal and stops the axis movements the moment it does. If you wish to
have Mach monitor the probe input then there will be a delay of many milliseconds before the motion controller can signal Mach an event has occurred. Even
now that Mach is aware of a probe event it now has to abort the remainder of the jog move it has already committed to the motion controller and the controller
is executing. The current move must complete before Mach can seize control.
Note that this is different to a G31 move in that the motion controller aborts the remainder of the probe move immediately and then reports back to Mach the position where
the abort occurred.
This behavior is because Windows and therefore Mach is not a realtime system. The delays in communication mean that there are a number of time critical motion
processes that the controller must enact because Mach can't.
As you may be aware some controllers, PoKeys boards as standard and Vital Systems boards as a paid extra feature, have the ability to program directly on the board
which IS realtime. Thus with either of those boards you could program them to do as you wish but you would have to involve yourself in some fairly low level
programming none of which has anything to do with Mach or Lua and may therefore be little support for such an effort.
I should point out that Galil is the motion control granddaddy of them all. With their boards you can program robotics and all sorts. They are famous for it and the company
has very good support for controller level programming, downside is that even one of their cheapest three axes boards are in excess of $2000. Beyond most hobbyists means
but if you have a complex realtime motion control problem Galil is the hardware you reach for and to hell with the cost.
Craig