diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 1af0ac8..5b4f7e4 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -661,7 +661,6 @@ function getHaasToolType(toolType) { return 5; // center drill case TOOL_MILLING_END_BALL: case TOOL_MILLING_LOLLIPOP: - case TOOL_MILLING_RADIUS: return 6; // ball nose case TOOL_PROBE: return 7; // probe @@ -671,11 +670,11 @@ function getHaasToolType(toolType) { } } - // 06/24/21 | Gavin Williams | will1742 // 002 Improved Probing // Added case for shell mills // Added improved 9023 compatibility +/* function getHaasProbingType(tool, use9023) { var probeType; switch (getHaasToolType(tool.type)) { @@ -708,6 +707,67 @@ function getHaasProbingType(tool, use9023) { } return probeType; +};*/ + +function getHaasProbingType(toolType, use9023) { + switch (getHaasToolType(toolType)) { + case 3: + case 4: + return (use9023 ? 23 : 1); // rotate + case 1: + case 2: + case 5: + case 6: + case 7: + return (use9023 ? 12 : 2); // non rotate + case 0: + return (use9023 ? 13 : 3); // rotate length and dia + default: + error(localize("Invalid HAAS tool type.")); + return -1; + } +} + +function getHaasToolTypeBIDC(toolType) { + switch (toolType) { + case TOOL_DRILL: + case TOOL_REAMER: + return 1; // drill + case TOOL_TAP_RIGHT_HAND: + case TOOL_TAP_LEFT_HAND: + return 2; // tap + case TOOL_MILLING_FACE: + case TOOL_MILLING_SLOT: + case TOOL_BORING_BAR: + return 3; // shell mill + case TOOL_MILLING_END_FLAT: + case TOOL_MILLING_END_BULLNOSE: + case TOOL_MILLING_TAPERED: + case TOOL_MILLING_DOVETAIL: + return 4; // end mill + case TOOL_DRILL_SPOT: + case TOOL_MILLING_CHAMFER: + case TOOL_DRILL_CENTER: + case TOOL_COUNTER_SINK: + case TOOL_COUNTER_BORE: + case TOOL_MILLING_THREAD: + case TOOL_MILLING_FORM: + return 5; // center drill + case TOOL_MILLING_END_BALL: + case TOOL_MILLING_LOLLIPOP: + case TOOL_MILLING_RADIUS: + return 6; // ball nose + case TOOL_PROBE: + return 7; // probe + default: + error(localize("Invalid HAAS tool type.")); + return -1; + } +} + +function getHaasProbingTypeBIDC(toolType) { + //TODO + return -1; } function writeToolCycleBlock(tool) {