- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can someone please help me with the codes below? I want the last preload tool to always be T99. Thank you
if (insertToolCall) {
if (!machineConfiguration.isHeadConfiguration()) {
var nextTool = getNextTool(tool.number);
if (nextTool) { // is there a next tool after this
writeBlock(gMotionModal.format(0), gFormat.format(currentSection.isMultiAxis() ? 43.5 : 43), zOutput.format(initialPosition.z),
hFormat.format(lengthOffset), setCoolant(tool.coolant), ("T" + toolFormat.format(nextTool.number)));
// set coolant after we have positioned at Z
// setCoolant(tool.coolant);
} else { // no next tool
var section = getSection(0);
var firstToolNumber = section.getTool().number;
if (tool.number != firstToolNumber) {
writeBlock(gMotionModal.format(0), gFormat.format(currentSection.isMultiAxis() ? 43.5 : 43), zOutput.format(initialPosition.z),
hFormat.format(lengthOffset), setCoolant(tool.coolant), ("T" + toolFormat.format(firstToolNumber)));
} else { //added if user selected only one operation
writeBlock(gMotionModal.format(0), gFormat.format(currentSection.isMultiAxis() ? 43.5 : 43), zOutput.format(initialPosition.z),
hFormat.format(lengthOffset), setCoolant(tool.coolant), ("T" + toolFormat.format(tool.number)));
}
}
} else {
Solved! Go to Solution.