• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Indicate that a Command is added to the Movement Queue

Scheduled Pinned Locked Moved Solved
Documentation
2
6
281
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    timschneider
    last edited by timschneider 1 Feb 2024, 08:40 1 Jan 2024, 13:43

    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.

    f7781860-e4b5-452b-939a-8c334582f614-grafik.png

    what do you think about it?

    the icon shown is from flaticon, but that is not important.

    undefined 1 Reply Last reply 9 Jan 2024, 11:36 Reply Quote 3
    • undefined
      droftarts administrators @timschneider
      last edited by 9 Jan 2024, 11:36

      @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

      Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

      undefined 1 Reply Last reply 9 Jan 2024, 12:41 Reply Quote 0
      • undefined
        timschneider @droftarts
        last edited by 9 Jan 2024, 12:41

        @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?_=1704803827259

        And 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.

        undefined 1 Reply Last reply 9 Jan 2024, 15:16 Reply Quote 0
        • undefined
          droftarts administrators @timschneider
          last edited by 9 Jan 2024, 15:16

          @timschneider @dc42 sent me the following:

          Non-movement commands behave like this:

          1. 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.
          2. Some are always executed immediately.
          3. 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

          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

          undefined 1 Reply Last reply 5 Feb 2024, 10:37 Reply Quote 2
          • undefined
            timschneider @droftarts
            last edited by 5 Feb 2024, 10:37

            @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.

            undefined 1 Reply Last reply 6 Feb 2024, 15:23 Reply Quote 1
            • undefined T3P3Tony marked this topic as a question 5 Feb 2024, 16:56
            • undefined T3P3Tony has marked this topic as solved 5 Feb 2024, 16:56
            • undefined
              droftarts administrators @timschneider
              last edited by droftarts 2 Jun 2024, 16:54 6 Feb 2024, 15:23

              @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

              Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA