@skiptonsheetmetal wrote:
@HughesTooling thanks for the information. What does it achieve having the G08 or G09 in the code? And how would I input that into the post. Very much new to all this so it's all learning.
Thanks
In G08 (Exact stop) mode the machine pauses at the end of each move. In G09 (Exact stop off) mode the machine doesn't pause and any sharp moves will be rounded and you lose a bit of accuracy but code runs faster. For adaptive changes in direction are smooth and you generally leave some stock so you don't notice any problems with accuracy.
It's a long time since I setup my post but from what I can see it looks like G00 rapid moves cancel the G09 so it needs to be output after each G00.
What I did in my post was create a variable to keep track of the state (G08/G09).

Then in the onLinear function added this.

function onLinear(_x, _y, _z, feed) {
// at least one axis is required
if (pendingRadiusCompensation >= 0) {
// ensure that we end at desired position when compensation is turned off
xOutput.reset();
yOutput.reset();
}
var x = xOutput.format(_x);
var y = yOutput.format(_y);
var z = zOutput.format(_z);
var f = feedOutput.format(feed);
if (x || y || z) {
if (pendingRadiusCompensation >= 0) {
pendingRadiusCompensation = -1;
var d = tool.diameterOffset;
if (d > numberOfToolSlots) {
warning(localize("The diameter offset exceeds the maximum value."));
}
writeBlock(gPlaneModal.format(17));
switch (radiusCompensation) {
case RADIUS_COMPENSATION_LEFT:
writeBlock(gMotionModal.format(1), gFormat.format(41), x, y, z, f);
break;
case RADIUS_COMPENSATION_RIGHT:
writeBlock(gMotionModal.format(1), gFormat.format(42), x, y, z, f);
break;
default:
writeBlock(gMotionModal.format(1), gFormat.format(40), gFormat.format(08), x, y, z, f);
}
} else {
if ((GC9 == false) && ((getParameter("operation:strategy") == "adaptive" ) ||(getParameter("operation:strategy") == "adaptive2d" ))){
GC9 = true;
writeBlock(gFormat.format(9), gMotionModal.format(1), x, y, z, f);
} else {
writeBlock(gMotionModal.format(1), x, y, z, f);
}
}
} else if (f) {
if (getNextRecord().isMotion()) { // try not to output feed without motion
feedOutput.reset(); // force feed on next line
} else {
writeBlock(gMotionModal.format(1), f);
}
}
}
Then modify onRapid adding GC9 = false. I think the rapid cancels the G09 in the control but you could add a gFormat.format(08) to make sure.

So the line would be.
writeBlock(gMotionModal.format(0), gFormat.format(08), x, y, z);
Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
