Dave3891,
Here is a little plug that you can use, you can use a custom M code to turn on and off a User LED that while it is on, then when Z goes below 0.0 the OUTPUT1 goes hot, the config on it is so you can pick what ever UserLED number you want, and you can also pick OUTPUTs 1-6,
further you can choose to use the Para Port, and/or you can also send the result of the Output you choose, to the Serial Plugin Modbus and you can choose the Config and Local var you want. NOTE: you will HAVE to have the Serial Plugin Modbus configured and working otherwize if you send to the modbus that is NOT working it will estop mach since it is an error.
The built in Modbus is so you can send the result of the OUTPUT1 directly to the Serial Plugin Modbus.
Defaults are: Z level 0.0, OUTPUT1, ParaPort output (it has a memory so you can configure something different). the LESS than Z 0.0 is hardcoded in the plugin.
so once you run lets say M8888 that inside it you turn on "SetUserLED(1500,1)"
then once that LED is ON, any time your Z goes below 0.0 the OUTPUT1 (or 1-6 as options), which that output can be sent via standard PP (that in turn could be used in Brians or VB, or paraport direct), AND/OR you could send it out directly over the modbus.
Once all your many drilling cycles are done, you would run for example M8889 that would turn OFF User LED1500 and that would disable the clamp function. "SetUserLED(1500,0)"
You could also put 2 custom BUTTONs on your run screen that could turn on the other off the UserLED 1500 for example.
scott