start.g?



  • Hi,

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



  • 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



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



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



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



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



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



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



  • @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 😉


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.