586,096 active members*
3,861 visitors online*
Register for free
Login

Thread: Macros

Page 1 of 2 12
Results 1 to 20 of 25
  1. #1
    Join Date
    Jun 2003
    Posts
    20

    Cool Macros

    Hi, I'd love to talk to people about Macros used in programming. I've created some of my own for use on a Haas VF-2. I have found little info in the web other than Haascnc.com and people that want to sell you something. It would be great to get something going here to share macros and come up with ideas for new macros.
    Thanks
    :cheers:

  2. #2
    Hi CNCfreak, I've done some macro programming. Mostly I've used it for changing tool diameters between loops to create tapers. I've also written one that does pocketing.

    Go to www.programmingunlimited.com
    This is a pretty good site. I would suggest you buy the book off him.

  3. #3
    Join Date
    Mar 2003
    Posts
    34
    I have made a lot of Macros. Email me tomorrow and I can send you a whole bunch of them that I have made and gotten from other people.

    Any questions in particular that I can help with. If there is anything that you do all of the time in your shop, you must make a macro for it. It can make your life much easier.

    I use a Cad/Cam package called VX, www.vx.com. They have an internal macro language that I used to automate the programming fo some of are standard molds. It use to take about 2-4 hours to program these molds but now All you do is enter a couple of variables and presto the program is ready for the CNC.

    Please fell free to contact me anytime
    MachineSMM

  4. #4
    Join Date
    Mar 2003
    Posts
    499

    WHAT!!!!!!.........

    Who said macro?
    Cool, what do you got in mind?

  5. #5
    Join Date
    Jun 2003
    Posts
    20
    Well I have two macros now one for face milling and one for side milling on a Haas mill. This mill is used in our Toolroom and we are always taking sawed stock and milling it square. When ever I write a cnc program I alway assume the stock is already milled to size and square. Becouse I never know what size of stock the toolmaker will grab. This way the toolmaker can grab any size stock they want and use the macros to quickly mill it to size and square. Then my Cad/Cam program will do the rest. I'm looking to do some macros on the Haas lathe but have found out that you cann't use macros in canned turnning cycles.

  6. #6
    Join Date
    Jun 2003
    Posts
    20
    If anyone has found a good use for macros for a lathe, I would love to hear about it.

  7. #7
    Join Date
    Mar 2003
    Posts
    115
    I emailed ya a good un. I have more.
    "The source of expertise is not in the memorization of the minute details of a subject but in the thorough understanding of the fundamental concepts on which it is based." --author unknown

  8. #8
    Join Date
    Mar 2003
    Posts
    115
    Here's a mill one to blast a circle pocket without a start hole. It has slick helical motion. My favorite lathe one is in your email. (Sorry guys... It wouldn't be right for me to post that one here as I did not write it.)
    • O9001
      (VERSION 1.1 - 2/17/03)
      (X=X CENTER)
      (Y=Y CENTER)
      (Z=FINAL DEPTH)
      (B=BORE DIAMETER)
      (C=CUTTER DIAMETER)
      (D=DIRECTION, 2 OR 3)
      (W=DEPTH PER PASS)
      (R=START PLANE OF MATERIAL)
      (F=FEED RATE)
      #30=#4001
      #31=#4003
      #32=#4109
      #33=#5043-#5083
      IF[#24EQ#0]THEN#24=#5041
      IF[#25EQ#0]THEN#25=#5042
      IF[#18EQ#0]THEN#18=#33
      IF[#9EQ#0]THEN#9=#32
      IF[#26EQ#0]OR[#2EQ#0]OR[#3EQ#0]OR[#7EQ#0]OR[#23EQ#0]THEN#3000=1(INSUFFICIENT INFORMATION SUPPLIED)
      IF[#23LE0]THEN#3000=1(ILLEGAL W SPECIFIED)
      IF[#2LE0]OR[#3LE0]THEN#3000=1(BOTH BORE AND CUTTER DIA MUST BE GREATER THAN ZERO)
      IF[#26GE#18]THEN#3000=1(DEPTH MUST BE LESS THAN START POINT)
      IF[#26GT[#18-#23]]THEN#3000=1(W VALUE TOO GREAT)
      IF[#3GE#2]THEN#3000=1(CUTTER CAN NOT BE BIGGER OR EQUAL TO BORE DIAMETER)
      IF[#7EQ2]OR[#7EQ3]GOTO5
      #3000=1(ILLEGAL DIRECTION SPECIFIED)
      N5#29=#2/2-#3/2
      G00G90X#24Y#25
      Z[#18+#23]
      #18=#18-#23
      G01G91X#29Z-#23F#9
      N10G#7X0.Y0.Z-#23I-#29J0.
      IF[#18EQ#26]GOTO15
      #18=#18-#23
      IF[#18GT#26]GOTO10
      #23=#18+#23-#26
      #18=#26
      GOTO10
      N15G#7X0.Y0.I-#29J0.
      G#7X-#29Y0.I-[#29/2]J0.
      G00G90Z#33
      G#30G#31F#32
      M99
    "The source of expertise is not in the memorization of the minute details of a subject but in the thorough understanding of the fundamental concepts on which it is based." --author unknown

  9. #9
    Join Date
    Jun 2003
    Posts
    20
    Hay, Turbine I didn't recieve your e-mail.
    and I cann't e-mail you through this board.
    Thanks.

  10. #10
    Join Date
    Mar 2003
    Posts
    115
    freak,
    The program is too long.
    I could not PM it either. There is a 3000 char. limit.
    Check your PM anyways I sent you my email.
    "The source of expertise is not in the memorization of the minute details of a subject but in the thorough understanding of the fundamental concepts on which it is based." --author unknown

  11. #11
    Join Date
    Jul 2003
    Posts
    126
    If anyone has found a good use for macros for a lathe, I would love to hear about it.
    I have developed at work a macro for turning aerospace piston rings. Basically you give info on raw material, tooling, speeds/feeds, and finshed part size. Macro then machines rings, keeping both turretts (4 axis lathe) in sync.

    I also have sub running that double check operator has not changed chuck barriers or X offsets on machine, and either automatically fixes them, or throw up an alarm.

    Program is now 4 subs, and the main totalling 6-7 pages. In the 2 + years it has been used, I bet it has machined close to a 1/2 million rings. Has saved MANY hours, and prevented several crashes.

    I can't post the program, since it belongs to work, but I can guide in developing yours.

    All mine was done on an Okuma, but other controls all operate similar.

    I find myself using small macros even when doing simple 1 off parts. For example I tend to leave my math in the programs.

    (G1 X=3.0+.05)

    Helps me when I come back later, remeber where the numbers are coming from.

  12. #12
    Join Date
    Aug 2003
    Posts
    4

    repeat macros

    Has anyone written a macro to repeat a subprogram x number of times? We do alot of repeated work at our shop. we'll load a large piece of stock into the machine and machine a profile into the stock. We then repeat the profile over in x...then the whole row down in y. we'll get like 8 parts froma single piece of stock....


    has anyone written a macro to write the repeats for this? I've tried, but i keep getting illegal macro operation errors (fanuc 0i-ma)

  13. #13
    Join Date
    Mar 2003
    Posts
    115
    nocamhere (good grief lad)
    Does it need to be macro?
    Can you take the profile/contour (whatever it is you're doing) and
    make it a sub-program, and in the sub have a G91 X.... then when calling the sub just loop it.
    M98P....L6

    Ahh......You could use a G65 line to store XY incremental positions.
    to make it quicker to change the positions.

    ....OR G10 it and use offsets.

    To answer you question ...no. I like to mess with this kinda thing too. But as of tomorrow I'm on vacation for two weeks.
    Hope you find what you need before that, but if not I'll try somthing when I get back.
    "The source of expertise is not in the memorization of the minute details of a subject but in the thorough understanding of the fundamental concepts on which it is based." --author unknown

  14. #14
    Join Date
    Mar 2003
    Posts
    499

    Hey No...

    I've tried, but i keep getting illegal macro operation errors (fanuc 0i-ma)
    Why don't you show us a copy of what your trying to accomplish
    and maybe someone can tweak it for you. Maybe like one
    of the programs you said failed.

    PEACE

  15. #15
    Join Date
    Aug 2003
    Posts
    4
    here's what i was trying


    -------------------------------------
    O8010

    (CALLED AS FOLLOWS)

    (G66 P8010 D_ C_ U_ V_ A_ B_ W_)
    (WHERE)
    (D = TOOL DIAMETER)
    (C = CLEARANCE BETWEEN REPEATS)
    (U = NUMBER OF X REPEATS)
    (V = NUMBER OF Y REPEATS)
    (A = X REPEAT DISTANCE)
    (B = Y REPEAT DISTANCE)
    (W = SUBPROGRAM TO REPEAT)

    #10=#5003 (STORE PRESENT Z-POSITION)
    #11=#4003 (STORE POSITION MODE G90/G91)
    #1=#4001 (STORE G00/G01)
    #4=#4109 (STORE FEEDRATE)
    #15=#21 (STORE NUMBER OF X REPEATS)
    #12=#5201 (STORE G54 X VALUE)
    #13=#5202 (STORE G54 Y VALUE)
    #14=#5203 (STORE G54 Z VALUE)

    WHILE(#22GT0)DO1

    WHILE(#21GT0)DO2
    M98 P#23
    #5201=#5201+#7+#3+#1
    #21=#21-1
    END1

    #5201=#12
    #5202=#5202-#7-#3-#2
    IF(#21EQ0)THEN#21=#15
    #22=#22-1
    END2

    G00 Z#10
    #5201=#12
    #5202=#13
    #5203=#14
    G#1 G#11 F#4
    M99
    ------------------------------------

    there's basically 2 while loops. The outside loop (1) handles all the y repeats. The inside loop handles all the X repeats. So it runs the subprogram you input, returns to the macro, shifts the coordinate system by the tool diameter plus some clearance...then increments the number of x repeats remaining. It then repeats the loop checking if there are any more repeats. If there are no more repeats in that row, it moves into the processing in the second loop....which shifts the machining orgin back to the start x position, moves it down in Y then ends....sending the loop back to the 2nd loop where it does the x repeats again.


    I'm not sure where the error occurs


    hope my explination wasn't too confusing.

  16. #16
    Join Date
    Mar 2003
    Posts
    765
    nocamhere,

    Without actually trying it, I would say it's because you have the END1 before the END2. Try switching these around and see if that helps.

    Regards,
    Scott

  17. #17
    Join Date
    Jun 2003
    Posts
    7
    Syntax line =

    G65 P9002 X10. Y-10. B4. C2. M10.

    This will repeat sub O0010 in X direction 4 times, pitching 10mm and 2 times in Y at -10mm pitch.


    :O9002 (G52 MACRO)
    (X = X PITCH)
    (Y = Y PITCH)
    (B = REPEATS IN X)
    (C = REPEATS IN Y)
    (M = SUB PROGRAM TO CALL)
    #1=0
    WHILE [#1LT#3]DO1
    #4=0
    WHILE [#4LT#2]DO2
    G52 X[#24*#4] Y[#25*#1]
    M98 P#13
    #4=#4+1.
    END2
    #1=#1+1.
    END1
    G52 X0 Y0
    M99

    Atom.

  18. #18
    Join Date
    Jul 2003
    Posts
    22
    Has anyone used macros in probing? I have just begun studying and I am amazed at the possiblilties. I work in a short run job shop with a lot of nickle alloys, so tool wear is a big issue. We have two machines that can check and offset tools, although utilization is very minimal. Any encouraging stories welcome.

  19. #19
    Join Date
    Apr 2003
    Posts
    348
    will macros work with fadels VMC

  20. #20
    Join Date
    Jul 2003
    Posts
    22
    Yes fadal has thier own langauge called Macro.
    your machine must be equipped though. it is an option on many machines and I'm sure there are some without the option.

Page 1 of 2 12

Similar Threads

  1. KCam and Macros
    By MHINK in forum Uncategorised CAM Discussion
    Replies: 2
    Last Post: 04-15-2011, 08:58 PM
  2. Log file question...
    By murphy625 in forum CamSoft Products
    Replies: 9
    Last Post: 04-05-2005, 10:12 PM
  3. macros
    By toyoda in forum Uncategorised CAM Discussion
    Replies: 0
    Last Post: 05-30-2004, 10:56 AM
  4. Post tricks and tips for onecnc
    By HuFlungDung in forum OneCNC
    Replies: 70
    Last Post: 11-25-2003, 07:31 PM
  5. Macros
    By MachineSMM in forum Uncategorised CAM Discussion
    Replies: 2
    Last Post: 06-20-2003, 06:41 PM

Posting Permissions

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