Marlin: [Q] Send ok after the moving is done.

Created on 14 May 2018  路  5Comments  路  Source: MarlinFirmware/Marlin

Hi Everyone, for current firmware, if i send a gcode for example G0 X100 Y100 Z10, it will response "ok" right after it receive the message.
However, i wish to receive ok once the moving is done(same as G28 the homing process).
the reason i do this is I'm trying to tell the system to do something else once it reach to the destination.

i see the G28 command is using similar method, the controller send "busy: processing" while it is still in the move. i wish i can do the same for G0 and G1 command. i did several try and only found "KEEPALIVE_STATE(IN_PROCSSS);" may related to that, not sure how i can do what i want.
can you please help me to check how to modify the code to match what i need?

Question

All 5 comments

I think this will be hard to achieve. As I know movement received are inserted in a queue and then, after some time, executed. Different is G28 that is executed sequentially and immediately.
G28 can send message as soon as it terminate while movements are terminated inside an interrupt (I suspect) and such isr requires to be executed as fastest as possible and communication can't be done there.

Try this:

G1 X100 F1000
M400
M118 moved!

@thinkyhead Thank you and it works!

I knew M400 had to be good for something. Cheers.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Glod76 picture Glod76  路  3Comments

Kaibob2 picture Kaibob2  路  4Comments

ShadowOfTheDamn picture ShadowOfTheDamn  路  3Comments

esenapaj picture esenapaj  路  3Comments

jerryerry picture jerryerry  路  4Comments