What's new
What's new

Changing from inches in main program to mm in subprogram

rbmgf7

Aluminum
Joined
Oct 18, 2017
I have a couple of nice Kennametal threadmill tools with replaceable inserts that the last engineer had ordered but I guess never got around to installing them. They're the style that come as a certain pitch but then I can threadmill whatever diameter I need. I contacted my Kennametal rep and he sent me the software to write the programs, however, the program outputs the units in millimeters.

I'm not a CNC programming whiz but in order to substitute our current production program's tap code to use this threadmill, I figure I use Kennametal's autogenerated program to become a subprogram whenever the time comes to tap. Since our production programs are in inches, can I G21 at the beginning of the subprogram and then G20 at the end before M99? I've never used those G codes before and am not 100% certain if that's the correct way to do this.

Thanks.
 
I've never done this, but I think that on some controls you can get into trouble as the offsets may not update with the change.

If you try it - make sure to make a first pass try above the part to see how it goes.


-------------------

Think Snow Eh!
Ox
 
I've never done this, but I think that on some controls you can get into trouble as the offsets may not update with the change.

If you try it - make sure to make a first pass try above the part to see how it goes.


-------------------

Think Snow Eh!
Ox


On our Haas NGC it wouldn't work. If I put a G21 anywhere I get an error message something to the effect of "machine not in metric mode". I guess the machine is somewhat smart enough to recognize a difference between a 3.123MM offset and 3.123INCH offset..? Or maybe it is just checking a param like H&T code agreement on/off? :dopeslap:
 
Why not just ask Kennametal for the inch version?

No CAM on the premises?

It's all there is. You can select all types of threads: standard, British, NPT, BSPT, etc. but all the depths and output is metric for some reason and there isn't a way to change it.

We have a stupid simple 2.5 CAM. We mostly poke holes and face. I can't do threadmill with my CAM software.

Some NC text editors can convert units. Post your program here. I can do it on editNC

Appreciate it. Let me see what I can do since I have a bunch of different sizes to program. Honestly, it's not that bad. I could sit down and replace the metric units to inches with Excel. That would probably be the next best bet.

Controller is Fanuc 31 BTW.

Thanks for the feedback. Just need to get the brain juices flowing for ideas.
 
It's all there is. You can select all types of threads: standard, British, NPT, BSPT, etc. but all the depths and output is metric for some reason and there isn't a way to change it.

We have a stupid simple 2.5 CAM. We mostly poke holes and face. I can't do threadmill with my CAM software.



Appreciate it. Let me see what I can do since I have a bunch of different sizes to program. Honestly, it's not that bad. I could sit down and replace the metric units to inches with Excel. That would probably be the next best bet.

Controller is Fanuc 31 BTW.

Thanks for the feedback. Just need to get the brain juices flowing for ideas.

Excel is an excellent idea for your application! No need to send your code anywhere and wait on a 'return', just build the Excel file and have it always at your fingertips. :typing:
 
Won't work easily on a Mitsu control either. They specifically note that you must switch macro variables (some system variables and any user variables used in the unit switched code), and offsets (tool and fixture) to the unit of choice before commanding a unit change G code. After the unit change G code is set then the feed command must be restated in the new units too.

Too much a PITA in my mind and a HUGE crash potential. Far better to crunch the numbers through the unit conversion tool that a good CNC editor program will have.
 
i knew a fanuc control once that when you'd switch between g20 and g21 it would convert all the tool offsets, but it would only shift the decimal on the work offset.
 
Since our production programs are in inches, can I G21 at the beginning of the subprogram and then G20 at the end before M99? I've never used those G codes before and am not 100% certain if that's the correct way to do this.
Hello rbmgf7,
What you're suggesting is 100% not possible. Either of these G codes must be specified before setting the coordinate system at the beginning of the program. Further, Fanuc actually offer a Warning in their Manuals stating that G20 and G21 must not be switched during a program.

Regards,

Bill
 
It's really hard to believe that Kennametal wrote this software and did not add the capability to do either Inch or Metric. Are you positive there is no switch somewhere to back and forth?

Paul
 
Totally lied. There is a small button on the main screen that opens the settings menu. Wasn't highlighting when I hovered over it like the other buttons.
 








 
Back
Top