Re: regarding future plans for EMC



Wayne, others new to EMC source code,

Here is a snip from a document buried somewhere between NIST, sourceforge,
and linuxcnc.org. It is a reply written by Fred Proctor -at- NIST, and lays out
in a nutshell the command/motion structure, and some key inteface function
names to look for. It also gives the address of an initial (and only?) shot
at documenting the code (not a detailed hierarchy, though).

> I suspect that EMC can be partitioned into two pieces --
> a front end and a back end:

Essentially, the front end is the GUI, the command interpreter
(rs274ngc/_new), and the emctask/bridgeportio/etc. The 'back end' is the
RCSlib and the emcmot module (stg_8axis_mod.o, freqmod.o,etc), and iosh.
My understanding at this point is that iosh (tcl prog) does the IO in
non-realtime. The IO commands go direct (correct me if I'm wrong here, Ray)
from the Tkemc gui to iosh.

FWIW,

 Keith Rumley


__Snip___________________________________________
Begin quote:
The hard part (and the SourceForge setup is not that easy) is figuring
out how to change the EMC code to do what you want. I posted a
description of the code layout to the EMC list, which you can view in
the list archive:

        http://www.nist.gov/itl/div896/emaildir/emc/maillist.html

The subject is "EMC source code documentation, first cut", dated Mon, 14
Aug 2000. This is a start to understanding the code layout.

Specifically for your case, adding a feed per rev G code, here is my
guide:

1. Tom Kramer (thomas.kramer-at-nist.gov) wrote the G code interpreter.
It's in emc/src/rs274ngc/. For questions on the interpreter itself, he's
the one. Our philosophy was to implement a dialect of NC code based on a
specification written by Rockwell Automation for the National Center for
Manufacturing Sciences (NCMS). It's supposedly based on a Fanuc dialect.

2. Once the interpreter parses the G codes, it calls one of many
"canonical functions" defined in emc/src/emctask/emccanon.cc. That is,
when it sees a comment, it calls the COMMENT() function. When it sees a
G01, it calls STRAIGHT_FEED(). In emccanon.cc, you'll see that these
functions end up putting data structures on a global linked list, the
interp_list. The data structures comprise the Neutral Messaging Language
(NML), and is the format in which all commands and status flow around.
The message set can be seen in all its gory detail in
emc/src/emcnml/emc.hh.

3. The EMC task controller (emc/src/emctask/emctaskmain.cc) calls the
interpreter with emcTaskPlanRead()/emcTaskPlanExecute() calls, then
looks at the interp_list to see what was put on it. It then decides when
the next message should be handled, and who gets it. This is the
checkPreconditions(), issueCommand(), and checkPostconditions() sequence
in emctaskmain.cc.

4. Either the motion controller or IO controller is sent the message,
and does the actual work. In your case, feed per rev may be able to be
converted into an equivalent straight feed at a rate calculated by
looking at the S code. This wouldn't impact much at all, maybe just
rs274ngc.cc. Talk to Tom Kramer for his advice.

Best regards,

--Fred



_________________________________________________________
Do You Yahoo!?
Get your free -at-yahoo.com address at http://mail.yahoo.com




Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact