Need Help! Bad Code


Results 1 to 9 of 9

Thread: Bad Code

  1. #1
    Registered
    Join Date
    Dec 2017
    Location
    Poland
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default 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
    %

    Similar Threads:


  2. #2
    Member
    Join Date
    May 2016
    Location
    United Kingdom
    Posts
    526
    Downloads
    0
    Uploads
    0

    Default Re: Bad Code

    Do you have Macro turned on



  3. #3
    Registered
    Join Date
    Dec 2017
    Location
    Poland
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default Re: Bad Code

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



  4. #4
    Member dcoupar's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    2932
    Downloads
    0
    Uploads
    0

    Default 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
    Registered
    Join Date
    Apr 2005
    Location
    Paradise, Ca, USA
    Posts
    713
    Downloads
    0
    Uploads
    0

    Default Re: Bad Code

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



  6. #6
    Registered
    Join Date
    Dec 2017
    Location
    Canada
    Posts
    1
    Downloads
    0
    Uploads
    0

    Default 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
    Member dcoupar's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    2932
    Downloads
    0
    Uploads
    0

    Default 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
    Registered
    Join Date
    Dec 2017
    Location
    Poland
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default 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
    Member dcoupar's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    2932
    Downloads
    0
    Uploads
    0

    Default 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.



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Bad Code

Bad Code