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

    Custom G-Code command

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    4
    7
    918
    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.
    • AdrAsundefined
      AdrAs
      last edited by AdrAs

      I couldn't find anything using the search. Is it possible to create a custom gcode command for a g-code which doesn't exist yet?

      I'd like to create a M601 command which simply executes M226. Is that somehow possible?

      [Edit] Nevermind, I just created a M601.g file in the sys folder with the following code

      ; M601 is the command Prusa printers issue to pause print
      ; However in duet/reprap firmware that command doesn`t exist
      ; And therefore we can bind it to the actual reprap pause command which is M226
      M226
      
      1 Reply Last reply Reply Quote 1
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by

        Glad you found the answer. In case anyone searches in the future:

        Note, in RepRapFirmware 2.03 and later, if you try to execute a G- or M-command that RRF does not implement, it will execute a system macro of that name if it exists. For example, if you send G40 then it will execute /sys/G40.g if it exists; and if you send M48 then it will execute /sys/M48.g if it exists.

        Z-Bot CoreXY Build | Thingiverse Profile

        herrtschaeferundefined 1 Reply Last reply Reply Quote 1
        • herrtschaeferundefined
          herrtschaefer @Phaedrux
          last edited by

          @phaedrux Is it possible to call the original g code the macro is replacing from within the macro, or whill it recursively use the macro? I am trying to replace the M3 command with a custom one for one specific spindle,which needs special treatment but if i want to use other spindles i want to use M3 as intended.

          Phaedruxundefined 1 Reply Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator @herrtschaefer
            last edited by

            @herrtschaefer You cannot replace gcodes that already exist.

            Z-Bot CoreXY Build | Thingiverse Profile

            chrishammundefined 1 Reply Last reply Reply Quote 0
            • chrishammundefined
              chrishamm administrators @Phaedrux
              last edited by

              @phaedrux said in Custom G-Code command:

              @herrtschaefer You cannot replace gcodes that already exist.

              That's possible using a third-party plugin in SBC mode, though.

              Duet software engineer

              Phaedruxundefined 1 Reply Last reply Reply Quote 1
              • Phaedruxundefined
                Phaedrux Moderator @chrishamm
                last edited by

                @chrishamm I must have missed that. Thanks for the heads up. Which plugin is that by the way?

                Z-Bot CoreXY Build | Thingiverse Profile

                chrishammundefined 1 Reply Last reply Reply Quote 1
                • chrishammundefined
                  chrishamm administrators @Phaedrux
                  last edited by

                  @phaedrux I was referring to a custom one that you'd have to write first. I believe ExecOnMCode lets you replace any code with a custom command and DuetPi Management Plugin handles several standard codes before they are sent to RRF.

                  Duet software engineer

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