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

    How to automatically cancel job/routine when G29 fails?

    Scheduled Pinned Locked Moved Solved
    Gcode meta commands
    2
    4
    235
    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.
    • oozeBotundefined
      oozeBot
      last edited by oozeBot

      Background: Our printers only probe where needed for the active job.

      Issue: We just had a printer fail to complete the mesh bed probing (G29 S0) portion of our startup routine. When that happened, the error was logged to the console, but the job continued on as if nothing happened..

      Question: How can we programmatically verify G29 S0 completes successfully and, if not, immediately pause the job to warn the user?

      Firmware: RepRapFirmware for Duet 3 MB6HC 3.4.4

      OwenDundefined 1 Reply Last reply Reply Quote 1
      • OwenDundefined
        OwenD @oozeBot
        last edited by

        @oozeBot
        You can check the result returned from each command
        https://docs.duet3d.com/User_manual/Reference/Gcode_meta_commands#named-constants

        In my mesh.g I use it to check the validity of the M557 values.
        I'm not 100% sure what it would return if a single point in a mesh failed

        e.g

        G30
        if result !=0
        	abort "Error during probing - print cancelled"
        
        oozeBotundefined 1 Reply Last reply Reply Quote 1
        • oozeBotundefined
          oozeBot @OwenD
          last edited by

          @OwenD perfect! I had it in my head that wouldn’t work outside of specific macros.. I’ll give this a go and report back on this thread if it for sure works for future reference.

          Thanks!

          1 Reply Last reply Reply Quote 1
          • Phaedruxundefined Phaedrux moved this topic from General Discussion
          • oozeBotundefined
            oozeBot
            last edited by

            Confirmed this works:

            G29 S0
            if result !=0
            	abort "Probing Error - canceling job"
            
            1 Reply Last reply Reply Quote 4
            • oozeBotundefined oozeBot marked this topic as a question
            • oozeBotundefined oozeBot has marked this topic as solved
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA