Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Get the bit index of a line in a gcode file

    Scheduled Pinned Locked Moved
    Documentation
    4
    6
    152
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gratgrat27undefined
      gratgrat27
      last edited by

      Hello everyone,

      Configuration; rep rap 3.3 on duet2 (ooznest workbee)

      After a power cut on a very long job, I'd like to restart job, but before the position stored on the resurect file, because the cuting tool was broken so no cut was made during the last (?) 5 minutes.

      the resurect file gives me :
      M26 S1484811 P0.474 X552.682 Y567.508
      The file is 10 Mo, 197000 lines...

      So i'd like to manually reduce the restart index to go back in the file, then simulate to check my roughing layer. But the bit index has to correspond to the start of a command, so is it possible to get the bit index of a line in a gcode file?

      Thank you

      dc42undefined droftartsundefined 2 Replies Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @gratgrat27
        last edited by dc42

        @gratgrat27 open the GCode file in Notepad++ and put the cursor at the start of the line you want to find the offset of. Then press control-G. In the box that pops up, click Offset, then it will show the character index of the cursor position.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • droftartsundefined
          droftarts administrators @gratgrat27
          last edited by

          @gratgrat27 Not sure how to do this in Windows, but on macOS using the BBEdit text editor, I can 'Go' to a specific byte (not bit, I think) in a file, which then shows the line number. I expect there's a way to do this in other text editors?

          Searching for "convert byte index of file to line number" comes up with a few Python/Command prompt ways of doing it, but haven't tested these. Maybe it would be useful if RRF put the line number (even in comments) in resurrect.g, @dc42 ?

          If you can get the line number, then you can use M110 to set a new line number a few moves before.

          Ian

          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

          1 Reply Last reply Reply Quote 0
          • gratgrat27undefined
            gratgrat27
            last edited by gratgrat27

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • gratgrat27undefined
              gratgrat27
              last edited by

              Ok perfect I could restart from the desired index thank you two.

              There are many things I don't get on M24 though, It is using the resurect file, but modifying the M26 line of the resurect file does not modify the resume index. I guess there are hidden actions at a deeper level!
              Is there any documentation I can read to understand it better?

              Alex

              amimafeundefined 1 Reply Last reply Reply Quote 0
              • amimafeundefined
                amimafe @gratgrat27
                last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA