586,116 active members*
3,510 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2014
    Posts
    7

    Sub Programing Help

    I need some help with writing a sub routine program. I have multiple parts set up in different work coordinates that all have a common feature ( threaded hole ) that I need to program. I need to drill, chamfer, and threadmill these holes and would like to write a program and separate the operations into there own program. My machine doesn't have much memory and the threadmill program gets big. I think I can figure out the drilling and chamfering part of this but the threadmilling part is whats throwing me. Some parts have a hole on zero of the part and others have multiple holes along them. Eventually I would like to be able to go in and just edit the main program for my different locations right at the control. I am using a fanuc O-M control. Sorry if this is confusing but I am not sure how else to explain it.

  2. #2
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by falcon64 View Post
    I need some help with writing a sub routine program. I have multiple parts set up in different work coordinates that all have a common feature ( threaded hole ) that I need to program. I need to drill, chamfer, and threadmill these holes and would like to write a program and separate the operations into there own program. My machine doesn't have much memory and the threadmill program gets big. I think I can figure out the drilling and chamfering part of this but the threadmilling part is whats throwing me. Some parts have a hole on zero of the part and others have multiple holes along them. Eventually I would like to be able to go in and just edit the main program for my different locations right at the control. I am using a fanuc O-M control. Sorry if this is confusing but I am not sure how else to explain it.
    Hi Falcon,
    One method when you have common features but at different coordinates of the workpiece, is to write the code for the feature in incremental Mode. In doing so, you can drive the tool to the Absolute coordinate of the Incremental Start point of the feature, and then call the Sub that is written in Incremental Mode. For example, the Thread Mill program could be registered as an Incremental Mode Sub program, and called after positioning the tool at the Start Point for each Thread Mill feature.

    Regards,

    Bill

  3. #3
    Join Date
    Feb 2014
    Posts
    7
    Thanks Bill! That's what I was wondering but I am nervous about programing in incremental mode especially threadmilling. Those treadmills are not cheap!

  4. #4
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by falcon64 View Post
    Thanks Bill! That's what I was wondering but I am nervous about programing in incremental mode especially threadmilling. Those treadmills are not cheap!
    Obviously, you have to prove a program, either at the machine of via verification software. Whether the program for the feature is in Absolute or Incremental should not matter. If you were to start the Incremental code for the Thread Mill at the centre of each hole, then you can move to the centre of each hole using Absolute within the specified Work Shift, then call the Sub for the Thread feature.

    If you're hell bent on using Absolute, within all Workpiece coordinate systems (G54 - G59) you can use a Local Coordinate System G52. So that you can use the one Thread Mill Subprogram for all holes, the G52 would be used to define each hole location as X0, Y0, and the Subprogram for the Thread Mill would be written as if Thread Milling at the hole centre X0, Y0. In this case, if the Thread Mill Subprogram is written in Absolute, the X, Y component will be exactly the same as the Incremental version.

    As you've stated in your first post that the Thread Mill Program gets big, I assume that your control doesn't have Helical Interpolation. That being so, you could make your Thread Milling program a lot shorter by using Incremental Programming to cut one Thread Lead and then repeat the Subprogram the number of Leads required.

    Regards,

    Bill

  5. #5
    Join Date
    Feb 2014
    Posts
    7
    This gives me a direction to go now. I will give it a try this weekend and let you know how it goes. Thanks again!

Similar Threads

  1. Online cnc programing/ offline cnc programing
    By grimantas in forum Polls
    Replies: 0
    Last Post: 11-28-2012, 02:03 PM
  2. help cnc programing
    By dek in forum RFQ Feedback
    Replies: 4
    Last Post: 11-21-2009, 07:28 PM
  3. 0-M programing help please
    By venomgrrrl in forum Fanuc
    Replies: 22
    Last Post: 12-08-2007, 06:51 AM
  4. CAM programing
    By kenlambert in forum G-Code Programing
    Replies: 1
    Last Post: 02-03-2006, 07:03 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
  •