585,991 active members*
6,597 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Haas Machines > Haas Mills > How to search for exact match in the G-code on the Haas machine ?
Results 1 to 14 of 14
  1. #1
    Join Date
    May 2013
    Posts
    163

    How to search for exact match in the G-code on the Haas machine ?

    From time to time I need to restart the cnc in the middle of a program,... ( for example if my machine alarms out on low air pressure do to my air compressor that shuts down expectantly from time to time )

    So my process is to go the the Haas controller and write down the line of code where the machine was at before it alarmed out.

    My issue is that I have to do several searches on the control panel before it gets to the correct line.

    So here is an example of the code where the machine quite

    N5005 G0 Z0.2


    So I tried doing a search for N5005 G0 and it brought me to other lines of code that didn't have that exact line of code. ( it did have the N5005, but the rest was not a match )

    So what I end up doing is searching for just N5005 and I have to keep doing this search till it gets to the correct line.

    Any suggestions on a quicker way to find the correct line of code?

    Thanks,

    Kent

  2. #2
    Join Date
    Apr 2018
    Posts
    133

    Re: How to search for exact match in the G-code on the Haas machine ?

    You could TRY enclosing the search phrase in quotes, as in "N5005 G0".
    I don't have a Haas, and don't know if this will work, but it should be easy for you to find out.

  3. #3
    Join Date
    Jan 2005
    Posts
    15362

    Re: How to search for exact match in the G-code on the Haas machine ?

    Quote Originally Posted by kentdesautel13 View Post
    From time to time I need to restart the cnc in the middle of a program,... ( for example if my machine alarms out on low air pressure do to my air compressor that shuts down expectantly from time to time )

    So my process is to go the the Haas controller and write down the line of code where the machine was at before it alarmed out.

    My issue is that I have to do several searches on the control panel before it gets to the correct line.

    So here is an example of the code where the machine quite

    N5005 G0 Z0.2


    So I tried doing a search for N5005 G0 and it brought me to other lines of code that didn't have that exact line of code. ( it did have the N5005, but the rest was not a match )

    So what I end up doing is searching for just N5005 and I have to keep doing this search till it gets to the correct line.

    Any suggestions on a quicker way to find the correct line of code?

    Thanks,

    Kent
    If you turn on setting 36 you can restart on any line you choose to restart on, so if you have the Haas manual or look at one of their videos you will find how to do it, it's very simple once you know how, look for Haas Tip of the day videos they will have one for this

    So, this parameter you will find in settings (Program Restart) 36 you change it from Off to On, you can turn it off when done with
    Mactec54

  4. #4
    Join Date
    Mar 2016
    Posts
    325

    Re: How to search for exact match in the G-code on the Haas machine ?

    U could also try to renumber Your program not to have more the same numbers of a block.

  5. #5
    Join Date
    Jan 2005
    Posts
    15362

    Re: How to search for exact match in the G-code on the Haas machine ?

    Quote Originally Posted by steryd View Post
    U could also try to renumber Your program not to have more the same numbers of a block.
    He just needs to select the block where he wants to restart after setting Parameter 36 and the control will do the rest, it's very simple with his machine

    https://www.youtube.com/watch?v=ePlyXeXYZBE
    Mactec54

  6. #6
    Join Date
    May 2013
    Posts
    163

    Re: How to search for exact match in the G-code on the Haas machine ?

    He just needs to select the block where he wants to restart after setting Parameter 36 and the control will do the rest, it's very simple with his machine
    Yes, thats the feature I am using ( absolutely love that restart feature ) but the issue I am having is trying to search and advance to that point in the G-code where the machine stopped.

    In my example the line of code I am trying to advance to is " N5005 G0 Z0.2 "

    My post processor creates multiple lines of code that has N5005 in it, so trying to find the correct one takes multiple search's.

    If I do a search for N5005 it will bring me to the first one it finds, and then I need to do that search again to find the next one in the program... etc...etc...

    I'm guessing my post processor restarts the line numbering after each separate operation in the program ( I am using Fusion 360 for creating my g-code )

  7. #7
    Join Date
    May 2013
    Posts
    163

    Re: How to search for exact match in the G-code on the Haas machine ?

    U could also try to renumber Your program not to have more the same numbers of a block.
    Yes, I think your are spot on in your suggestion on the numbering... ( I am using Fusion 360 for creating my g-code, and I know I can turn numbering off, but I will have to do some digging to find out how to prevent duplicate numbering )

  8. #8
    Join Date
    May 2013
    Posts
    163

    Re: How to search for exact match in the G-code on the Haas machine ?

    You could TRY enclosing the search phrase in quotes, as in "N5005 G0".
    I don't have a Haas, and don't know if this will work, but it should be easy for you to find out.

    I like your suggestion, but when I went to try this I discovered that there isn't a quotation symbol on the haas keyboard.... ( I searched all of the keyboard and I see it has most of the common symbols by using the shift key, but can't seem to find the " symbol )

  9. #9
    Join Date
    Mar 2016
    Posts
    325

    Re: How to search for exact match in the G-code on the Haas machine ?

    Paste Your postprocesor file here. Probably we could help with that.

  10. #10
    Join Date
    May 2013
    Posts
    163

    Re: How to search for exact match in the G-code on the Haas machine ?

    Quote Originally Posted by steryd View Post
    Paste Your postprocesor file here. Probably we could help with that.
    Thanks for your help...

    I had to attach it, verses pasting due to forum restrictions

  11. #11
    Join Date
    Jan 2005
    Posts
    15362

    Re: How to search for exact match in the G-code on the Haas machine ?

    Quote Originally Posted by kentdesautel13 View Post
    Yes, thats the feature I am using ( absolutely love that restart feature ) but the issue I am having is trying to search and advance to that point in the G-code where the machine stopped.

    In my example the line of code I am trying to advance to is " N5005 G0 Z0.2 "

    My post processor creates multiple lines of code that has N5005 in it, so trying to find the correct one takes multiple search's.

    If I do a search for N5005 it will bring me to the first one it finds, and then I need to do that search again to find the next one in the program... etc...etc...

    I'm guessing my post processor restarts the line numbering after each separate operation in the program ( I am using Fusion 360 for creating my g-code )
    You can pick a line anywhere before that, and you won't have that problem of having lines that have the same code
    Mactec54

  12. #12
    Join Date
    May 2013
    Posts
    163

    Re: How to search for exact match in the G-code on the Haas machine ?

    Quote Originally Posted by mactec54 View Post
    You can pick a line anywhere before that, and you won't have that problem of having lines that have the same code
    I will have the same issue... this program has 240,988 lines of code in it, and I just checked and the line number "N5000" that was just above the one I'm trying to search for was repeated 35 times in this program. ( Just to clarify it repeated the line number, but not the rest of the line of code )

    So I'm thinking my solution is to figure out why my cam software is repeating the numbering...

    Here is just a small section of the code ( you will see that my cam software numbers by increasing each line number by 5 ) but the issue is that since this program has many different operations in it that it restarts the numbering for each operation... and that's whats giving me all of the duplicate line numbers.


    N4970 X5.5842 Y-1.1723 Z-0.1158 F40.
    N4975 X5.5834 Y-1.1739 Z-0.1151
    N4980 X5.5827 Y-1.1753 Z-0.114
    N4985 X5.5823 Y-1.1763 Z-0.1129
    N4990 X5.5819 Y-1.177 Z-0.1116
    N4995 X5.5817 Y-1.1775 Z-0.1101
    N5000 Y-1.1777 Z-0.1081
    N5005 G0 Z0.2
    N5010 G1 X5.6668 Y-1.2148 F500.
    N5015 Z-0.0469 F40.
    N5020 X5.6669 Y-1.2149 Z-0.0486
    N5025 X5.6675 Y-1.215 Z-0.0502
    N5030 X5.6684 Y-1.2151 Z-0.0517
    N5035 X5.6696 Y-1.2152 Z-0.0529
    N5040 X5.671 Y-1.2151 Z-0.0539
    N5045 X5.6726 Y-1.2147 Z-0.0545
    N5050 X5.6741 Y-1.214 Z-0.0547
    N5055 G3 X5.6733 Y-1.2144 Z-0.0569 I-0.0047 J0.0086
    N5060 X5.6725 Y-1.2147 Z-0.059 I-0.0039 J0.009
    N5065 X5.6717 Y-1.2149 Z-0.0611 I-0.0031 J0.0093

  13. #13
    Join Date
    Dec 2008
    Posts
    3109
    Quote Originally Posted by kentdesautel13 View Post
    I will have the same issue... this program has 240,988 lines of code in it, and I just checked and the line number "N5000" that was just above the one I'm trying to search for was repeated 35 times in this program. ( Just to clarify it repeated the line number, but not the rest of the line of code )
    If you have the sequence number increase by 1... there would only be 7 repeats
    If you refine your sequencing to be at toolchange AND at positioning moves, then the N blocks would be a very lot less...
    ....you could then refine further to have first 2 numbers for tool used, last 2 for positioning move count. Or variations on that concept.

  14. #14
    Join Date
    Mar 2016
    Posts
    325

    Re: How to search for exact match in the G-code on the Haas machine ?

    it is repeating because there is maximal value set to 99999 so U had only ~2000 numbers aiailable.
    Check if there won't be a problem with 6 digits on the block numbers.
    i've changed Your file to make 6 digits and sequential block numbers so it wouldn't restart to often.
    Attached Files Attached Files

Similar Threads

  1. X axis looses steps in the exact same line of code each time.
    By Biggyboy in forum DIY CNC Router Table Machines
    Replies: 18
    Last Post: 11-24-2020, 01:15 AM
  2. G Code Road Runner does not match motor movemment?
    By hobbyhands in forum Calibration / Measurement
    Replies: 1
    Last Post: 12-30-2012, 04:22 PM
  3. My machine is not cutting exact!
    By greasetattoo in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 6
    Last Post: 10-20-2011, 08:11 AM
  4. Beginner question (search in code window)
    By Bigbloke in forum Mach Mill
    Replies: 2
    Last Post: 09-19-2010, 11:35 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
  •