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

    Conditional GCode

    Scheduled Pinned Locked Moved
    General Discussion
    6
    10
    1.3k
    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.
    • Garfieldundefined
      Garfield
      last edited by

      Can conditional statements be included in gcode as they can in Marlin ?

      for instance this is run at the end of a print on my Prusa to move the extruder / hot end up and away from the last line printed - but it takes account of where on the Z axis the print completes and if less than max print height moves to either Z+30 or max print height.

      {if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up

      I ask since search produces nothing definitive for RepRap other than it was being developed.

      1 Reply Last reply Reply Quote 0
      • Danalundefined
        Danal
        last edited by

        Not yet. Coming in a release of V3. From a few things the primary developer, @DC42, has said, coming relatively soon (next few months??)

        Delta / Kossel printer fanatic

        1 Reply Last reply Reply Quote 0
        • A Former User?
          A Former User
          last edited by

          As pointed out, comming "soon". Maybe follow this thread? https://forum.duet3d.com/topic/13516/conditional-gcode-and-object-model-variables/25

          1 Reply Last reply Reply Quote 0
          • Garfieldundefined
            Garfield
            last edited by

            Followed .... hadn't found that one.

            1 Reply Last reply Reply Quote 0
            • tekkydaveundefined
              tekkydave
              last edited by tekkydave

              @Garfield said in Conditional GCode:

              Can conditional statements be included in gcode as they can in Marlin ?

              for instance this is run at the end of a print on my Prusa to move the extruder / hot end up and away from the last line printed - but it takes account of where on the Z axis the print completes and if less than max print height moves to either Z+30 or max print height.

              {if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up

              I ask since search produces nothing definitive for RepRap other than it was being developed.

              Isn't this conditional slicing in Slic3r rather than actual conditional g code? The expression is evaluated at slice time and fixed G codes placed in the .gcode file. I may be wrong but the final gcode file is just standard gcode.
              If that's true it will work regardless of what firmware you are using.

              ~ tekkydave ~
              D-Bot: 300x300mm | Duet WiFi + Duex2 | 3 independent z motors | X,Y & Z linear rails | E3D Titan Aero + V6 | Precision Piezo z-probe
              FreeCAD, PrusaSlicer

              daaveryundefined 1 Reply Last reply Reply Quote 0
              • daaveryundefined
                daavery @tekkydave
                last edited by

                @tekkydave yep that's all done in slic3r at slice time , nothing in the firmware

                1 Reply Last reply Reply Quote 1
                • Garfieldundefined
                  Garfield
                  last edited by

                  You know I've not looked, you're probably correct as I've just looked at some gcode produced by it and theres no conditions present, hadn't really considered the slicer's part in all this.

                  So I guess the question becomes can the 'Printer' automatically add stuff based on specific conditions such as change tool, finish print, start print - so that slicers without the capability are accomodated ?

                  dc42undefined 1 Reply Last reply Reply Quote 1
                  • dc42undefined
                    dc42 administrators @Garfield
                    last edited by

                    @Garfield said in Conditional GCode:

                    So I guess the question becomes can the 'Printer' automatically add stuff based on specific conditions such as change tool, finish print, start print - so that slicers without the capability are accomodated ?

                    There are already specific macro files that RRF calls in those 3 situations.

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    1 Reply Last reply Reply Quote 0
                    • Garfieldundefined
                      Garfield
                      last edited by

                      I'm not sure what those are (will go look) but could we make it call specific / tailored macros to avoid messing with 'defaults' ?

                      I apologise to all for whom this is old ground ... it's new to me I'm afraid.

                      1 Reply Last reply Reply Quote 0
                      • A Former User?
                        A Former User
                        last edited by

                        https://duet3d.dozuki.com/Wiki/Macros#Section_System_Macros

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