CNC Sub Program
Category : Fanuc Mill Fanuc Turn Haas Mill Haas Turn
Call 07834 858 407
CNC Sub Program, all CNC machines will have some form of sub programs.
This article deals with G code (ISO) type programming but most of the features talked about will be available in some form on any CNC control.
A CNC sub program is a branch from your main program into another program.
After completing this, your control will return to the main program and continue where it left off.
It’s like the branches of a tree.
Probably the most common use of a CNC Sub Program would be for a tool change position. You could have a sub program which took the machine to a position for tool change. Your machine probably does this anyway but it’s hidden.
The advantage of this is that you could use it for any program and you don’t have to keep writing it. It is going to be very reliable because you know you never touched it. (Honest governor).
You could use a sub-program for a set of hole positions, call it out once to spot drill and again to drill and again to tap. Just use it as many times as you want.Got to be good for the environment too.
Some controls have internal sub programs Haas and Yasnac as well as Heidenhain and Siemens have this facility.
You can do it on a certain Fanuc controls but it is an option.
It means you can stuff these at the end of your program and jump into them the same way as you would an external one.
Why would I want to do that you say?
Easier to manage is the quick answer.
You know when you save your main program there are no pesky sub programs lurking that you forgot to save. They are all built into your main program.
Normally you would call your sub-program once only and you don’t need to tell it “oh I want this once” it says “come on mate I know that I’m not stupid.
But you can call it several times and if you get into incremental programming, and I hope you do, you will definitely find a need for this.
Sometimes with sub-programs it’s what you don’t put in that matters. What I mean is if your milling and you put the feed in the sub-program you are stuck with it. If it’s not there then you can state the feed externally and use a different one every time.
On Machines Like The BMC 800 from Toshiba
This machine has the Tosnuc 888 control.
It uses G72 followed by the dollar sign, oh and for the repeat command it uses L but don’t forget the comma.
G72 $MYPROGRAM , L2
Yes Tosnuc uses anything for a program name up to eight characters. So that it doesn’t get confused by the L you have to put in a comma.
By the way on this control (Tosnuc 888) you don’t use M99 at the end of your sub program you just use M30 and it works correctly.
Don’t try this on your Fanuc or Haas control as M30 means stop and rewind and that’s what it will do. Then it will just sit laughing at you.
Ok now you can watch the video.
CNC Milling sub programming examples.
If you liked this video, please don’t forget to subscribe to my YouTube channel by going to: CNC Training Centre
Please contact me if you require:
- Fanuc training.
- CNC programming training.
- Want to learn CNC programming.
- Fanuc programming training.
- Yasnac programming training.
- Any type of CNC course.
Services offered at CNC Training Centre
Classroom programmer training.
CNC Training on all controls and machines.
Mazak Training Fanuc Training
Don’t forget we offer training on all types of Mazak Machines and all Fanuc Controls 6m to 31i Oi old to young.
Leave a Reply