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

    custom mcode documentation

    Scheduled Pinned Locked Moved
    Documentation
    3
    6
    165
    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.
    • jltxundefined
      jltx
      last edited by

      I have searched high and low for documentation on custom mcodes and found zero. I looked through all the RRF release notes. I have found people talking about it like it is common knowledge. I found examples which are all inconsistent in format and language. I tried some and they do not appear to work. I have a case where a custom mcode would be a perfect solution but no idea how to get started. Maybe the formal name is different. Can someone point me to the definitive documentation?

      droftartsundefined 1 Reply Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @jltx
        last edited by

        @jltx https://docs.duet3d.com/en/User_manual/Reference/Gcodes#custom-gcodes

        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

        jltxundefined 1 Reply Last reply Reply Quote 0
        • jltxundefined
          jltx @droftarts
          last edited by

          @droftarts Funny, I searched everywhere for Mcode and it was Gcode.

          Anyway, that tells me how to invoke the command but not the construction. I get that I can execute a gcode macro. But other examples are in other languages like python and something that looks like some sort of YAML or similar. What is allowed? Can I execute a system command on the SBC? It seems like this is potentially very extensible but I don't see any description of parsing and execution or available state and scope. I must be missing some key document.

          droftartsundefined chrishammundefined 3 Replies Last reply Reply Quote 0
          • droftartsundefined
            droftarts administrators @jltx
            last edited by

            @jltx Custom G/Mcodes are effectively just system macros, so like all other macros on RRF, they need to be written in Gcode. I think there may be a way to intercept a Gcode and run it on the SBC, but @chrishamm would be the best one to advise on this.

            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 0
            • droftartsundefined
              droftarts administrators @jltx
              last edited by

              @jltx Actually, from the answer in another thread, there is dsf-python; see https://github.com/Duet3D/dsf-python
              This allows for Python-scripted events to interact with the Duet. There's also ExecOnMcode https://plugins.duet3d.com/plugins/DSF_ExecOnMcode_Plugin.html

              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 0
              • chrishammundefined
                chrishamm administrators @jltx
                last edited by

                @jltx DSF is written in C#, so the official API bindings are provided as .NET (NuGet) packages. As a good start for custom codes using a C# application I'd recommend the DuetPiManagementPlugin source code. If you prefer Python, check out the links @droftarts shared.

                Duet software engineer

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