Indicate that a Command is added to the Movement Queue
-
The behaviour of some G and M Codes in relation to the movement queue has silently changed in the past.
This is for example the reason why I only add a single line of code
M112
in the emergency stop trigger, even if I would add more commands to it - if a customer is updating the firmware, it may break the script.In the recent days, I saw other people getting in touch with the behaviour of the movment queue and it is kind of a pitfall if you don't know it.
So in order to make people aware of it, I would like to propose a small icon next to the G-Code Command in the Docs to indicate, that the command is added to the movement queue. The Icon is linked to a page explaining the movement queue and show examples on how to get around the queue, e.g. use expressions at the moment.
what do you think about it?
the icon shown is from flaticon, but that is not important.
-
@timschneider I think you're asking for a list of Gcodes that get added to the movement queue, rather than being acted on immediately (ie not queued)? This is documented, to some extent though the focus is on multiple motion systems, here: https://docs.duet3d.com/en/User_manual/RepRapFirmware/Multiple_motion_systems
We can't really add an icon to the title header, as this is used for linking, so I think that would mess links up. We can certainly add a note to relevant Gcodes, though there are rather a lot Gcodes that get added to the movement queue. I'm not sure how useful this info is for most users; maybe just create a page that lists Gcodes that are put in the movement queue, and those that are acted on immediately.
Ian
-
@droftarts Oh, I didn't knew that list! that's cool! So I guess there is only a link missing maybe in the GCode Meta Commands
And it appears to me, that M42 is missing in the list, as it is somehow related to the motion system.
The use case I want to address is the following:
Writing a script to turn off an output when the E-Stop is triggered. Putting an M42 in front the the M112 in the E-Stop trigger will prevent the M112 from beeing processed until the motion system is ready and M42 is processed. That was the first time I came into contact with the G-Code queue and it was not clear to me, why an M42 will wait for the current move to finish for its execution, but anyhow. The same is true for the daemon.g you can easily add commands to the daemon.g which will be queued and executed later on e.g. turning an LED on and off in intervalls will sometimes use different intervalls depending on the current state of the gcode queue.For exmaple the following
https://forum.duet3d.com/topic/34551/while-command-not-work-properly-while-printing/4?_=1704803827259And it is not easy to understand for people that are not aware of it and I think it is hard to understand at the moment due to the lack of a direct hint towards the queue.
-
@timschneider @dc42 sent me the following:
Non-movement commands behave like this:
- Some commands wait for all movement to stop. This applies to configuration commands such as M93, M906, M201, M569 etc., commands that do probing, G4, M400, and T commands. In most (but not all) cases, when configuration commands are used in reporting-only mode if that is supported (i.e. with no parameters or a reduced set of parameters), they don't wait for movement to stop.
- Some are always executed immediately.
- Some commands may be put in a queue to delay their execution until the most recent movement command from the same input channel has completed. This only happens if the command comes from a File channel (i.e. it is in a job file) and its parameters do not contain any expressions, i.e. there are no parameter values in { }. The M-commands this applies to are: M3 and M5 when not in laser mode; M4, 42, 104, 106, 107, 140, 141, 144, 280, 300, 568. The only G command this applies to is G10 and only if it does not contain the L parameter and does contain at least one P, R, S or axis letter parameter.
I'll now work out how to document this, and which Gcode belongs where!
Ian
-
@droftarts
the informations are now available in the docs.https://docs.duet3d.com/en/User_manual/Reference/Gcodes#command-queueing
this thread can be marked as solved.
-
-
-
@timschneider Interesting, as that section has been in the Gcode dictionary since September 2022, and barely edited since! I'll update it with what @dc42 sent me earlier.
EDIT: Okay, I've updated this section, I think it makes sense: https://docs.duet3d.com/en/User_manual/Reference/Gcodes#command-queueing
Ian