588,270 active members*
11,282 visitors online*
Register for free
Login

Thread: macro's

Results 1 to 13 of 13
  1. #1
    Join Date
    Mar 2006
    Posts
    41

    macro's

    The company I work for bought a brand new Haas VF4.So we get 200hour of Macro's to try out.But I've never used them can someone show me where I can find a use for this feature.I've heard its some cool sh$$ but I can't see how its any better than regular G coding.Can someone shed some light on this for me. Thanks Tracey

  2. #2
    Join Date
    Jan 2005
    Posts
    1880
    The biggest advantage of macros is that you can make whole programs that can take care of a class of parts. Within each class of parts, if the only change is size, then you can make all the changes thru variables.

    Macros are very useful but mainly it depends on your programming style. If you have high-end cad and/or do 1 off parts you might not see the advantage.

    But if you hand code allot or like to make little programs that fit a variety of needs then macros are indispensable.
    thanks
    Michael T.
    "If you don't stand for something, chances are, you'll fall for anything!"

  3. #3
    Join Date
    Mar 2005
    Posts
    1498
    060402-2101 EST USA

    Traceycnc300:

    miljnor has given you some good perspective.

    I will add the following:

    You can do logic, math, and trig functions. You can easily pass parameters to subroutines. DPRNT is available which allows you to output data to the COM 1 serial port. You can create counters for special functions. You can easily do step and repeat functions, even with varying increments. You can write a program that will step and repeat for a variable number of steps, and do it efficiently without a lot of tool changes. You can access timers and operate on the values.

    I have a standard tool change subroutine that can greatly reduce errors of hand coding. Also standard subroutines for collecting timing information from within a machine cycle.

    The DPRNT function along with external equipment can provide a means to do special functions.

    Scaling and rotation is another very useful option, but on our machines lacks independent scaling of each axis.

    .

  4. #4
    Join Date
    Jul 2005
    Posts
    12177
    If you have not turned the 200 hour Macro trial on I suggest don't do it yet. You cannot turn it off and it will be a waste if you burn up all 200 hours on the early part of a learning curve. Find out what macros can do, get some samples and then when you are set turn on the trial.

  5. #5
    Join Date
    Mar 2006
    Posts
    41
    Thanks guys.I am going to wait till I get better understanding before I activate the function.But I am interested so any examples would be apreciated.Then if I can show the boss man where it is usefull I'll try to get him to buy the option.I've read a little about it in the Haas manual but find it to be pretty vage.I've been programing by hand for several year and we also have acouple other good programmers but none of us have used macro's.So were very interested.

  6. #6
    Join Date
    Mar 2005
    Posts
    1498
    060403-0631 EST USA

    Traceycnc300:

    Following is a thread I started on a Tool Change Macro:

    http://www.cnczone.com/forums/showth...l+change+macro



    And at some time you might want to study this thread:

    http://www.cnczone.com/forums/showth...ighlight=dprnt

    .

  7. #7
    Join Date
    Jul 2005
    Posts
    181
    Quote Originally Posted by Geof
    If you have not turned the 200 hour Macro trial on I suggest don't do it yet. You cannot turn it off and it will be a waste if you burn up all 200 hours on the early part of a learning curve. Find out what macros can do, get some samples and then when you are set turn on the trial.
    You can turn off a trial that's been activated. Something you must not forget after turning a trial off is to cycle the power (power off, then power on). I've used the trial for rigid tapping and I turned it off after using it so this way, I'm not trowing away the rest of the 200hrs.

    But I agree with you. If you don't really need it, don't activate it. This way, you'll be sure to not forget to turn it off.

  8. #8
    Join Date
    Aug 2005
    Posts
    413
    One of the easiest things you can do with macros is run several parts on the table. Simply program each part as you normally would with a different fixture offset for each. Then change the M30 at the end of each program to M99 and right one more small little program. Lets say you have three parts on table with programs O100 through O102 then make a program like this

    O105
    G65 P100
    G65 P101
    G65 P102
    M30

    The if you get more in depth on macros, say you wan to run two of part O101 on the table and only one each of the others. Then you simply need to make the fixture offset in the program for O101 a variable (say #100 use an empty one)and then your program would look something like this

    O105
    G65 P100
    G65 P101 #100=56
    G65 P101 #100=57
    G65 P102
    M30

    Don't quote me exactly but that is close. In school I went above what the teacher new and wrote a parametric (read macro) progam for a part that we ran on an old BP and for a test another student did the same part by cam. I believe the cam program was around 8 pages of code or so and the program I made was a page and a half and was still easily adjustable for different size parts or diferent number of bolt holes.

    JP

  9. #9
    Join Date
    Aug 2005
    Posts
    413
    Another way to look at things is that all canned cycles like drill cycles are esentially macros with variable arguments. They just happen to be built in.

    JP

  10. #10
    Join Date
    Mar 2006
    Posts
    41
    Thanks gent's thats the kind of info I was looking for.It's also nice to know it can be turned off to conserve.

  11. #11
    Join Date
    Jan 2005
    Posts
    1880
    it Cant be turned off once turned on!!!!!

    edit:
    of course I didnt' see the other post on cycling the power so... of course ignore my ignorant remark!!!
    thanks
    Michael T.
    "If you don't stand for something, chances are, you'll fall for anything!"

  12. #12
    Join Date
    Mar 2006
    Posts
    61
    I use macros for milling angles on blocks at any rotation or location all i have to do is specify the position in (xy), rotation, depth, angle, length, peck, finishing peck, the macro does the rest.I have a few others for helical milling bosses, corner radii on blocks, pockets and rectangular profiles, All of them have protection against the user entering wrong data. Macros are really good when you do a lot of the same sort of operations and it saves using cad/cam to generate simple toolpaths.

  13. #13
    Join Date
    Apr 2006
    Posts
    133
    Here is of example of a macro we use.
    Since all Z axis lengths are the same we can run anywhere from a 1 x .5
    core to 10 x 8.5 core with the same program.
    We are running this on our Haas TL-3 Lathe.

    I realize you have a mill and this is for a lathe but it should give you some idea of how macros work



    %
    O1427 (DIE SHOP SHORT CORE)
    N30 (CREATED 09-16-2005 09:18:05)
    N40 (RETURNED 12-15-2005 10:17:18)
    N50 #554= 54 (SELECT COORDINATE SYSTEM)
    N60 #501= 3.583 (DIE SIZE)
    N70 #502= 2.511 (CORE SIZE)
    N80 #503= 0.5 (TUG AREA)
    N90 #504= 4.5 (DIE HEAD DIAMETER)
    N100 #513= 1.1 (FLAT DISTANCE ON DIE HEAD)
    N110 #514= 11.125 (GRAPHITE BLANK LENGTH)
    N120 #515= 5.0 (GRAPHITE BLANK DIAMETER)
    N130 #510= 0.5 (DEPTH OF ROUGHING CUTS)
    N140 #511= 0.18 (DEPTH OF FACING CUTS)
    (END OF INPUTS)
    N160 #505= [ #502 - 0.04 ]
    N170 #506= [ 6.25 + #503 ]
    N180 #513= [ #513 * 2 ]
    N190 G50 S750 M42
    N200 G#554 G90 M24
    N210 (FACE & RGH CORE HEAD)
    N220 G53 G00 Z-30.
    N230 G53 G00 X-3.
    N240 T101
    N250 G97 S540 M03
    N260 G00 X [ #515 + 0.5 ] Z [ #514 + 0.5 ]
    N270 G01 X [ #515 + 0.1 ] Z#514 F0.1
    N280 X-0.05 F0.015
    N290 Z [ #514 + 0.1 ] F0.1
    N300 G00 X [ #515 + 0.1 ]
    N310 G01 Z [ #514 - 0.125 ] F0.1
    N320 X [ #504 - #513 ] F0.015
    N330 X0. Z#514
    N340 X-0.05
    N350 Z [ #514 + 0.2 ] F0.1
    N360 (BEGIN OD TURN HERE)
    N370 G00 X#515 Z [ #514 + 0.1 ]
    N380 G71 P390 Q400 D#510 F0.012
    N390 G01 X#504 Z#514
    N400 Z [ #514 - 2.0 ]
    N410 G00 Z#514
    N420 X [ #504 - 0.3 ]
    N430 G01 Z [ #514 - 0.125 ] F0.012
    N440 X#504 F0.005 ,R0.125
    N450 Z [ #514 - 2.0 ] F0.012
    N460 G53 G00 Z-30.
    N470 G53 G00 X-3.
    N480 M00 (STOP TO CHUCK HEAD END)
    N490 (FACE & ROUGH TURN RESTART POINT)
    N500 G53 G00 Z-30.
    N510 G53 G00 X-3.
    N520 T101
    N530 G97 S540 M03
    N540 G00 X [ #515 + 0.5 ] Z [ #514 + 0.5 ]
    N550 G01 X#515 Z [ #514 + 0.1 ] F0.05
    N560 G72 P570 Q580 F0.015 D#511
    N570 G01 X#515 Z9.75
    N580 X-0.05
    N590 Z10. F0.06
    N600 G00 X#515 Z9.85
    N610 G71 P620 Q670 D#510 F0.015
    N620 G01 X [ #505 + 0.04 ] Z9.75
    N630 X [ #502 + 0.04 ] Z#506
    N640 Z6.25
    N650 X [ #502 + 0.193 ] Z3.
    N660 X [ #501 + 0.04 ]
    N670 Z1.5
    N680 G53 G00 Z-30.
    N690 G53 G00 X-3.
    N700 M00
    N710 (FINISH TURN RESTART POINT)
    N720 G53 G00 Z-30.
    N730 G53 G00 X-3.
    N740 T101
    N750 G97 S750 M03
    N760 G00 X [ #504 + 0.5 ] Z [ #514 + 0.5 ]
    N770 G01 X [ #502 - 0.2 ] Z9.85 F0.05
    N780 Z9.75 F0.015
    N790 X#505 F0.004 ,R0.125
    N800 X#502 Z#506 F0.005
    N810 Z6.25 F0.005
    N820 X [ #502 + 0.113 ] Z3. F0.005 ,R0.04
    N830 X [ #501 - 0.01 ] F0.008
    N840 Z2.9
    N850 X#501
    N860 Z1.5
    N870 X [ #504 + 0.2 ]
    N880 G53 G00 Z-30.
    N890 G53 G00 X-3.
    N900 M30
    %

Posting Permissions

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