Hey @deckingman,
I don't get why you can't just use a macro [...]
Some examples:
My printers have CPAP blowers+ Motor-valves instead of fans.
In order to control the valves, I would need to change the slicers post processor or use the search and replace function (if the slicer supports it) to add my custom code. While this works for files being printed from SD, I can't adjust the airflow from the web interface using the fan control sliders or just call M106 from the console. So basically the standard Gcode to control the Fans does not work for my setup.
Similar with M3:
Of course, I can write a macro, let's say M3.1.g and change the CNC-Mill-post processor, to call the macro instead of the standard M3 code. But again, If I start the spindle from the web interface the standard code is called instead of my M3.1.g
The proposed logic would be as follows:
if Standard Gcode (like M3) is called
->check if a macro file with the same name (M3.g) is present
--> If yes, call this macro instead.
else
->continue with the standard Gcode (M3)
@deckingman said in Why are "custom GCodes" only for non implemended GCodes?:
You can't call/use M3 from within the macro because you've changed the behaviour such that it will check the door and move the Z axis which will just end up with a recursive call.
And that's where I absolutely agree. My logic only works if the standard Gcode that has called the macro is not included in the macro itself. For me, this would already solve a lot of problems...But Okay.
So we would need to find a way to prevent the recursive calling. One idea would be to execute the standard M3 code directly If it is being called from a macro file, without checking for custom Gcode files beforehand. And If M3 is called from slicer file or web interface or console do the check for a custom Gcode file in sys first and if it is present call it instead.
As an alternative, we could leave the standard codes like M3 untouched but add something like pre.M3.g and post.M3.g where we can add everything that should happen before and/or after the standard M3 call.
I hope this clears things up a little
Cheers
Max