Hello, don't ask me why, but I would like to connect additional wire from tool release button on spindle (Z axis) inside machine and not the one on keyboard to an optional M code relay like this:
https://www.haascnc.com/service/codes-settings.type=mcode.machine=mill.value=M26.html
If you understand, I'd like to use let's say M21 to behave exactly as if you press on the Tool release button inside machine (on spindle)...
I know there is M82 and M86 for Tool clamp and Tool unclamp function, but the problem is it waits for the operation to complete (signal that the machine really did unclamp/clamp the tool). So it does not behave exactly as if you pressed on tool release button.
Sometimes air valves or drawbar mechanism on this old machine sticks and won't open secondary valve so you have to press it a couple of times so it does (when machine is very cold and didn't work for longer period of time), but I don't want to mess with real problem and fix the machine, I just want to do "simple fix" by making a small program which will do what I manually do when it sticks (press on tool release button as many times as necessary so it unsticks).
Anyways, the question here is: how to connect this wire to a relay to do what I want?