by cncdrive » Fri Feb 02, 2018 7:43 am
I've tested the same now as what you wrote.
I placed the mentioned two lines of codes in the M31 macro rigth after this line:
bool dodualcycle = true; //Do probing from 2 cycles, first with Fast and second with Slow feedrates
And I ran the M31 through MDI first and after in a simple G-code file with a few linear motions before and also after the M31 code.
The result is that the code works OK, I do not see the mentioned problem.
The tool number is set properly to 96 and the offset is defined to the value in the 96th tool table length field.
What possible problems/mistakes I see which could cause the issue in your system are:
1.) You did not Apply the new tool length values with the Apply settings button. Or if you written them from macro then with the Validatefield function.
So, the values are visually written there, but they are not applied. These field values however auto-validate in UCCNC 1.2102, but not in previous versions, so you must press the Apply settings if you running previous versions.
2.) You might keep this line in the M31 macro at around the end of the macro file:
exec.Code("G44 H1"); // Load tool offset one, note the tool lenght is defined in the tools menu
If so then the macro sets the offset to tool 1. length after it set it to tool 96. value, so the final result will be 0 if tool#1 length is set to 0.