Brian
One problem i seem to be having is the rc return value from the g31, i get 0 back if the probe is hit or has run to the end of the travel
if i run to the the end of travel i get the message in the history that probe interrupted but still no error value returned in the rc only 0.
so when i check for the error the code skips over the error and return statements, and just keeps running.
this it the line i am running
rc = mc.mcCntlGcodeExecuteWait(inst, string.format("G91 G31 Z-%.3f F%.3f", ZMaxTravel, SlowFeed)) --probe Z
Thanks gary