Navigation

    Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    M291

    Tuning and tweaking
    3
    7
    86
    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.
    • jens55
      jens55 last edited by

      I am having a bit of an issue understanding M291.
      This is what I have in my cancel.g file:

      M291 P"Are you sure you want to cancel the print ?" S3

      ; need to turn off both hot end and bed if the print is cancelled
      M104 S0 ; kill extruder heat
      M140 S0 ; kill bed heat

      When I cancel a print, this does exactly what I would expect (although it takes unreasonably long between hitting 'cancel' and the confirmation window to pop up (1-2 seconds). My problem arises when I hit 'cancel' for the text box (ie cancelling the cancel request). ... nothing happens. Temperatures stay up, printer does not resume print. I would like the printer to resume operation rather than sitting there waiting for me to push 'resume',
      Based on the doc's, an M292 is sent by the message box with either a p0 or a p1 parameter but I don't understand how to interact with this in my cancel.g routine. Based on what happens, the code in cancel.g is executed if I say 'ok' to the message box but how do I interact when the user says 'cancel' to the message box?

      1 Reply Last reply Reply Quote 0
      • jens55
        jens55 last edited by

        I would like to correct myself - the unreasonably long wait time is because the printhead is being parked and that takes a while as it was set up for a very slow nozzle wipe operation. I think it can't throw up the message box until the parking operation is completed.

        dc42 1 Reply Last reply Reply Quote 0
        • dc42
          dc42 administrators @jens55 last edited by

          @jens55 once you press Cancel, you cannot resume the print, because DWC or PanelDue has already sent the M0 command. The canel.g file is provided so that you can control whether or not you turn off heaters, unload the tool, park the print head etc.

          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

          jens55 2 Replies Last reply Reply Quote 0
          • jens55
            jens55 @dc42 last edited by

            @dc42 thanks for that explanation.
            IMHO this REALLY limits the functionality of M291. The user is given a choice to cancel the current operation but not really. It is very counter-intuitive. Given that the user is presented with a choice, M291 should result in an then/else branch.
            Might this be something you would entertain for the 'wish list' ?

            Is there any other way that you can think of to implement a confirmation to the 'cancel print' button ?

            1 Reply Last reply Reply Quote 0
            • jens55
              jens55 @dc42 last edited by

              @dc42 thinking this over outside the context of the cancel print button, I can see all kinds of issues with presenting a choice but not really giving a choice. It is quite possible that I am unaware of the proper way to do things but let me run an example by you.
              Suppose I am doing some light milling and before I start the operation I present the user with a choice of "Do you want to calibrate z zero?"
              If the user selects 'ok' then everything works as planned and program execution carries on after the M291 line but let's say the user decided that z zero was already verified and chooses to hit the 'cancel' button in the M291 command ..... how would I skip the calibration routine but carry on in the same macro?

              oozeBot 1 Reply Last reply Reply Quote 0
              • oozeBot
                oozeBot @jens55 last edited by

                @jens55 see if this might help you?

                https://forum.duet3d.com/topic/23423/m291-solution-to-handling-both-ok-cancel

                jens55 1 Reply Last reply Reply Quote 1
                • jens55
                  jens55 @oozeBot last edited by

                  @oozebot, THANK YOU ! I will give it a test run later today.

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