Is there a G-code for listing all implemented G-codes by some firmware?

Is there a G-code for listing all implemented G-codes by some firmware? I’m tried of guessing : ) Sort of a “help” function.

I’m the maintainer of Redeem (“firmware” for Replicape), and I don’t want to “invent” a new M-code if one already exists in any of the other firmwares but is undocumented on the Reprap G-code page.

It could also be a part of M115 in some circumstances, but I’d rather it was it’s own G-code.

M1000 seems available, and I’m not the only one thinking that might be a good place to put it: http://www.craftunique.com/forums/view-thread/127
I’ve added it to the G-code page, so we’ll see if it catches on.: http://reprap.org/wiki/G-code#M1000:_List_all_G-codes
Here is my implementation of it, if anyone is interested: https://bitbucket.org/intelligentagent/redeem/commits/980096e200146e2561d24b4dde8e2beda4b1499e

Here is a CNC related list: http://www.machinemate.com/FullListCodes.htm

I also use the listing in the repetier firmware as a good go-by.

http://replicat.org/mcodes
http://replicat.org/gcodes
http://www.camsoftcorp.com/prod02g.asp

Once you get past those I think they will be printer / firmware specific.

@James_Armstrong thanks! I did not see any “list all gcodes” in either of those, so I guess M1000 is as good as any.

@Elias_Bakken also check out https://github.com/ErikZalm/Marlin/blob/Marlin_v1/Marlin/Marlin_main.cpp - starting from about line 70, there’s a commented list of implemented gcodes.

Thanks guys, but really I’m looking for the G-code that spits out that list from firmware. It’s a nice helper function to list all implemented G-codes instead of visiting a web page to get it. Since there are so many different implementations of G-codes and no firmwares implement all of them, it might be nice to have the firmware report it’s own implementation. Others have proposed M1000 for this which seems like a good choice :slight_smile:

If you’re implementing what about M? and/or G? It would be great also if each individual code had a man entry like M92?. Useful in particular where different firmware use mm/min vs mm/sec. Finally, why doesnt e.g. M92 without an entry report the current values set by that code. Some do, some dont.

I agree with @Brad_Hopper , M?, G? seem pretty logical. Ditto for things like M92 without an entry spitting out current values.

Oh tesla that would be a god’s end…

Great Odin’s ghost!

Ok, good idea! M? G? and M92? Etc. for longer descriptions!

I like the ? idea.

OK, I ended up using simply M for list of M-codes and G for list of G-codes and then generally ‘?’ for a long description of each of the commands. I have not yet implemented the long description for most of the codes, but the system is in place at least. Thanks for the input guys!

Sounds good. I like that system.

@erik_vdzalm any input on this? Do you think this is an OK implementation that could span across firmwares? Marlin included?

Storing an array of numbers for the G codes and another for the M codes is probably OK, but trying to store description strings will be a problem for Marlin and other firmwares for ATmega chips, which are already pushing limits on storage and RAM. It’s already very possible to configure a version of Marlin that will not fit in the storage space available on the chip, particularly for a board using any chip other than the 2560.

@ThantiK The problem with a help function is that we need a special M code for it ;-). (Many hosts do not allow to send simple commands)
There is possible enough flash on most boards, But maintaining the list can be a problem.
Making a list that can be parsed by a host/slicer is difficult. Then someone needs to define a “standard”.