3

G-code is a language for controlling CNC machines (lathes, mills).

I have a university assignment that I need conceptual help with. The part of the job that I am having problems with is writing two short programs in G-code (Fanuc corporation dialect). I have a short list of keywords and an example program, but that doesn't seem to be enough to to learn the language.

From my search of the net, I found that the various dialects of G-code are not compatible. However, I found no one tutorial on this specific one.

Also, automatically generating code for the given problems doesn't seem to be an option, since I suspect I will be asked to explain the inner workings of the programs, when presenting them. Furthermore, teachers at my university seem to insist very strongly on doing things Their way, so ... I guess I'll just have to learn the damn thing.

Q: Where can I find a concise (I want to spend no more than 2-3 days on the whole thing) tutorial for the Fanuc dialect of G-code?

Vorac
  • 8,726
  • 11
  • 58
  • 101
  • Here is a short reference that is useful: http://devolrobot.blogspot.no/2014/05/cnc-cheat-sheet.html – Mr. Developerdude May 13 '14 at 11:55
  • Can you give more of an example of what this project is? Are you writing code for a specific machine tool? Does the code need to do a specific function? Your question is too broad for us to really help. – Chris Macaluso Apr 12 '19 at 19:26
  • @55thSwiss this was a university homework many years ago. I moved on to different topics and can't provide any feedback any more. – Vorac Apr 22 '19 at 11:42

1 Answers1

1

I would suggest to take a look at LinuxCNC command lists here or here, as well as a concise version here on CAMotics page. Some special points for Fanuc-compatible controls (e.g. Haas, Mach3):

  • You can have comments inside the parentheses. Basically anything inside (...) will not be executed.
  • You can have parameters / variables. For example you can assign float value of 12.3 to variable slot 101 by #101 = 12.3
  • You can call those variables, For example X#101 is equal to X12.3
  • You may have mathematical expressions and then store the value in another variable slot. For example #3 = [#1 + #2], however you can't have X = [#1 + #2] or X[#1 + #2].

You may find more in depth information here in this article by Benjamin Jurke.

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193