local DustBoot = {} -- Dustshoe Entry Settings local inst = mc.mcGetInstance() local hreg, rc, ignoreDustBoot local DustBootX = 46.2057 local DustBootY = 11 local DustbootZ = -3.7143 local DustbootRateY = 100 local DustBootRateZ = 200 local DustBootYSlide = 4 local DustBootStatus hreg, rc = mc.mcRegGetHandle(inst, "iRegs0/DustBoot/ignoreDustBoot") if (rc == 0) then ignoreDustBoot, rc = mc.mcRegGetValue(hreg) hreg, rc = mc.mcRegGetHandle(inst, "iRegs0/DustBoot/DustBootX") DustBootX, rc = mc.mcRegGetValue(hreg) hreg, rc = mc.mcRegGetHandle(inst, "iRegs0/DustBoot/DustBootY") DustBootY , rc = mc.mcRegGetValue(hreg) hreg, rc = mc.mcRegGetHandle(inst, "iRegs0/DustBoot/DustBootZ") DustBootZ, rc = mc.mcRegGetValue(hreg) hreg, rc = mc.mcRegGetHandle(inst, "iRegs0/DustBoot/DustBootRateY") DustBootRateY, rc = mc.mcRegGetValue(hreg) hreg, rc = mc.mcRegGetHandle(inst, "iRegs0/DustBoot/DustBootRateZ") DustBootRateZ, rc = mc.mcRegGetValue(hreg) hreg, rc = mc.mcRegGetHandle(inst, "iRegs0/DustBoot/DustBootYSlide") DustBootYSlide, rc = mc.mcRegGetValue(hreg) hreg, rc = mc.mcRegGetHandle(inst, "iRegs0/DustBoot/DustBootStatus") DustBootStatus, rc = mc.mcRegGetValue(hreg) else ignoreDustBoot = 0 end ------ How far from dustshoe to start with Y Park Movement -- =========================================================== drop dust boot ============================================================================= function DropDustBoot() if (ignoreDustBoot == 1 or DustBootStatus == 0) then do return end end GCode = "G00 G90 G53 Z-1\n" ------ Z Up rc = mc.mcCntlGcodeExecuteWait(inst, GCode) if (rc ~= 0) then do return end end GCode = string.format("G00 G90 G53 X%.4f Y%.4f \n", DustBootX, DustBootY-DustBootYSlide) ------ TO DUSTSHOE ENTRY mc.mcCntlGcodeExecuteWait(inst, GCode) GCode = string.format("G00 G90 G53 Z%.4f\n", DustBootZ) ------ TO DUSTSHOE Z mc.mcCntlGcodeExecuteWait(inst, GCode) GCode = string.format("G01 G90 G53 Y%.4f F%.4f\n", DustBootY,DustBootRateY) ------ MOVE Y INTO DUSTSHOE HOLDER mc.mcCntlGcodeExecuteWait(inst, GCode) GCode = "G00 G90 G53 Z-1\n" ------ PICK UP Z --- DROP SHOE IN HOLDER -- mc.mcCntlGcodeExecuteWait(inst, GCode) GCode = string.format("G00 G90 G53 Y%.4f \n", DustBootY-DustBootYSlide) ------ MOVE TO SAFE Y mc.mcCntlGcodeExecuteWait(inst, GCode) hreg = mc.mcRegGetHandle(inst, "DustBoot/DustBootStatus") mc.mcRegSetValue(hreg, 0) end -- ============================================================ PICKUP DUST SHOE ========================================================================== function PickupDustBoot() if (ignoreDustBoot == 1 or DustBootStatus == 1) then do return end end local toolnum, rc = mc.mcToolGetCurrent(inst) if (toolnum == 0) then do return end end mc.mcCntlGcodeExecuteWait(inst, "G00 G90 G53 Z-1.0\n") ------ Z UP GCode = string.format("G00 G90 G53 X%.4f\n", DustBootX) ------ To DustShoe Entry X mc.mcCntlGcodeExecuteWait(inst, GCode) GCode = string.format("G00 G90 G53 Y%.4f\n", DustBootY) ------ To DustShoe Entry Y mc.mcCntlGcodeExecuteWait(inst, GCode) GCode = string.format("G00 G90 G53 Z%.4f\n", DustBootZ+0.75) ------ G00 Quick down to 20mm above DustShoe Pick Up mc.mcCntlGcodeExecuteWait(inst, GCode) GCode = string.format("G01 G90 G53 Z%.4f F%.4f\n", DustBootZ,DustBootRateZ) ------ DustShoe Pick Up mc.mcCntlGcodeExecuteWait(inst, GCode) GCode = string.format("G01 G90 G53 Y%.4f F%.4f\n", DustBootY-DustBootYSlide,DustBootRateY) ------ DustShoe SlideOutY mc.mcCntlGcodeExecuteWait(inst, GCode) hreg = mc.mcRegGetHandle(inst, "DustBoot/DustBootStatus") mc.mcRegSetValue(hreg, 1) end if mc.mcInEditor() == 1 then DropDustBoot() PickupDustBoot() end return DustBoot