Open the post in any editor
and find for function onCircular
You will get to see the codes like this.
case PLANE_YZ:
yOutput.reset();
zOutput.reset();
jOutput.reset();
kOutput.reset();
break;
}
}
// Select the codes form here>>>>>>>>>>>>>>>>>>>>>>>>>>>
function onCircular(clockwise, cx, cy, cz, x, y, z, feed) {
// one of X/Y and I/J are required and likewise
if (pendingRadiusCompensation >= 0) {
error(localize("Radius compensation cannot be activated/deactivated for a circular move."));
return;
}
var start = getCurrentPosition();
if (isFullCircle()) {
if (isHelical()) {
linearize(tolerance);
return;
}
switch (getCircularPlane()) {
case PLANE_XY:
forceCircular(getCircularPlane());
writeBlock(gPlaneModal.format(17), gMotionModal.format(clockwise ? 2 : 3), xOutput.format(x), iOutput.format(cx - start.x), jOutput.format(cy - start.y), feedOutput.format(feed));
break;
case PLANE_ZX:
forceCircular(getCircularPlane());
writeBlock(gPlaneModal.format(18), gMotionModal.format(clockwise ? 2 : 3), zOutput.format(z), iOutput.format(cx - start.x), kOutput.format(cz - start.z), feedOutput.format(feed));
break;
case PLANE_YZ:
forceCircular(getCircularPlane());
writeBlock(gPlaneModal.format(19), gMotionModal.format(clockwise ? 2 : 3), yOutput.format(y), jOutput.format(cy - start.y), kOutput.format(cz - start.z), feedOutput.format(feed));
break;
default:
linearize(tolerance);
}
} else {
switch (getCircularPlane()) {
case PLANE_XY:
forceCircular(getCircularPlane());
writeBlock(gPlaneModal.format(17), gMotionModal.format(clockwise ? 2 : 3), xOutput.format(x), yOutput.format(y), zOutput.format(z), iOutput.format(cx - start.x), jOutput.format(cy - start.y), feedOutput.format(feed));
break;
case PLANE_ZX:
forceCircular(getCircularPlane());
writeBlock(gPlaneModal.format(18), gMotionModal.format(clockwise ? 2 : 3), xOutput.format(x), yOutput.format(y), zOutput.format(z), iOutput.format(cx - start.x), kOutput.format(cz - start.z), feedOutput.format(feed));
break;
case PLANE_YZ:
forceCircular(getCircularPlane());
writeBlock(gPlaneModal.format(19), gMotionModal.format(clockwise ? 2 : 3), xOutput.format(x), yOutput.format(y), zOutput.format(z), jOutput.format(cy - start.y), kOutput.format(cz - start.z), feedOutput.format(feed));
break;
default:
linearize(tolerance);
}
}
}
// Upto here>>>>>>>>>>>>>>>>>>>>
var mapCommand = {
COMMAND_STOP:0,
COMMAND_END:2,
COMMAND_SPINDLE_CLOCKWISE:3,
COMMAND_SPINDLE_COUNTERCLOCKWISE:4,
COMMAND_STOP_SPINDLE:5
};
select the codes as mentioned above and replace with the below codes
function onCircular(clockwise, cx, cy, cz, x, y, z, feed) {
// one of X/Y and I/J are required and likewise
if (pendingRadiusCompensation >= 0) {
error(localize("Radius compensation cannot be activated/deactivated for a circular move."));
return;
}
var start = getCurrentPosition();
var circle = new CircularData(getCircularPlane(), new Vector(cx, cy, cz), new Vector(x, y, z));
if (isFullCircle()) {
if (isHelical()) {
linearize(tolerance);
return;
}
switch (getCircularPlane()) {
case PLANE_XY:
forceCircular(getCircularPlane());
writeBlock(
gAbsIncModal.format(90), gPlaneModal.format(17), gMotionModal.format(clockwise ? 2 : 3),
iOutput.format(circle.offset.x), jOutput.format(circle.offset.y), feedOutput.format(feed)
);
break;
case PLANE_ZX:
forceCircular(getCircularPlane());
writeBlock(
gAbsIncModal.format(90), gPlaneModal.format(18), gMotionModal.format(clockwise ? 2 : 3),
iOutput.format(circle.offset.x), kOutput.format(circle.offset.z), feedOutput.format(feed)
);
break;
case PLANE_YZ:
forceCircular(getCircularPlane());
writeBlock(
gAbsIncModal.format(90), gPlaneModal.format(19), gMotionModal.format(clockwise ? 2 : 3),
jOutput.format(circle.offset.y), kOutput.format(circle.offset.z), feedOutput.format(feed)
);
break;
default:
linearize(tolerance);
}
} else {
switch (getCircularPlane()) {
case PLANE_XY:
forceCircular(getCircularPlane());
writeBlock(
gAbsIncModal.format(90), gPlaneModal.format(17), gMotionModal.format(clockwise ? 2 : 3),
xOutput.format(circle.end.x), yOutput.format(circle.end.y), zOutput.format(circle.end.z),
iOutput.format(circle.offset.x), jOutput.format(circle.offset.y), feedOutput.format(feed)
);
break;
case PLANE_ZX:
forceCircular(getCircularPlane());
writeBlock(
gAbsIncModal.format(90), gPlaneModal.format(18), gMotionModal.format(clockwise ? 2 : 3),
xOutput.format(circle.end.x), yOutput.format(circle.end.y), zOutput.format(circle.end.z),
iOutput.format(circle.offset.x), kOutput.format(circle.offset.z), feedOutput.format(feed)
);
break;
case PLANE_YZ:
forceCircular(getCircularPlane());
writeBlock(
gAbsIncModal.format(90), gPlaneModal.format(19), gMotionModal.format(clockwise ? 2 : 3),
xOutput.format(circle.end.x), yOutput.format(circle.end.y), zOutput.format(circle.end.z),
jOutput.format(circle.offset.y), kOutput.format(circle.offset.z), feedOutput.format(feed)
);
break;
default:
linearize(tolerance);
}
}
}
Hope its clear now
Boopathi Sivakumar
Principal Technology Consultant