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

    start.g?

    Scheduled Pinned Locked Moved Solved
    Duet Hardware and wiring
    5
    9
    1.1k
    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.
    • 3dmntbighkerundefined
      3dmntbighker
      last edited by

      Hi,

      So if start.g runs when a print starts, what file(s) run when a print ends?

      Scratch built CoreXY with Maestro
      Heavily modified Ender 3 with Maestro
      MPCNC work in progress with Duet WiFi

      1 Reply Last reply Reply Quote 0
      • oliofundefined
        oliof
        last edited by

        stop.g is optional, but if present is run when a print finishes normally with an M0 command at the end of the print job. See https://duet3d.dozuki.com/Wiki/Firmware_Overview

        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

        1 Reply Last reply Reply Quote 0
        • wilrikerundefined
          wilriker
          last edited by

          Or put differently: there is no file that will run at the end of print without any specific command.

          Manuel
          Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
          with probably always latest firmware/DWC (incl. betas or self-compiled)
          My Tool Collection

          1 Reply Last reply Reply Quote 0
          • deckingmanundefined
            deckingman
            last edited by

            And just to add that most slicers have an "end g" section so you can put commands in there, or do what I do and have macros for both "pre print" and "end print" and then just use M98 P xxx to call those macros from te slicer start and end gcode sections. Or you can add M98 Pxxx to the start or end of any existing gcode file to save re-slicing it.

            Ian
            https://somei3deas.wordpress.com/
            https://www.youtube.com/@deckingman

            1 Reply Last reply Reply Quote 0
            • 3dmntbighkerundefined
              3dmntbighker
              last edited by

              My "template" that came with the github image included a stop.g.

              ; stop.g
              ; called when M0 (Stop) is run (e.g. when a print from SD card is cancelled)

              This says "cancelled", and not "finished" in the comments. Is this poor wording or actually wrong? This is why I didn't use it.

              Scratch built CoreXY with Maestro
              Heavily modified Ender 3 with Maestro
              MPCNC work in progress with Duet WiFi

              wilrikerundefined 1 Reply Last reply Reply Quote 0
              • wilrikerundefined
                wilriker @3dmntbighker
                last edited by wilriker

                @3dmntbighker This is neither poor wording nor wrong. This is actually correct. It will not be run on a regular successful ending print automatically. Only if you explicitly call M0.

                If you though pause a print and then cancel it DWC/PanelDue will issue M0 to RRF for you. This will first try to call cancel.g and if it does not exist it will try stop.g next (it won't run both though).

                And to complete the confusion: Running M0 inside cancel.g will then actually call stop.g.

                P.S.: have a look at the documentation for M0. It does have all the conditions on when it runs which file. Usually I'd link directly to it but I am on my phone right now. Linking is hard. 😁

                Manuel
                Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                with probably always latest firmware/DWC (incl. betas or self-compiled)
                My Tool Collection

                3dmntbighkerundefined 1 Reply Last reply Reply Quote 0
                • 3dmntbighkerundefined
                  3dmntbighker @wilriker
                  last edited by 3dmntbighker

                  @wilriker said in start.g?:

                  @3dmntbighker This is neither poor wording nor wrong. This is actually correct. It will not be run on a regular successful ending print automatically. Only if you explicitly call M0.

                  If you though pause a print and then cancel it DWC/PanelDue will issue M0 to RRF for you. This will first try to call cancel.g and if it does not exist it will try stop.g next (it won't run both though).

                  And to complete the confusion: Running M0 inside cancel.g will then actually call stop.g.

                  P.S.: have a look at the documentation for M0. It does have all the conditions on when it runs which file. Usually I'd link directly to it but I am on my phone right now. Linking is hard. 😁

                  #eyeroll

                  So basically the slicer is the only way to get a successful finished print action? I think we need a finish.g. Kind of a forehead smack if you ask me. 🙄

                  Scratch built CoreXY with Maestro
                  Heavily modified Ender 3 with Maestro
                  MPCNC work in progress with Duet WiFi

                  Phaedruxundefined 1 Reply Last reply Reply Quote 0
                  • Phaedruxundefined
                    Phaedrux Moderator @3dmntbighker
                    last edited by

                    @3dmntbighker I think the reasoning may be that by adding M0 to your slicer endcode that ensures that the last command sent by the slicer is your queue to the firmware that the print is finished and it's safe to do whatever is defined next.

                    Z-Bot CoreXY Build | Thingiverse Profile

                    3dmntbighkerundefined 1 Reply Last reply Reply Quote 1
                    • 3dmntbighkerundefined
                      3dmntbighker @Phaedrux
                      last edited by

                      @phaedrux said in start.g?:

                      @3dmntbighker I think the reasoning may be that by adding M0 to your slicer endcode that ensures that the last command sent by the slicer is your queue to the firmware that the print is finished and it's safe to do whatever is defined next.

                      Thanks 😉

                      Scratch built CoreXY with Maestro
                      Heavily modified Ender 3 with Maestro
                      MPCNC work in progress with Duet WiFi

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