0% found this document useful (0 votes)
52 views10 pages

Fanuc Subprogram (Local Subroutine) - CNC Training Centre

The document explains the use of local subroutines in Fanuc programming, highlighting their convenience in managing subprograms without the risk of losing them. It details how to implement local subroutines by replacing P with Q in the subprogram call and emphasizes the importance of setting specific parameters for functionality. Additionally, it offers insights into training opportunities for CNC programming and encourages readers to reach out for further assistance or counseling.

Uploaded by

Tyrel Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views10 pages

Fanuc Subprogram (Local Subroutine) - CNC Training Centre

The document explains the use of local subroutines in Fanuc programming, highlighting their convenience in managing subprograms without the risk of losing them. It details how to implement local subroutines by replacing P with Q in the subprogram call and emphasizes the importance of setting specific parameters for functionality. Additionally, it offers insights into training opportunities for CNC programming and encourages readers to reach out for further assistance or counseling.

Uploaded by

Tyrel Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Classroom and Onsite Training (England)

! [email protected] " 07834 858 407

! " # $

Fanuc Subprogram (Local Subroutine)


Home / Fanuc Subprogram (Local Subroutine)

September Fanuc Subprogram (Local Subroutine)


24, 2021 Category : Fanuc

Fanuc Subprogram (Local Subroutine)

If you have ever used local subroutines on Heidenhain or Yasnac. Then you will know how convenient it is to save
all your programs in one go. No need to remember to save all those shitty external sub programs.

What’s He On About?
If you are now saying “what the fuck is he on about”. Here is an explanation.

A local subroutine or subprogram is where you stuff all your subprograms at the end of your main program.

So on a Fanuc control if you were making this part below.

Drill spot drill then tap.


Programme would look like this.

Thing is the code is just repeated three times. I have nice round numbers in here like X40. and Y20. so it’s easy to
notice mistakes. But if it was X40.392 for example you wouldn’t spot a slight mistake.

So if you call a subprogram it looks like this.


And then your Subprogram is like this.

Fanuc Subprogram
The M98 P500 calls the external Fanuc Subprogram. Read this if you don’t know about sub programmes.

Saves you having to repeatedly write shit loads of code.

So that’s why we use a Fanuc Subprogram. But……

You have to look after these bloody things and they seem to be able to just get lost on their own.

You find them at the back of the fridge sometimes along with a piece of mouldy old cheese.

Fanuc Subprogram No More Lost Programs


:
So this is how it looks with a Local Subroutine.

All you need to do is replace P with Q. So mind your P’s and Q’s as they say.

The Q corresponds to any N number. So you could have loads of these stacked up at the end of your programme
and you only need to save it once. All this shit will go with it and you don’t need to worry about it ever again.

Just A word Of Caution.


There are PARAMETERS involved. Arrrrrrrrrrrh……..the dreaded PARAMETERS
:
To call a subroutine on your Fanuc control. You first need to make sure that Bit 0 of parameter 06005 is set to 1

This should make it work. If it doesn’t then maybe you should call the Samaritans.

It’s only on the newer controls by the way.

Sub programs on a Siemens control.

Thanks For Reading My Articles We Love you all .


If you have been affected by any of the issues in this post or need CNC Counselling then contact me.

If you want to learn to program CNC Milling Machines

Name *

Email *
:
Company Name (If any)

Phone Number *

Comment or Message *

Sign-up to our newsletter?

I'm not a robot


reCAPTCHA
Privacy - Terms

Submit

# 4 Comments

Jeff Long
April 7, 2021 at 9:22 pm

Thank you very much for this information. I figured there had to be a way. Its just such a nice feature to have. You get
used to using it on the Haas. Would have been great to have that 30 years ago on the fanucs.

Reply

David
April 8, 2021 at 9:40 am

It’s not on all Fanuc controls but if it’s there then why not use it. Thanks for your comment.

Reply
:
Andres
April 11, 2021 at 6:24 pm

Hi,
One question, Is possible use both sub program call (M98 with P and M98 with Q)?

Reply

David
April 21, 2021 at 4:35 pm

Yes

Reply

Log out of this account

Leave a Reply

Message*

Name*

Email*

Post Comment

WEEKEND AND ONLINE COURSES

Weekend Training Courses


Online Training with Zoom

ONSITE TRAINING
:
Onsite Training Enquiry
Onsite Training

CLASSROOM COURSES

Beginners Operator (Milling)


Beginners Operator (Turning)
Setter Operator (Milling)
Setter Operator (Turning)
Learn to Program (Milling)
Learn to Program (Turning)
Macro Programming

APPLY NOW

Beginners Operator (Turning)


Beginners CNC Milling
Apply Weekend Training Courses
Setter Operator (Milling)
Setter Operator (Turning)
Learn to Program (Milling)
Learn to Program (Turning)
Macro Programming

What do you want to find? $

CALL DAVID: 07834 858 407

Name *

Email *

Company Name (If any)

Phone Number *

Comment or Message *
:
Comment or Message *

Sign-up to our newsletter?

I'm not a robot


reCAPTCHA
Privacy - Terms

Submit

Name *

Email *

Company Name (If any)

Phone Number *

Comment or Message *

Sign-up to our newsletter?

I'm not a robot


reCAPTCHA
Privacy - Terms

Submit
:
Copyright © 2015 CNC Training Centre. All Rights Reserved. Website Originally Developed By Jabberdog

WP to LinkedIn Auto Publish Powered By : XYZScripts.com


:

You might also like