548,317 active members*
1,680 visitors online*
Register for free
Login
Results 1 to 1 of 1
  1. #1
    Member
    Join Date
    Mar 2020
    Posts
    1

    Macro programming help

    Hi. We have a bunch of Doosan puma lathes with fanuc control. Im a fairly experienced cnc programmer. But macros are very unknown for me. I want an easier way for operators to adjust programs. Im looking to make a simple macro program where u can edit x and z offset. We have alot of similar products with different lenght and dimension. I want to have the option to write in the lenght and diameter at the start of the program. But i have no clue how to do this. So i wonder if anyone could give me an example on how to do this?

  2. #2
    Registered
    Join Date
    Apr 2011
    Posts
    789

    Re: Macro programming help

    Look up PROGRAMMABLE PARAMETER ENTRY (G10) in the programming manual for controller that is on your machine.

  3. #3
    Registered
    Join Date
    Feb 2011
    Posts
    353

    Re: Macro programming help

    A couple of books that could help are
    fanuc custom macro b by Sihna
    fanuc cnc custom macro's by Peter Smid



    to have the program make changes to the machining of the part by having the operators change a macro variable
    #1-#33 ARE LOCAL
    #100-#199 ARE COMMON -( POWER OFF RESETS THEM)
    #500-#999 ARE COMMON (STAY ACTIVE DURING POWER OFF)

    O1234
    G00G90G20G40G97G99


    #500=2.000(MATERIAL OD)
    #501=1.900(TURN DIA.)
    #502=-1.000(Z TURN LENGTH)


    N1(TURNING TOOL)
    G28U0.W0.
    G0G97S2000T0101M3
    M8
    G0X[#500+.1]Z.100(MATERIAL DIA.+.100)
    G1Z0.F.005
    G1X-.06
    G0Z.05
    G0X[#501-.05](TURN DIA. -.05)
    G1Z0.F.005
    G1X#500,C.03(TURN DIA WITH CHAMFER.)
    G1Z#502(Z TURN LENGTH)
    G1X#500,C.03(MATERIAL DIA. WITH CHAMFER)
    G1Z[#502-.05](MOVE FOR CHAMFER)
    G0X[#500+.1](CLEARANCE MOVE)
    G0Z-.1
    G28U0.W0.
    M9
    M01

    I would also include some safety's to avoid some crashes if the data is wrong

    IF[#500LT1.75]GOTO9000(SMALLEST OD.)
    IF[#500GT2.500]GOTO9000(LARGEST OD)
    IF[#500LT#501]GOTO9000(TURN DIA LARGER THAN MATERIAL)
    IF[#502GT0.]GOTO9000(Z LENGTH IS POSITIVE)

    N9000( DATA. OUT OF RANGE)

  4. #4
    Registered
    Join Date
    Feb 2006
    Posts
    982
    Quote Originally Posted by Ms88 View Post
    Hi. We have a bunch of Doosan puma lathes with fanuc control. Im a fairly experienced cnc programmer. But macros are very unknown for me. I want an easier way for operators to adjust programs. Im looking to make a simple macro program where u can edit x and z offset. We have alot of similar products with different lenght and dimension. I want to have the option to write in the lenght and diameter at the start of the program. But i have no clue how to do this. So i wonder if anyone could give me an example on how to do this?
    Look at RCS60 give you example, it pretty much write one program for a family part and assign movement axis with variables you want.
    The best way to learn is trial error.

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
  •