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

    Does anyone use M120 or M121?

    Scheduled Pinned Locked Moved
    General Discussion
    13
    22
    1.3k
    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.
    • dc42undefined
      dc42 administrators @lee7670
      last edited by

      @lee7670 said in Does anyone use M120 or M121?:

      @dc42 said in Does anyone use M120 or M121?:

      M120

      Yes, I use it for certain operations not controlled by duet macros where I need to save system state before executing commands from remote sources.

      Can you provide examples?

      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

      1 Reply Last reply Reply Quote 0
      • MaracMBundefined
        MaracMB
        last edited by MaracMB

        @dc42 please don’t remove push and pop. It is used for python post scripts that enable toolchanger post script by mkudzia84 to work.

        https://github.com/mkudzia84/toolchanger-pspp

        MaracMBundefined dc42undefined 2 Replies Last reply Reply Quote 0
        • MaracMBundefined
          MaracMB @MaracMB
          last edited by

          That script is a nice little post for PrusaSlicer. And not only for Toolchangers but any IDEX or multihead rigs..

          1 Reply Last reply Reply Quote 0
          • oliofundefined
            oliof
            last edited by oliof

            @MaracMB I was able to use SuperSlicer (PrusaSlicer fork) with an IDEX without the need for any postprocessing ... regarding M120/121 -- I had looked into using them in homing macros to save state before and after sensorless homing, but the set of settings saved and restored simply didn't match. So I never used them.

            <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

            MaracMBundefined 1 Reply Last reply Reply Quote 0
            • MaracMBundefined
              MaracMB @oliof
              last edited by MaracMB

              @oliof and it preheated hotend before toolswap?
              It is not the ability to use, it’s the additional functionality it gives. You can use any slicer with IDEX, that’s not the point

              oliofundefined 1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators @MaracMB
                last edited by

                @MaracMB said in Does anyone use M120 or M121?:

                @dc42 please don’t remove push and pop. It is used for python post scripts that enable toolchanger post script by mkudzia84 to work.

                https://github.com/mkudzia84/toolchanger-pspp

                If you mean this usage:

                ;; TOOL_BLOCK_END:{previous_extruder}
                T{next_extruder}
                M120
                M98 P"prime.g"
                M121
                ;; TOOL_BLOCK_START:{next_extruder}
                

                then M120/M121 is redundant in that context, because of the implicit push/pop around any macro call.

                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

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

                  @dc42 ok. Great then

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

                    It turns out that DWC uses M120/M121 for good reason. So I won't remove them any time soon.

                    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

                    Sindariusundefined ctilley79undefined o_lampeundefined 3 Replies Last reply Reply Quote 0
                    • Sindariusundefined
                      Sindarius @dc42
                      last edited by

                      @dc42 I was about to say it is used in DWC and I use it in a similar fashion in my gamepad jogger plugin.

                      1 Reply Last reply Reply Quote 0
                      • oliofundefined
                        oliof @MaracMB
                        last edited by

                        @MaracMB said in Does anyone use M120 or M121?:

                        and it preheated hotend before toolswap?

                        Ah, that's nice!

                        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

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

                          @dc42 said in Does anyone use M120 or M121?:

                          ... a push and pop are done around the macro call automatically.

                          What will happen to a variable that was changed by a macro, will its old value be restored by the pop?

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

                            @dc42 Since you're keeping m120/m121, does this delay your implementation of variables significantly?

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

                              @ctilley79 said in Does anyone use M120 or M121?:

                              @dc42 Since you're keeping m120/m121, does this delay your implementation of variables significantly?

                              Only by a few hours, I hope.

                              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

                              1 Reply Last reply Reply Quote 0
                              • A Former User?
                                A Former User
                                last edited by

                                This post is deleted!
                                1 Reply Last reply Reply Quote 0
                                • o_lampeundefined
                                  o_lampe @dc42
                                  last edited by o_lampe

                                  @dc42 said in Does anyone use M120 or M121?:

                                  It turns out that DWC uses M120/M121 for good reason. So I won't remove them any time soon.

                                  With variable declaration, I believe @chrishamm and anyone else can write their own push/pop routine and store/restore any variable they like?

                                  oliofundefined 1 Reply Last reply Reply Quote 0
                                  • felekundefined
                                    felek
                                    last edited by

                                    PanelDue also use M120/M121 gcodes

                                                            case evExtrude:
                                    			case evRetract:
                                    				if (currentExtrudeAmountPress.IsValid() && currentExtrudeRatePress.IsValid())
                                    				{
                                    					SerialIo::Sendf("M120 M83 G1 E%s%s F%s M121\n",
                                    							(ev == evRetract ? "-" : ""),
                                    							currentExtrudeAmountPress.GetSParam(),
                                    							currentExtrudeRatePress.GetSParam());
                                    				}
                                    				break;
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • arhiundefined
                                      arhi
                                      last edited by

                                      did, but I can remove them all easily utilizing that "any time that a macro is called a push and pop are done around the macro call automatically" ... most of them I have on start and exit of the macro so if that's done automatically ..

                                      1 Reply Last reply Reply Quote 0
                                      • oliofundefined
                                        oliof @o_lampe
                                        last edited by oliof

                                        With variable declaration, I believe @chrishamm and anyone else can write their own push/pop routine and store/restore any variable they like?

                                        Possibly, but they should have at least one release where they can test old and new version to make sure they behave identically.

                                        Deprecation always is tricky.

                                        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

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