To get your post into a state to produce "D" values, there are several edits that need to be made:
At line 2339, 2342, 2345:
Original:
switch (radiusCompensation) {
case RADIUS_COMPENSATION_LEFT:
writeBlock(gMotionModal.format(gCode), gFormat.format(41), x, y, z, f);
break;
case RADIUS_COMPENSATION_RIGHT:
writeBlock(gMotionModal.format(gCode), gFormat.format(42), x, y, z, f);
break;
Modified:
var compensationOffset = tool.isTurningTool() ? tool.compensationOffset : tool.lengthOffset;
switch (radiusCompensation) {
case RADIUS_COMPENSATION_LEFT:
writeBlock(gMotionModal.format(gCode), gFormat.format(41), x, y, z, "D" + compensationOffset, f);
break;
case RADIUS_COMPENSATION_RIGHT:
writeBlock(gMotionModal.format(gCode), gFormat.format(42), "D" + compensationOffset, x, y, z, f);
break;
And then again at #2386, 2389, 2392:
Original:
switch (radiusCompensation) {
case RADIUS_COMPENSATION_LEFT:
writeBlock(gMotionModal.format(isSpeedFeedSynchronizationActive() ? 32 : 1), gFormat.format(41), x, y, z, getFeed(feed));
break;
case RADIUS_COMPENSATION_RIGHT:
writeBlock(gMotionModal.format(isSpeedFeedSynchronizationActive() ? 32 : 1), gFormat.format(42), x, y, z, getFeed(feed));
break;
default:
writeBlock(gMotionModal.format(isSpeedFeedSynchronizationActive() ? 32 : 1), gFormat.format(40), x, y, z, getFeed(feed));
}
} else {
writeBlock(gMotionModal.format(isSpeedFeedSynchronizationActive() ? 32 : 1), x, y, z, getFeed(feed));
}
}
}
Modified:
var compensationOffset = tool.isTurningTool() ? tool.compensationOffset : tool.lengthOffset;
switch (radiusCompensation) {
case RADIUS_COMPENSATION_LEFT:
writeBlock(gMotionModal.format(isSpeedFeedSynchronizationActive() ? 32 : 1), gFormat.format(41), x, y, z, "D" + compensationOffset, getFeed(feed));
break;
case RADIUS_COMPENSATION_RIGHT:
writeBlock(gMotionModal.format(isSpeedFeedSynchronizationActive() ? 32 : 1), gFormat.format(42), x, y, z, "D" + compensationOffset, getFeed(feed));
break;
default:
writeBlock(gMotionModal.format(isSpeedFeedSynchronizationActive() ? 32 : 1), gFormat.format(40), x, y, z, getFeed(feed));
}
} else {
writeBlock(gMotionModal.format(isSpeedFeedSynchronizationActive() ? 32 : 1), x, y, z, getFeed(feed));
}
}
}
Seth Madore
Customer Advocacy Manager - Manufacturing