Custom G-Code command
-
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
-
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.
-
@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.
-
@herrtschaefer You cannot replace gcodes that already exist.
-
@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.
-
@chrishamm I must have missed that. Thanks for the heads up. Which plugin is that by the way?
-
@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.