Multiple choice conditionnal gcode



  • Hi, I wanted to know if it could be possible and Interesting to add a possibility to add a way to ask some choice with custom text (or not) as I.e. when changing filament with a macro to do an all-in-one unloading/loading, ask what type of filament you are charging, or maybe, do a preheat gcode that ask for what type of filament or things like that ^^
    I hope I'm understandable πŸ˜‚ my English is not always as good as I thought 😁



  • There is M291 that allow you to display custom message and wait for response

    Not really a "multiple choice" it's more

    • no buttons
    • Close button
    • OK button
    • OK and Cancel buttons

    so "multiple choice" would be Ok and Cancel πŸ™‚


  • administrators

    There is already a request to extend M291 to allow Yes, No and Cancel buttons, which is under consideration for inclusion in RRGF 3.02. This suggestion appears to be a useful generalisation of that.



  • @dc42 said in Multiple choice conditionnal gcode:

    There is already a request to extend M291 to allow Yes, No and Cancel buttons, which is under consideration for inclusion in RRGF 3.02. This suggestion appears to be a useful generalisation of that.

    Yes would be cool to have number of custom txt buttons instead of only few, but what would be also super useful IMO would be the "result" variable after M291. ATTM the S3 will stop execution of a macro and on "ok" macro will continue or macro will abort on "cancel". Would be useful to have return variable set so we can if return...



  • I know about the m291 ^^ this was for the purpose of executing a specific gcode accordingly to the choice you made or maybe for what I want, something like a gcode command that display the different filament you've configure to let you choose the one you want as for my examples for filament changing or preheat ^^



  • What you’re asking for is probably not possible within the confines of the duet firmware and would take considerable effort to code even if it was.
    The dialogs would have to work on panel due, DWC and RPi
    Falls under the law of diminishing returns I think.
    If your usage case is just preheat and load/unload these are easily taken care of by clicking on the appropriate macro.
    However you could easily present your dialog boxes on an RPi using most any language and have that app run the appropriate macro or post process the file before launching it.

    What I suggested for M291 was to enable you to skip over choices when iterating through arrays.
    This is far less work to implement and in fact would work in your case, however you would have to say NO to each choice till you got to the filament you wanted to load.



  • Yes i think it'll be easy to get around, i just search ease x) but with your suggestion, i think it'll will be easy to do a bit of meta to ask which type of filament you are loading one by one πŸ™‚


Log in to reply