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

    G38.2 - error handling

    Scheduled Pinned Locked Moved
    Gcode meta commands
    2
    4
    240
    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.
    • moosiundefined
      moosi
      last edited by

      Hi there,

      I´m using G38.2 to probe toward a workpiece.
      In the case of an error the message is displayed.
      How can I react to an error? In my case I want to stop the program, and show a custom message.
      Maybe I want to retry the probing move, but in the end I need to abort the gcode.
      Is there a way with conditional gcode or so?

      thanks for your help.

      moosiundefined 1 Reply Last reply Reply Quote 0
      • Phaedruxundefined Phaedrux moved this topic from General Discussion
      • moosiundefined
        moosi @moosi
        last edited by

        Thanks @Phaedrux
        maybe this place is better 😊

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

          @moosi
          You can check the result of any standard G Code
          https://docs.duet3d.com/User_manual/Reference/Gcode_meta_commands

          result int
          0 if the last G-, M- or T-command on this input channel was successful, 1 if it returned a warning, 2 if it returned an error, or -1 if it was a blocking M291 message box command that had a Close button, and either the Close button was pressed or the message box timed out. Meta commands do not change 'result'.

          G38.2
          if result > 0
               abort "Probe failed.  Job cancelled"
          

          Would cancel the job and display a console message

          moosiundefined 1 Reply Last reply Reply Quote 0
          • moosiundefined
            moosi @OwenD
            last edited by

            @OwenD
            thanks so much.
            It is exactly what I was looking for.

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