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

    Gcode Meta commands - where to find allowed expressions ?

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    5
    7
    573
    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.
    • duetloverundefined
      duetlover
      last edited by duetlover

      sylvain
      sylvain 8 Aug 2020, 15:30

      Hi everybody

      I'm trying to play with conditionnal gcode. I looked at this page :

      https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands

      Where I found for example :

      if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
      
        G28
      

      Where can I found allowed expressions ? By expression I mean in this case "move.axes[x].homed" ?

      Is there a dozuki page about this ?

      What I want to do today is :

      if "Y axis position < -45"
      
          DO SOMETHING
      

      Thanks !

      guywinslowundefined 1 Reply Last reply Reply Quote 0
      • fcwiltundefined
        fcwilt
        last edited by

        Hi,

        There is this:

        https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands

        Frederick

        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

        1 Reply Last reply Reply Quote 0
        • duetloverundefined
          duetlover
          last edited by

          I found this :

          https://duet3d.dozuki.com/Wiki/Object_Model_of_RepRapFirmware

          but it seems that position state is not implemented 😕

          Thanks

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

            @sylvain said in Gcode Meta commands - where to find allowed expressions ?:

            but it seems that position state is not implemented

            its just not documented i believe. look at he M409 command to examine your current object model and maybe search the forum for examples?

            move.axes[1].userPosition should be your y position iirc

            dc42undefined 1 Reply Last reply Reply Quote 1
            • duetloverundefined
              duetlover
              last edited by

              @bearer said in Gcode Meta commands - where to find allowed expressions ?:

              move.axes[1].userPosition

              Thanks for your help !

              1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators @A Former User
                last edited by dc42

                @bearer said in Gcode Meta commands - where to find allowed expressions ?:

                @sylvain said in Gcode Meta commands - where to find allowed expressions ?:

                but it seems that position state is not implemented

                its just not documented i believe. look at he M409 command to examine your current object model and maybe search the forum for examples?

                move.axes[1].userPosition should be your y position iirc

                Bear in mind that userPosition is position commanded by GCode and is subject to modification by tool offsets, workplace coordinates. M579 coordinate scaling etc. Depending on what you want to do, it may be more appropriate to use move.axes[1].machinePosition.

                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
                • guywinslowundefined
                  guywinslow @duetlover
                  last edited by guywinslow

                  @duetlover
                  There isn’t a lot of examples. I just cobbled this together for a temperature tower. It needs to use some Constants from the slicer and variables. I have not been able to get the Latest RRF 3.X working well yet. So, I don’t have variables yet, but hear is a Script that worked for me on layer change for the temperature tower:
                  ;
                  if move.axes[2].machinePosition > 1.3 && move.axes[2].machinePosition < 1.4
                  echo "machinePosition=", move.axes[2].machinePosition
                  echo "Setting tempreture to: 240"
                  M104 S240
                  elif move.axes[2].machinePosition > 11.0 && move.axes[2].machinePosition < 11.2
                  echo "machinePosition=", move.axes[2].machinePosition
                  echo "Setting tempreture to: 245"
                  M104 S245
                  elif move.axes[2].machinePosition = 21.0 && move.axes[2].machinePosition < 21.2
                  echo "machinePosition=", move.axes[2].machinePosition
                  echo "Setting tempreture to: 250"
                  M104 S250
                  elif move.axes[2].machinePosition = 31.0 && move.axes[2].machinePosition < 31.2
                  echo "machinePosition=", move.axes[2].machinePosition
                  echo "Setting tempreture to: 255"
                  M104 S255
                  ;
                  Sorry, keeps losing the indents

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