Doing it at the servo drive level won't work either, Tried that as well using the servo brake
Anything you see at the drive level is already BEHIND the time curve of the buffered data AND mach has no idea what is happening at the servo level movement wise so it cannot STOP the data flow out of the port.
My goal it so make the function transparent to Mach so what mach knows or doe not know would be irrelevant. What is or is not in a buffer would also not have any practical effect.
By way of example, a hypothetical scenario would go like this:
Premise:
4th axis is in 'indexer' mode connected to the A axis drive. G-code commanded position: G1 A425 The servo drive only sees A axis steps and no other.
1)Upon reaching azimuth 425, the drive reports 'position reached'
2)That signal (+5V) is used to trigger the lock ON (** and perhaps simultaneously disable the drive)
3)new A axis steps come into the drive.
4) within 1ms (I am told) the 'position reached' line goes low and the HV to the motor come on (**IF the drive is enabled)
5) that signal (0V) released the lock (** and perhaps enables the drive)
6) Axis moves to new azimuth and the process repeats.
Other than the axis attempting to move before the lock can release, I don't see a fatal flaw in the process, but I would definitely want to know if anyone else does.
Can you elaborate more on what it is you tried at the servo level?