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

    M291 message non blocking execution

    Scheduled Pinned Locked Moved
    General Discussion
    3
    8
    273
    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.
    • Tinchusundefined
      Tinchus
      last edited by

      Hi. I have a macro wich objective is to ask me if I want or not to execute another macro at the end of the print.
      At the beginning of that macro I have this:

      M291 S4 K{"YES","NO"} J1 T30 P"Print has finished. Do oyu want to run cooling?"

      This M291 createsa message, where I can read YES, NO, and a CANCEL buttom. And if user doesnt answer, it should time out in 30 secconds and close the window.
      Documentation says the CANCEL buttom cancel inmediatly the excution of the curret macro. That is ok.
      But I have this at the very start of the macro, so what I wanted is to stop there at least for 30 secodns before continue with the rest of the macro. But it is not working like that. Message appears and looks like it nevers times out

      Am I doing it wrong??

      gloomyandyundefined 1 Reply Last reply Reply Quote 0
      • gloomyandyundefined
        gloomyandy @Tinchus
        last edited by

        @Tinchus From the docs it looks like what should happen is that if the timeout is reached then the message box will be cancelled (which I think will also abort your script). Is that what is happening? If not then I think you need to provide more information (like the version of RRF you are running, standalone or SBC mode etc.).

        I suspect that what you want is for your script to be able to detect the timeout and be able to continue. This is not currently possible. See a discussion of this here: https://forum.duet3d.com/topic/36445/m291-t-value-to-return-a-result?_=1727454749164 and a related feature request here: https://github.com/Duet3D/RepRapFirmware/issues/959

        benagricola created this issue in Duet3D/RepRapFirmware

        closed [FeatureRequest]: Allow `M291` to set `result` to `-1` when blocking modal "Cancel" clicked. #959

        Tinchusundefined 1 Reply Last reply Reply Quote 0
        • Tinchusundefined
          Tinchus @gloomyandy
          last edited by

          @gloomyandy The I understood incorrectly documentation. I thought that if there was a time out, the macro continuos, the macro is cancelled only if I press the CANCEL buttom. Docuemtnation says:

          Jn (RRF 3.5 and later only, optional) If message box mode >= 4: 0 = no Cancel button (default), 1 = display a Cancel button (job/macro is cancelled immediately when pressed)

          If J4 cancell the macro/job, I think ther eis no pint in cancelling the macro too with the timeout?

          Im using duet3, 3.5.3, SBC mode

          gloomyandyundefined 1 Reply Last reply Reply Quote 0
          • gloomyandyundefined
            gloomyandy @Tinchus
            last edited by

            @Tinchus The documentation says: "Tn Timeout in seconds, only used for types 0, 1, and those with a cancel button (type 3 or higher with J1 parameter; the message box is cancelled upon timeout)". If you read the first link I posted DC42 says: "Timing out is equivalent to pressing the Cancel button, if there is one". So I think what you are seeing is the currently documented behaviour. As you can see, there is a feature request already open to enhance this.

            Tinchusundefined 1 Reply Last reply Reply Quote 0
            • Tinchusundefined
              Tinchus @gloomyandy
              last edited by

              @gloomyandy Ok, I understand, it is a interpretation thing I think because it is correct that DC made a clarification that I didnt read, I interpreted "time out" of the mnessage box, not of the whole maCRO AS IF CANCEL WAS PRESSED.

              So lets see how can I achieve my objective, if you can help me on that would be great: As I posted, I run a macro, at the beginning I have that message , my objective is to be able on some situations, in order to save time, to just cancel the rest of the macro. So My message ask for a yes or no. But also, if Im not available, I want that message to time out and default behaviour should be to continue and execute the rest of the macro. Is there today a way to do that because if the time out jwill cancell everything, Im out of options

              T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
              • T3P3Tonyundefined
                T3P3Tony administrators @Tinchus
                last edited by

                @Tinchus please can you test this in stand alone mode using this build:
                https://www.dropbox.com/scl/fo/ga0jqwfksechhukg2uiz8/AOV3DR8z1C0UWczc8Rx25gE?rlkey=4saeh9luddndvxbhb0kdaqugr&dl=0

                www.duet3d.com

                Tinchusundefined 1 Reply Last reply Reply Quote 0
                • Tinchusundefined
                  Tinchus @T3P3Tony
                  last edited by

                  @T3P3Tony I dont have any printer on stand alone mode.

                  T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                  • T3P3Tonyundefined
                    T3P3Tony administrators @Tinchus
                    last edited by

                    @Tinchus ok thanks.

                    www.duet3d.com

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