Welcome! Log In Create A New Profile

Advanced

Custom command not queued

Posted by pierrealexb 
Custom command not queued
June 29, 2017 10:19AM
Hey everybody!

I create 2 custom commands (M10 & M11) to control a door locking system. Everything works well and I can lock and unlock my door using a out pin.

But the command never queued after move commands, it is executed instantly. It is a bit tricky because the door unlock before the moves ended.

Do you know how I could make it done after moves, I mean in the same order commands are send to the board.

I attach my Marlin_main.cpp if its can help!

Thanks!

Pierrealexb
Attachments:
open | download - Marlin_main.cpp (393.5 KB)
Re: Custom command not queued
June 29, 2017 06:54PM
Put an M400 Gcode before your M10 or M11
The M400 will wait until all prev movements Gcodes ends.
Re: Custom command not queued
July 01, 2017 11:01PM
Yes. Use M400 to drain queue. The problem you are seeing is commands get queued. The movement commands take time to execute and Marlin is processing future commands trying to keep the nozzle busy. But your M10 and M11 get executed immediately when they get processed. And that means there are still movement commands that have not finished being processed.
Re: Custom command not queued
July 03, 2017 07:51AM
Hey!

Thank you guys! I did it and it works well!

I did even more thanks to you advice, I implented directly the M400 called fonction in my custom GCODE M11 : stepper.synchronize();

Bye!
Sorry, only registered users may post in this forum.

Click here to login