587,173 active members*
3,877 visitors online*
Register for free
Login
Results 1 to 15 of 15
  1. #1
    Join Date
    Aug 2005
    Posts
    149

    tool setting macro

    Hey guys,

    I'm not familiar with macros, but I was wondering if some one could help figure this out. This a macro program for a tool setting cycle for a yasnac mx3 control. I would like to apply it to a fanuc 11m control, also I would like to make pre-stage the next tool and make for 30 tools as oppossed to 20. It works pretty sweet on a yasnac, if I call up t1 i can jog it down set my tlo in the offset page hit cycle start picks up next t#. kind of like the next tool feature on the haas mills

    I punched it in and it worked for up until the m0, than it alarmed out saying something wrong with the IF statement. Here it is.

    G65P8600T1.B0.

    O8600
    IF[[[#20NE#0]+[#2NE#0]]NE2.0]#3000=5001(MUST SET T AND B)
    G94G80G64G40G17G0
    G91G28Z0
    G49H0D0
    WHILE[#20LT21.0]DO1
    M1
    T#20
    G91G28Z0
    M6
    M0
    IF[#5023LT0]#[12000+#20]=[5023-#2]
    #20=#20+1.0
    G91G28Z0
    END1
    M30

  2. #2
    Join Date
    Nov 2005
    Posts
    219
    Quote Originally Posted by chuy View Post
    Hey guys,

    I'm not familiar with macros, but I was wondering if some one could help figure this out. This a macro program for a tool setting cycle for a yasnac mx3 control. I would like to apply it to a fanuc 11m control, also I would like to make pre-stage the next tool and make for 30 tools as oppossed to 20. It works pretty sweet on a yasnac, if I call up t1 i can jog it down set my tlo in the offset page hit cycle start picks up next t#. kind of like the next tool feature on the haas mills

    I punched it in and it worked for up until the m0, than it alarmed out saying something wrong with the IF statement. Here it is.

    G65P8600T1.B0.

    O8600
    IF[[[#20NE#0]+[#2NE#0]]NE2.0]#3000=5001(MUST SET T AND B)
    G94G80G64G40G17G0
    G91G28Z0
    G49H0D0
    WHILE[#20LT21.0]DO1
    M1
    T#20
    G91G28Z0
    M6
    M0
    IF[#5023LT0]#[12000+#20]=[5023-#2]
    #20=#20+1.0
    G91G28Z0
    END1
    M30
    I dont think either one of those if statements will work. There must be a
    "Then" after the argument is decided.

    IF[#5023LT0]THEN#[12000+#20]EQ[5023-#2]

  3. #3
    Join Date
    Nov 2005
    Posts
    274
    The Muddracer is right, The statement is wall wrong. What exsactl;y is it you want to do again?

    Bluesman

  4. #4
    Join Date
    Mar 2003
    Posts
    2932
    AFAIK, there is no THEN in Fanuc macro language.

  5. #5
    Join Date
    Nov 2005
    Posts
    274
    Quote Originally Posted by dcoupar View Post
    AFAIK, there is no THEN in Fanuc macro language.
    So you are telling me that this program that is running right now in my 16iMB's is not working

    O8125(T12 DRILL CALIPER HOLES V1.1)
    G0G17G21G40G49G80G90G94G98M11
    G90G10L2P6X-465.0Y-760.0Z-810.0(SET G59)
    IF[#534NE18079355.]THEN#3000=53(WRONG PROJECT TOOLING)
    IF[#542NE20773482.]THEN#3000=53(WRONG PROJECT PROGRAM)
    IF[#529NE12]THEN#3000=60(WRONG TOOL IN SPINDLE)
    #30=171.73(H12 NOMIAL TOOL LENGTH)
    #31=1.0(H12 TOOL LENGTH TOLERANCE)
    IF[[ABS[#10012-#30]]GT#31]THEN#3000=12(TOOL DATA ERROR H12)
    #1=350(SFM)
    #2=.016(FEED/TOOTH/REV-INCHES)
    #3=0.56(CUTTER DIA-INCHES)
    #4=1(NUMBER OF FLUTES/TEETH)
    #5=ROUND[[#1*12]/[#3*3.1416]](CALCULATED RPM)
    #6=[[#4*#2*#5]*25.4](CALCULATED FEED MM/M)

    Come on dude if your going to help folks at least know what you are talking about

    Bluesman

  6. #6
    Join Date
    Feb 2007
    Posts
    314
    I think problem is variable #[12000+#20]. Try using #[2200+#20] I have a fanuc 0M and it works on it.

  7. #7
    Join Date
    Feb 2007
    Posts
    314
    I changed your macro to fit my Om control. I tested it and it works. Here is wath it done:

    O8600
    IF[#20EQ#0]GOTO20
    IF[#2EQ#0]GOTO20
    G0
    G91G28Z0
    G49H0D0
    WHILE[#20LT21.0]DO1
    M1
    M6 T#20
    M0
    IF[#5023LT0]GOTO10
    N5#20=#20+1.0
    GOTO15
    N10#[2200+#20]=[#5023-#2]GOTO5
    N15 G91G28Z0
    END1
    M99
    N20#3000=43(MUST SET T AND B)
    M99
    %

  8. #8
    Join Date
    Jan 2007
    Posts
    91
    dcoupar some fanucs have the "THEN" statement. My oi-mc has it.

    (edit)sorry didn't see that bluesman had already pointed this out to you. didn't mean to jump you again

  9. #9
    Join Date
    Aug 2005
    Posts
    149
    tryin to get this to work on a fanuc...it's a cycle for a yasnac...It helps picking up the TLO's it works pretty sweet on the yasnac. if you have a bunch tools to set makes it go much faster...but I also wanted to see how to make it prestage the next tool.

  10. #10
    Join Date
    Aug 2005
    Posts
    149
    I'll give it a crack

  11. #11
    Join Date
    Mar 2003
    Posts
    2932
    My apologies, Bluesman, and to anyone else whom I may have offended with my ignorance. I went through the User Macro section of the 11M manual (Chuy DID say 11M, didn't he) and didn't find any reference to THEN. I didn't bother to look in the 16iMB manual. I'll be more careful next time, Bluesman.

  12. #12
    Join Date
    Jul 2008
    Posts
    116
    ok now let's try to make this work on an oi-mc
    new poster by the way

  13. #13
    Join Date
    Aug 2005
    Posts
    149
    when I try the THEN statement I get an illegal break point of words alarm....UMM never mind my mistake...it's ps114 variable out of range

  14. #14
    Join Date
    Sep 2005
    Posts
    278
    Whats the "B" in this macro for?

  15. #15
    Join Date
    Jul 2008
    Posts
    116
    Looks to me that the B sets the last tool that you want to set........B= to macro#2 and in the program it is 20 that would proble be the last tool in carosel.
    You must remember that 99% of my posts are Bullchit!

Similar Threads

  1. macro for a tool setting
    By chuy in forum G-Code Programing
    Replies: 10
    Last Post: 07-24-2008, 12:19 AM
  2. Need help on setting up a macro
    By mgb1974 in forum G-Code Programing
    Replies: 11
    Last Post: 04-17-2008, 03:31 PM
  3. g65 macro mx3 setting
    By firecat69 in forum Uncategorised MetalWorking Machines
    Replies: 2
    Last Post: 04-30-2007, 03:16 PM
  4. Setting up a Tool Setter.
    By Smackre in forum Mach Software (ArtSoft software)
    Replies: 6
    Last Post: 06-17-2006, 04:41 AM
  5. Setting Tool Height
    By JAGYZF in forum Commercial CNC Wood Routers
    Replies: 5
    Last Post: 03-22-2005, 02:22 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
  •