custom mcode documentation
-
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?
-
-
@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.
-
@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
-
@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.htmlIan
-
@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.