585,744 active members*
4,241 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2005
    Posts
    56

    Fanuc Subroutine

    Not familiar with subroutines and have a part to program with two different pocket sizes plus drilling cycles etc
    I attached the part file as jpg-setup twice on vise 1. Would like to duplicate on vise 2 & 3.Vises are 10.0 in apart
    Its a Fanuc OMF. The program below is for part 1 vise 1. Do you sub that or post both parts and sub that for
    the 2 other vises. I would like to go from vise 1 to 3 then 3 to 1 in maching to save time.
    Thanks---JC
    %
    O126 (PULL BRACKET)
    (MACHINE LEADWELL OMF)
    (3 VISE MACHINING 2 PARTS PER VISE)
    (G54 X0 LEFT EDGE OF BACK JAW VISE 1)
    (G54 Y0 BACK EDGE OF MATERIAL VISE 1)
    (G54 Z0 TOP OF FIXED JAW VISE 1)
    G17 G20 G40 G49 G80 G90
    N1 T3
    (TOOL_3 .500 DOWEL PIN LOCATOR TLO=H3)
    (OPERATION_LOCATE PART )
    (VISE 1)
    M6
    M5 S0
    G00 G90 G54 X3.1562 Y-0.741
    G43 Z1. H3
    M9
    G0 X3.1562 Y-0.741
    G1 Z0.2812 F35.
    M0 (LOAD PARTS OPPOSITE SIDE)
    (OF PIN TIGHTEN VISE 1)
    G0 Z1.
    M9
    G00 G28 G91 Z0 M5
    N2 T14
    (TOOL_14 #7 DRILL .201 TLO=H14)
    (OPERATION_DRILL ACCESS HOLE )
    (VISE 1)
    M6
    M3 S1800
    G00 G90 G54 X1.1816 Y-0.2626
    G43 Z1. H14
    M9
    G83 X1.1816 Y-0.2626 Z-0.2054 Q0.2 R0.625 F14.
    Y-1.2194
    X1.6384
    Y-0.2626
    X1.41 Y-0.741
    G80 Z1.
    M9
    G00 G28 G91 Z0 M5
    N3 T5
    (TOOL_5 .1875 ENDMILL TLO=H5 TDO=H55)
    (OPERATION_MILL POCKET FOR PEDAL)
    (VISE 1)
    M6
    M3 S2500
    G00 G90 G54 X1.41 Y-0.741
    G43 Z1. H5
    M8
    G00 Z0.625
    G01 Z-0.125 F25.
    X1.4067 F8.
    G41 X1.3987 H55
    G01 Y-1.0022
    X1.4212
    Y-0.4798
    X1.3987
    Y-0.741
    X1.3238
    Y-1.0773
    X1.4963
    Y-0.4047
    X1.3238
    Y-0.741
    X1.2487
    Y-1.1523
    X1.5712
    Y-0.3298
    X1.2487
    Y-0.741
    G40 X1.2567
    G01 X1.2467
    G41 X1.2387 H55
    G01 Y-1.1623
    X1.5812
    Y-0.3198
    X1.2387
    Y-0.741
    G40 X1.2467
    G00 Z1.
    M9
    G00 G28 G91 Z0 M5
    G28 Y0
    M30
    %

  2. #2
    Join Date
    Jan 2014
    Posts
    20
    %
    O126 (PULL BRACKET)
    (MACHINE LEADWELL OMF)
    (3 VISE MACHINING 2 PARTS PER VISE)
    (G54 X0 LEFT EDGE OF BACK JAW VISE 1)
    (G54 Y0 BACK EDGE OF MATERIAL VISE 1)
    (G54 Z0 TOP OF FIXED JAW VISE 1)
    G17 G20 G40 G49 G80 G90
    N1 T3
    (TOOL_3 .500 DOWEL PIN LOCATOR TLO=H3)
    (OPERATION_LOCATE PART )
    (VISE 1)
    M6
    M5 S0

    G00 G90 G54 X3.1562 Y-0.741
    M97P1

    G00 G90 G55 X3.1562 Y-0.741
    M97P1

    G00 G90 G56 X3.1562 Y-0.741
    M97P1

    M9
    G00 G28 G91 Z0 M5
    N2 T14
    (TOOL_14 #7 DRILL .201 TLO=H14)
    (OPERATION_DRILL ACCESS HOLE )
    (VISE 1)
    M6
    M3 S1800

    G00 G90 G56 X1.1816 Y-0.2626
    M97P2

    G00 G90 G55 X1.1816 Y-0.2626
    M97P2

    G00 G90 G54 X1.1816 Y-0.2626
    M97P2


    M9
    G00 G28 G91 Z0 M5
    N3 T5
    (TOOL_5 .1875 ENDMILL TLO=H5 TDO=H55)
    (OPERATION_MILL POCKET FOR PEDAL)
    (VISE 1)
    M6
    M3 S2500
    G00 G90 G54 X1.41 Y-0.741
    M97P3

    G00 G90 G55 X1.41 Y-0.741
    M97P3

    G00 G90 G56 X1.41 Y-0.741
    M97P3

    M9
    G00 G28 G91 Z0 M5
    G28 Y0
    M30


    N1
    G00 G90 X3.1562 Y-0.741
    G43 Z1. H3
    M9
    G0 X3.1562 Y-0.741
    G1 Z0.2812 F35.
    M0 (LOAD PARTS OPPOSITE SIDE)
    (OF PIN TIGHTEN VISE )
    G0 Z1.
    M99

    N2
    G00 G90 X1.1816 Y-0.2626
    G43 Z1. H14
    M9
    G83 X1.1816 Y-0.2626 Z-0.2054 Q0.2 R0.625 F14.
    Y-1.2194
    X1.6384
    Y-0.2626
    X1.41 Y-0.741
    G80 Z1.
    M99

    N3
    G00 G90 X1.41 Y-0.741
    G43 Z1. H5
    M8
    G00 Z0.625
    G01 Z-0.125 F25.
    X1.4067 F8.
    G41 X1.3987 H55
    G01 Y-1.0022
    X1.4212
    Y-0.4798
    X1.3987
    Y-0.741
    X1.3238
    Y-1.0773
    X1.4963
    Y-0.4047
    X1.3238
    Y-0.741
    X1.2487
    Y-1.1523
    X1.5712
    Y-0.3298
    X1.2487
    Y-0.741
    G40 X1.2567
    G01 X1.2467
    G41 X1.2387 H55
    G01 Y-1.1623
    X1.5812
    Y-0.3198
    X1.2387
    Y-0.741
    G40 X1.2467
    G00 Z1.
    M99
    %


    This would work on my hitachi seiki

  3. #3
    Join Date
    Jul 2005
    Posts
    56
    Beltdrive,

    Im not sure about the M97 which I understand is calling a sub program with in a main
    but will definitely try. I can see thats keeping the program short. This is and old Fanuc
    early 80's.I maybe stuck with the M98 where it has to be outside the main as a subroutine.
    Thanks
    JC

  4. #4
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by Jerseycnc View Post
    Beltdrive,

    Im not sure about the M97 which I understand is calling a sub program with in a main
    but will definitely try. I can see thats keeping the program short. This is and old Fanuc
    early 80's.I maybe stuck with the M98 where it has to be outside the main as a subroutine.
    Thanks
    JC
    Hi JC,
    M97 won't work with a Fanuc control. However, from FS16i onwards, you can set SQC bit to enable calling a subprogram with its sequence number. The parameter bit is 6005.0 This allows the Sub Programs to be included in the Main Program, after the M30, as shown following:

    Main Program
    O1000
    -------------
    -------------
    -------------
    M98 Q100
    -------------
    -------------
    -------------
    M98 Q200
    -------------
    -------------
    -------------
    M98 Q300
    -------------
    -------------
    -------------
    M30
    (SUB PROGRAMS START HERE)
    N100 --------
    -------------
    -------------
    -------------
    -------------
    M99
    N200 --------
    -------------
    -------------
    -------------
    -------------
    M99
    N300 --------
    -------------
    -------------
    -------------
    -------------
    M99
    %

    In the above program, Sub Programs commencing with the sequence numbers N100, N200, and N300 are called by the M98 call combined with a "Q" address relating to the sequence number of the required Sub Program.

    The following format can be used to start at a particular Sequence Number within an External Sub Program.

    M98 P2000 Q50 (Calls External Sub Program O2000 and starts control at Sequence Number 50)

    M98 P3000 Q20 (Calls External Sub Program O3000 and starts control at Sequence Number 20)

    Regards,

    Bill

  5. #5
    Join Date
    Jul 2005
    Posts
    56
    Bill,
    Thanks Funny how you keep fine tuning till it works. I appreciate all in puts. Sad part is not having
    a manual causes these questions. Will look into the parameter bit is 6005.0.
    Thanks
    JC

Similar Threads

  1. subroutine
    By kendo in forum Okuma
    Replies: 3
    Last Post: 01-14-2010, 01:50 PM
  2. Call Subroutine with G91
    By hartan in forum Fadal
    Replies: 2
    Last Post: 07-12-2009, 06:00 AM
  3. M97, M98 subroutine call. How to use
    By bob1112 in forum Haas Mills
    Replies: 11
    Last Post: 03-13-2008, 01:41 AM
  4. Example of a Subroutine?
    By donl517 in forum Fadal
    Replies: 14
    Last Post: 06-27-2007, 04:05 PM
  5. Need help with subroutine
    By 2_jammer in forum Uncategorised CAM Discussion
    Replies: 1
    Last Post: 01-18-2005, 05:46 AM

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
  •