586,009 active members*
4,878 visitors online*
Register for free
Login

Thread: Bad Code

Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2017
    Posts
    4

    Bad Code

    Hi, why when I enter for example "#100=1" I get the wrong code in my lathe?


    my code:
    %
    o00000
    T0101
    G54 G90
    G50 S1500
    G96 S200 M03 F0.1
    #100=1
    #101=10
    G00X100.Z2.
    WHILE[#100LE#101] DO1
    G01 Z-50.
    G91 X1.
    G90 G00 Z2.
    G91 X-2.
    #100=#100+1
    END1
    M30
    %

  2. #2
    Join Date
    May 2016
    Posts
    526

    Re: Bad Code

    Do you have Macro turned on

  3. #3
    Join Date
    Dec 2017
    Posts
    4

    Re: Bad Code

    I don't know. How can I check this?

  4. #4
    Join Date
    Mar 2003
    Posts
    2932

    Re: Bad Code

    I believe it's parameter 57 (COMMON SWITCH 1) bit #22 ENABLE MACRO. should be 1 if the option is turned on.

  5. #5
    Join Date
    Apr 2005
    Posts
    713

    Re: Bad Code

    Not sure if it's an issue, but I always use decimals in my macros. So "#100=1."

  6. #6
    Join Date
    Dec 2017
    Posts
    1

    Re: Bad Code

    Not sure exactly what you mean by “wrong code” but I would say that you need a G90 on the the G01 Z-50. Line
    If you follow the loop through, the last command is G91 X-2 so when you loop back to G01 Z-50 this will be an incremental move and would only actually move to Z-48 as you are at Z2 when you execute that line.
    Hope that helps.

  7. #7
    Join Date
    Mar 2003
    Posts
    2932

    Re: Bad Code

    My bad. I assumed you got an alarm when you tried to load that code into the machine. If this is the case, what is the exact alarm?

    One other thing, on the Haas lathe, G90 is NOT "Absolute", it's a turning cycle command. And G91 is NOT "Incremental"... use X and Z for absolute commands, and use U and W for incremental commands.

  8. #8
    Join Date
    Dec 2017
    Posts
    4

    Re: Bad Code

    I read my instruction today and there is nothing about parameter 57:22 I found: https://diy.haascnc.com/printpdf/reference-docs/macro-programming-information How to set this parameter to 1? I'm a beginner.

    PS.
    I removed G90 and G91 of course.

  9. #9
    Join Date
    Mar 2003
    Posts
    2932

    Re: Bad Code

    I'm not 100% sure on this, but I believe you can turn the option on for a trial (100 hours?), but it'll revert to off after the trial expires.

    You need to turn Setting 7 Parameter Lock OFF, then go to Parameter 57 bit 22 and change it to 1, then change Setting 7 back to 1 to lock the parameters again.

    It's been a while since I've pretended to be a Haas expert, though, so you might want to contact your HFO to be sure.

Similar Threads

  1. Replies: 51
    Last Post: 09-16-2020, 01:28 AM
  2. Program to Convert Mill g code To Laser g code - CMTL
    By doanwannapickle in forum Visual Mill
    Replies: 0
    Last Post: 02-20-2017, 06:08 PM
  3. mach3 crashing with run of code/drilling holes through table with other code
    By normalform in forum Mach Software (ArtSoft software)
    Replies: 1
    Last Post: 07-28-2014, 03:38 AM
  4. corel.hpgl > sheetcam.tap > pronterface.g-code > slic3r.g.code> ramps 1.4 > H-BOT
    By thesignworks in forum Uncategorised CAM Discussion
    Replies: 0
    Last Post: 05-25-2014, 02:11 PM
  5. Replies: 8
    Last Post: 12-15-2010, 09:32 PM

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
  •