My apologies if this question has been addressed elsewhere. I have attempted due diligence but have not found an answer. I might have missed it because of the sheer volume of information and posts. The closest data I found related to commercial probes with vendor supplied software.

I have just completed a homemade contact probe. In an effort to avoid crashing it through dumb setup errors, I wish to incorporate protected moves in my routines. To do this, I envision using G31 for all moves, then testing the results to see if either I got to where I was supposed to and didn't hit something when I wasn't supposed to or I got to the end of a probe move and didn't hit something when I was supposed to. I'm under the impression that if the G31 completes without the probe making contact, the distance moved will be exactly that programmed. Therefore if the probe made contact before then and it wasn't supposed to, it was an error. Conversely, it it got to the programmed amount and wasn't supposed to, it was a setup error.

I can handle the setup errors, I think. It's the 'crash' errors I need help with. I envision setting some type of error flag somewhere that can only be cleared with the reset button and then exiting the routine. How do I do this?

Is my above assumption regarding the amount moved for no contact correct?

Thank you for your patience and help.