584,833 active members*
5,585 visitors online*
Register for free
Login
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2014
    Posts
    11

    SIMPLE SUB ROUTINE EXAMPLE

    I am is need of a simple sub routine example. I have an Fanuc o-t controller on a lathe.
    I am machining a tube that will yield 4 parts from one tube.
    I have written the program out to get the 4 parts but if I want to change something, the process of looking through the lines of prg can get me lost.
    What i would like to do is move to my starting point and call the sub routine,
    after it runs through, I would like to move the z to the face of the beginning of the next part and run the sub routine again.
    The tube is 2. x 1. x 2.5 and each part will be .500 of used material per part.
    Here is what I am thinking and if someone would like to add to the prg to correct it, please do.

    %
    o0100(main prg)
    G28U0W0G99
    T0101 S2000 M03 (OD TURNING)
    G00 Z0. X2.05
    M98 P1000
    G00 Z-.5
    M98 P1000
    G00 Z-1.0
    M98 P1000
    G00 Z-1.5
    M98 P1000
    G00 Z-2.0
    G98P1000
    M30
    %



    N1000 (SUB)
    G01 F.008 X.950
    G00 Z.05 X1.990
    G01 F.008 Z-.500
    G28 U0 W0
    T0303 (ID TURNING)
    G00 Z.05 X1.050
    G01 F.008 Z-.5
    G00 X1.0
    G00 Z.1
    G28 U0 W0
    T0505 (PARTING TOOL)
    G00 X2.05 Z-.500
    G01F.005 X.950
    G00 X2.05
    G28 U0 W0
    T0101
    M99

    Thanking someone in advance,

    Greg

  2. #2
    Join Date
    Feb 2011
    Posts
    353

    Re: SIMPLE SUB ROUTINE EXAMPLE

    %
    o0100(main prg)
    G28U0W0G99
    G54
    M98P1000
    G55
    M98P1000
    G56
    M98P1000
    G57
    M98P1000
    G58
    M98P1000
    G28U0.W0.
    T0101
    M30
    %

    N1000 (SUB)
    T0101 S2000 M03 (OD TURNING)
    G01 F.008 X.950
    G00 Z.05 X1.990
    G01 F.008 Z-.500
    G28 U0 W0
    T0303 (ID TURNING)
    G00 Z.05 X1.050
    G01 F.008 Z-.5
    G00 X1.0
    G00 Z.1
    G28 U0 W0
    T0505 (PARTING TOOL)
    G00 X2.05 Z-.500
    G01F.005 X.950
    G00 X2.05
    G28 U0 W0
    M99

    I would write the main like this in order to keep the subroutine
    in absoulute insead of incramental by moving work offsets
    g55 would be .5 less than g54

    good luck
    rcs60

  3. #3
    Join Date
    Aug 2014
    Posts
    11

    Re: SIMPLE SUB ROUTINE EXAMPLE

    Thank you, I will give this a try.

Similar Threads

  1. Need help with sub-routine
    By rdoty in forum Fadal
    Replies: 10
    Last Post: 01-25-2012, 08:41 PM
  2. A better JOG routine
    By Karl_T in forum CamSoft Products
    Replies: 8
    Last Post: 04-01-2011, 01:59 AM
  3. sub routine acramatic 950
    By PETE1968 in forum G-Code Programing
    Replies: 1
    Last Post: 11-30-2009, 05:47 PM
  4. Sub Routine
    By ynnek in forum Uncategorised CAM Discussion
    Replies: 1
    Last Post: 09-18-2009, 01:01 PM
  5. 3D surface sub-routine
    By lazza in forum G-Code Programing
    Replies: 2
    Last Post: 08-30-2005, 02:58 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •