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

    A fifth option for M291: Display message / wait for response

    Scheduled Pinned Locked Moved
    Firmware wishlist
    4
    5
    377
    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.
    • Topherundefined
      Topher
      last edited by

      For M291, there are currently 4 options:

      1. No buttons are displayed (non-blocking)
      2. Only "Close" is displayed (non-blocking)
      3. Only "OK" is displayed (blocking, send M292 to resume the execution)
      4. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)

      Can we get a 5th option that elaborates on #3's "OK" and "cancel" and maybe allows more than 2 buttons? Instead of "OK" and "cancel", allow us to insert our own button text followed by a Gcode or meta command for each instance which would allow the buttons to lead out of the current program into a subprogram. An example of where this would be handy is for machine setup where we have loads of machines in a farm and not all of them are identical. Individual programs stored in the macros to do specific functions would be linked together in a procedural manner by the mechanism of using buttons containing M98commands in a main program. When it comes to regular maintenance in a program called something like maintenanceROUTINE.g, the first prompt would be something like:

      MACHINE MAINTENANCE ROUTINES
      What components were changed?
      [Bed surface] [Hotend] [Feeder] [New Printer Setup]

      =>Selecting Bed surface could call G32
      =>Selecting Hotend could call my macro to calibrate the heater PID and Z positions
      =>Selecting Feeder could call my macro to guide through my measuring and tuning process of how to plug in settings for steps applied/mm
      =>Selecting New Printer Setup would behave much like "OK" currently does allowing the current program to continue, guiding the technician through the entire process, ensuring they dont miss a step.

      When each step is completed, a prompt for "Finished" to exit the program or "Do more" which would lead back to the start allowing multiple items to be addressed.

      Another use: when having the printer start by a subprogram such as printBEGIN.g, you can have M291ask if the printer bed is cleared. Currently, clicking "cancel" stops the subprogram and leads back into the main program, thus, starting the print in a manner that was not intended to run without printBEGIN.g.

      Aitorundefined 1 Reply Last reply Reply Quote 5
      • egmruddundefined
        egmrudd
        last edited by

        Yes! This would be very useful. Or at a minimum just have an option that has "yes", "no" and "cancel". "Yes" and "No" would return a boolean, that could be checked with an if statement, and cancel would kill the macro like it currently does. I'm not sure how or where to store the boolean. Having the ability to type a value into a UI prompt would extremely useful as well.

        oozeBotundefined 1 Reply Last reply Reply Quote 1
        • oozeBotundefined
          oozeBot @egmrudd
          last edited by

          @egmrudd Not exactly what you were asking but check this out for a way to returns boolean values for both OK and Cancel.

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

          egmruddundefined 1 Reply Last reply Reply Quote 1
          • egmruddundefined
            egmrudd @oozeBot
            last edited by

            @oozebot This is fantastic! Yeah its not optimal, but I'll take progress over perfection.

            Thank you for this!

            1 Reply Last reply Reply Quote 2
            • Aitorundefined
              Aitor @Topher
              last edited by

              Good morning,

              Since I have seen this post, I would like to add my idea that I have had for a long time.

              It would be to add a M291 S4 message that would give the option of "Yes" or "No" and on the other hand that you could add for example a C parameter, for example C "global.reply" and that this would make a: set global.reply = ("yes" or "no") or (true or false)

              It would also be interesting that "this parameter C" in the formats S2 and S3 with X1 Y1 Z1 would save the value of these in the variable, I do not know if in this particular case, which has been requested to show more than one axis, maybe it should be something like this C"{global.xpos,global.ypos,global.zpos}" or maybe the ideal is to request them separately.

              I think these options would open many possibilities to interact with the user.

              Let's see what you think of my idea

              Best regards

              Sorry if something is not well understood, it is very difficult for me to write in English.

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