Welcome! Log In Create A New Profile

Advanced

Run Gcode from within Marlin

Posted by mf2909 
Run Gcode from within Marlin
April 06, 2020 09:48AM
Hi,

I'm currently trying to modify Marlin 2.0 and add a function (G39) that does a homing sequence for having a corner finding operation using a metal plate on the edge of my workpiece. For this I would like to run multiple G38 commands with some custom code inbetween. I think I understand how G38 works so I'm wondering if there is a way of using existing Gcodes within a function of Marlin. The problem is, that in order to use the G38 command, the parser has to know the XYZ distances given after the G38 command. But when calling G38() from inside of Marlin, the parser will not know any values. One way for me would be to duplicate the whole G38 routine but use something like G38_new(int8_t subcode, float x, float y, float z). That would be totally possible but I think it would also be a waste of time and memory space if there is an easier solution. So is it possible to inject a G38 command in a way that the parser acts like it would have come from a serial connection?

Thanks for any help,

Max
Sorry, only registered users may post in this forum.

Click here to login