Hello @ubi.james13
we can use a similar trick for this issue.
In the global section add the following variable
var turret1ToolFormat;
then in the onOpen function
machineConfiguration = new MachineConfiguration(); // creates an empty configuration to be able to set eg vendor information
turret1GotYAxis = gotYAxis;
turret1ToolFormat = toolFormat; // new addition
if (!gotYAxis) {
yOutput.disable();
}
after in the onSection function
// Detect machine configuration
if (activeTurret == 2) {
machineConfiguration = (currentSection.spindle == SPINDLE_PRIMARY) ? machineConfigurationMainTurret2 : machineConfigurationSubTurret2;
gotYAxis = false;
yOutput.disable();
toolFormat = CreateFormat({decimals:0, width:4, zeropad:true}); // new addition
} else {
machineConfiguration = (currentSection.spindle == SPINDLE_PRIMARY) ? machineConfigurationMainSpindle : machineConfigurationSubSpindle;
toolFormat = turret1ToolFormat; // new addition
gotYAxis = turret1GotYAxis;
Finally still inside onSection, at the toolchange output:
} else {
// preload first tool
var section = getSection(0);
var firstToolNumber = section.getTool().number;
if ((tool.number != firstToolNumber) && (section.getTool().turret != 2)) {
writeBlock("T" + toolFormat.format(firstToolNumber * 1000), formatComment("NEXT TOOL"));
}
}
if (activeTurret == 2) { // addition
writeBlock("T" + toolFormat.format(tool.number * 1000 + compensationOffset));
} else { // addition
writeBlock("T" + toolFormat.format(tool.number * 100 + compensationOffset)); // addition
} // addition
} else {
As previously, test with care, and don't hesitate to provide feedback.
Regards.
______________________________________________________________
If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!