From 30f4c415733db497ba29b5dd868a3436211f9038 Mon Sep 17 00:00:00 2001 From: will1742 Date: Tue, 6 Jul 2021 13:11:00 -0400 Subject: [PATCH] Added WCS verification --- Haas_Next_Generation/haas vf2.cps | 48 ++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 74219d0..6bf4ca8 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -414,7 +414,7 @@ staticProperties = { useDWO: true, safeStartAllOperations: true, preloadTool: true, - chipTransport: true, + chipTransport: false, optionalStop: true, separateWordsWithSpace: true, useRadius: false, @@ -441,7 +441,8 @@ staticProperties = { useM130PartImages: false, useM130ToolImages: false, coolantPressure: "", - singleResultsFile: true + singleResultsFile: true, + pencilWCSVerif: true }; const HAAS_DRILL = 1; @@ -1874,6 +1875,10 @@ function onManualNC(command, value) { var probeOutputWorkOffset = 1; var stockTopZ = -1; +var stockUpperX; +var stockLowerX; +var stockUpperY; +var stockLowerY; function onParameter(name, value) { if (name == "probe-output-work-offset") { @@ -1885,6 +1890,18 @@ function onParameter(name, value) { if (name == "stock-upper-z") { stockTopZ = value; } + if (name == "stock-upper-x") { + stockUpperX = value; + } + if (name == "stock-lower-x") { + stockLowerX = value; + } + if (name == "stock-upper-y") { + stockUpperY = value; + } + if (name == "stock-lower-y") { + stockLowerY = value; + } } var seenPatternIds = {}; @@ -2173,6 +2190,27 @@ function setAbsoluteMode(xyz, abc) { } function onSection() { + if (isFirstSection() && staticProperties.pencilWCSVerif) { + var stockMidX = (stockUpperX + stockLowerX)/2; + var stockMidY = (stockUpperY + stockLowerY)/2; + writeln(""); + writeComment("Verify WCS"); + writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool + writeBlock(gFormat.format(0), xOutput.format(stockMidX), yOutput.format(stockMidY)); + displayMedia("Net Share/Media/xyWCSCheck.png"); + writeBlock(mFormat.format(0), formatComment("Open door")); + displayMedia("Net Share/Media/arrowDown.png"); + var gotoRef = takeInput("Is the graphite probing device in the middle of the stock?", ['Y']); + writeWords("N" + nFormat.format(gotoRef['Y']), mFormat.format(131), formatComment("End Multimedia")); + writeBlock(gFormat.format(55), gFormat.format(43), hFormat.format(19), zOutput.format(stockTopZ)); + displayMedia("Net Share/Media/zWCSCheck.png"); + writeBlock(mFormat.format(0), formatComment("Open door")); + displayMedia("Net Share/Media/arrowDown.png"); + gotoRef = takeInput("Is the graphite probing device touching the stock?", ['Y']); + writeWords("N" + nFormat.format(gotoRef['Y']), mFormat.format(131), formatComment("End Multimedia")); + } + + var forceToolAndRetract = optionalSection && !currentSection.isOptional(); optionalSection = currentSection.isOptional(); @@ -2606,8 +2644,10 @@ function onSection() { writeComment("END VALIDATION SECTION"); // initialize spindle and engage coolant if heights are correct - writeBlock(mFormat.format((tool.clockwise ? 3 : 4)), formatComment("Restart spindle")); - setCoolant(tool.coolant); + if (tool.type != TOOL_PROBE) { + writeBlock(mFormat.format((tool.clockwise ? 3 : 4)), formatComment("Restart spindle")); + setCoolant(tool.coolant); + } // define subprogram subprogramDefine(initialPosition, abc, retracted, zIsOutput);