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

Does anyone use M120 or M121?

Scheduled Pinned Locked Moved
General Discussion
13
22
1.2k
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.
  • undefined
    dc42 administrators
    last edited by dc42 3 Sept 2021, 17:27 9 Mar 2021, 17:08

    I am currently implementing variables in RRF conditional GCode. Unfortunately, there is an interaction between conditional GCode and M120/M121 that causes serious complications. Does anyone actually use M120 and M121? I am tempted to remove them.

    Note, any time that a macro is called (whether implicitly by RRF or explicitly using M98), a push and pop are done around the macro call automatically.

    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

    undefined 1 Reply Last reply 10 Mar 2021, 01:00 Reply Quote 0
    • undefined
      fcwilt
      last edited by 9 Mar 2021, 17:39

      Hi,

      I've seen them in the list of commands but have never had any reason to use them.

      Frederick

      Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

      1 Reply Last reply Reply Quote 0
      • undefined
        jrockland
        last edited by 9 Mar 2021, 17:42

        Same here. Never used it.

        1 Reply Last reply Reply Quote 0
        • undefined
          lee7670
          last edited by 9 Mar 2021, 17:45

          @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.

          undefined 1 Reply Last reply 9 Mar 2021, 18:02 Reply Quote 0
          • undefined
            dc42 administrators @lee7670
            last edited by 9 Mar 2021, 18:02

            @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
            • undefined
              MaracMB
              last edited by MaracMB 3 Sept 2021, 18:59 9 Mar 2021, 18:58

              @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

              undefined undefined 2 Replies Last reply 9 Mar 2021, 19:00 Reply Quote 0
              • undefined
                MaracMB @MaracMB
                last edited by 9 Mar 2021, 19:00

                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
                • undefined
                  oliof
                  last edited by oliof 3 Sept 2021, 19:14 9 Mar 2021, 19:12

                  @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<>

                  undefined 1 Reply Last reply 9 Mar 2021, 19:30 Reply Quote 0
                  • undefined
                    MaracMB @oliof
                    last edited by MaracMB 3 Sept 2021, 19:32 9 Mar 2021, 19:30

                    @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

                    undefined 1 Reply Last reply 9 Mar 2021, 22:23 Reply Quote 0
                    • undefined
                      dc42 administrators @MaracMB
                      last edited by 9 Mar 2021, 19:32

                      @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

                      undefined 1 Reply Last reply 9 Mar 2021, 19:33 Reply Quote 0
                      • undefined
                        MaracMB @dc42
                        last edited by 9 Mar 2021, 19:33

                        @dc42 ok. Great then

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          dc42 administrators
                          last edited by 9 Mar 2021, 20:12

                          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

                          undefined undefined undefined 3 Replies Last reply 9 Mar 2021, 21:11 Reply Quote 0
                          • undefined
                            Sindarius @dc42
                            last edited by 9 Mar 2021, 21:11

                            @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
                            • undefined
                              oliof @MaracMB
                              last edited by 9 Mar 2021, 22:23

                              @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
                              • undefined
                                zapta @dc42
                                last edited by 10 Mar 2021, 01:00

                                @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
                                • undefined
                                  ctilley79 @dc42
                                  last edited by 10 Mar 2021, 03:13

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

                                  undefined 1 Reply Last reply 10 Mar 2021, 06:09 Reply Quote 0
                                  • undefined
                                    dc42 administrators @ctilley79
                                    last edited by 10 Mar 2021, 06:09

                                    @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
                                      last edited by 10 Mar 2021, 12:24

                                      This post is deleted!
                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        o_lampe @dc42
                                        last edited by o_lampe 3 Oct 2021, 12:37 10 Mar 2021, 12:37

                                        @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?

                                        undefined 1 Reply Last reply 11 Mar 2021, 10:57 Reply Quote 0
                                        • felekundefined
                                          felek
                                          last edited by 10 Mar 2021, 13:49

                                          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
                                          1 out of 22
                                          • First post
                                            1/22
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA