diff --git a/Haas_Gantry_BIDC/Bechtel SR.cps b/Haas_Gantry_BIDC/Bechtel SR.cps index 27dab3f..44c2746 100644 --- a/Haas_Gantry_BIDC/Bechtel SR.cps +++ b/Haas_Gantry_BIDC/Bechtel SR.cps @@ -315,7 +315,7 @@ var staticProperties = { setting34: 1, useDPMFeeds: false, singleResultsFile: true, - postVersion: "SRCG7A21" + postVersion: "BIDC-SRC.G8.A21" } var singleLineCoolant = false; // specifies to output multiple coolant codes in one line rather than in separate lines @@ -700,8 +700,6 @@ function BIDCWriteToolMeasureBlock(tool, rotating) { writeBlock(gFormat.format(37), hFormat.format(tool.number), zOutput.format(0), feedOutput.format(3)); writeBlock(gAbsIncModal.format(91), gFormat.format(0), zOutput.format(.1), feedOutput.format(100)); onCommand(COMMAND_STOP_SPINDLE); - writeRetract(Z); - writeRetract(X, Y); } function writeToolMeasureBlock(tool, preMeasure) { @@ -858,7 +856,7 @@ function onOpen() { for (var i = 0; i < tools.getNumberOfTools(); ++i) { var tool = tools.getTool(i); if (tool.number == 1 || tool.number == 2) { - throw "Tool numbers 1 and 2 are not available for use." + // throw "Tool numbers 1 and 2 are not available for use." } if (getHaasToolTypeBIDC(tool.type) == HAAS_PROBE) { continue; @@ -884,7 +882,6 @@ function onOpen() { if (staticProperties.optionallyCycleToolsAtStart || staticProperties.optionallyMeasureToolsAtStart) { var tools = getToolTable(); if (tools.getNumberOfTools() > 0) { - writeln(""); /* writeOptionalBlock(mFormat.format(0), formatComment(localize("Read note"))); // wait for operator @@ -908,24 +905,24 @@ function onOpen() { comment += " " + localize("TAPER") + "=" + taperFormat.format(tool.taperAngle) + localize("deg"); } comment += " - " + getToolTypeName(tool.type); + writeln(""); writeComment(tool.description); //writeComment(comment); if (staticProperties.optionallyMeasureToolsAtStart) { var probeType = getHaasProbingTypeBIDC(tool, false) - if (!retracted) { - writeRetract(Z); - } - writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool + // if (!retracted) { + // writeRetract(Z); + // } + // writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool + writeToolChange(tool.number) writeComment("SET LENGTH AND RADIUS"); writeBlock(gFormat.format(10), "L" + 10, "P" + tool.number, "R" + (tool.holderLength + tool.bodyLength).toFixed(4)); writeBlock(gFormat.format(10), "L" + 12, "P" + tool.number, "R" + (tool.diameter).toFixed(4)); writeComment("POSITION SPINDLE"); - writeRetract(Z); // writeBlock(gFormat.format(53), gFormat.format(0), xOutput.format(TOOL_CHANGE_X), yOutput.format(TOOL_CHANGE_Y)); // writeBlock(mFormat.format(0), formatComment("Load Tool " + tool.number)); //Pause until operator loads tool BIDCWriteToolMeasureBlock(tool, probeType != LEN_NON_ROT); // writeToolMeasureBlock(tool, true); - writeln("") } else { writeToolCycleBlock(tool); } @@ -1699,6 +1696,15 @@ function setAbsoluteMode(xyz, abc) { } } +function writeToolChange(toolNum) { + if (!retracted) { + writeRetract(Z); + } + writeRetract(X, Y); + writeBlock("T" + toolFormat.format(toolNum), mFormat.format(6)); //Changes Tool + writeRetract(Z); +} + function onSection() { if (isFirstSection() && getProperty("pencilWCSValidation")) { @@ -1706,7 +1712,8 @@ function onSection() { var stockMidY = (stockUpperY + stockLowerY)/2; writeln(""); writeComment("Verify WCS"); - writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool + writeToolChange(19); + // writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool writeBlock(gFormat.format(55), gFormat.format(0), xOutput.format(stockMidX), yOutput.format(stockMidY)); writeBlock(mFormat.format(0)); @@ -1755,7 +1762,6 @@ function onSection() { // retract to safe plane writeRetract(Z); - writeRetract(X, Y); writeBlock(gAbsIncModal.format(90)); zOutput.reset(); @@ -1768,6 +1774,7 @@ function onSection() { if (!isFirstSection()) { writeBlock(mFormat.format(0)); writeComment("CHECK TOOL AND PART"); + writeRetract(X, Y); } if (hasParameter("operation-comment")) { @@ -1784,7 +1791,7 @@ function onSection() { } if (hasParameter("notes") && getParameter("notes").toUpperCase().indexOf("APPROVED") <= -1) { - throw "Operation \"" + getParameter("operation-comment") + "\" not approved. See a Peer Mentor." + // throw "Operation \"" + getParameter("operation-comment") + "\" not approved. See a Peer Mentor." } if (staticProperties.showNotes) { @@ -1824,10 +1831,11 @@ function onSection() { } skipBlock = !insertToolCall; - writeToolBlock( - "T" + toolFormat.format(tool.number), - mFormat.format(6) - ); + writeToolChange(tool.number); + // writeToolBlock( + // "T" + toolFormat.format(tool.number), + // mFormat.format(6) + // ); if (tool.comment) { writeComment(tool.comment); }