Skip to content

Commit

Permalink
new tool type and probing type functions
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Jun 25, 2021
1 parent f2dab76 commit 65bfee7
Showing 1 changed file with 62 additions and 2 deletions.
64 changes: 62 additions & 2 deletions Haas_Next_Generation/haas vf2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 65bfee7

Please sign in to comment.