Hello @dcsDHNS6
if you want to use a different spindle code for drilling you can edit your post, and make the following changes.
Search for this block of code, inside the onSection function:
if (spindleSpeed > 99999) {
warning(localize("Spindle speed exceeds maximum value."));
}
skipBlock = !outputSpindleSpeed;
writeBlock(
sOutput.format(spindleSpeed), mFormat.format(tool.clockwise ? 3 : 4)
);
onCommand(COMMAND_START_CHIP_TRANSPORT);
if (forceMultiAxisIndexing || !is3D() || machineConfiguration.isMultiAxisConfiguration()) {
And change it to this new code:
skipBlock = !outputSpindleSpeed;
var spCmd;
if (isDrillingCycle()) {
spCmd = tool.clockwise ? 33 : 34;
} else {
spCmd = tool.clockwise ? 3 : 4;
}
writeBlock(
sOutput.format(spindleSpeed), mFormat.format(spCmd)
);
onCommand(COMMAND_START_CHIP_TRANSPORT);
This will take care of the spindle on function.
Next is the support for spindle off.
Again, let's search for a piece of code in the onSection function:
if (insertToolCall || newWorkOffset || newWorkPlane) {
// stop spindle before retract during tool change
if (insertToolCall && !isFirstSection()) {
onCommand(COMMAND_STOP_SPINDLE);
}
// retract to safe plane
And change into the new code :
if (insertToolCall || newWorkOffset || newWorkPlane) {
// stop spindle before retract during tool change
if (insertToolCall && !isFirstSection()) {
if (isDrillingCycle(getPreviousSection())) {
writeBlock(mFormat.format(5));
} else {
onCommand(COMMAND_STOP_SPINDLE);
}
}
Hope it helps,
Regards
______________________________________________________________
If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!