A fifth option for M291: Display message / wait for response
-
For M291, there are currently 4 options:
- No buttons are displayed (non-blocking)
- Only "Close" is displayed (non-blocking)
- Only "OK" is displayed (blocking, send M292 to resume the execution)
- "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
M98
commands in a main program. When it comes to regular maintenance in a program called something likemaintenanceROUTINE.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 callG32
=>SelectingHotend
could call my macro to calibrate the heater PID and Z positions
=>SelectingFeeder
could call my macro to guide through my measuring and tuning process of how to plug in settings for steps applied/mm
=>SelectingNew 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 haveM291
ask 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 withoutprintBEGIN.g
. -
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.
-
@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
-
@oozebot This is fantastic! Yeah its not optimal, but I'll take progress over perfection.
Thank you for this!
-
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.