Re: emc development



Chris,

You wrote:

> I have been using EMC since RTL 1.1 and now have it running under RTL2.0
> and would like to contribute by adding a feed/rev gcode. I have C
> programming experience and I am a control engineer by profession. Could
> you please advise me of the correct procedure to follow so that my
> efforts can be easily integrated.

Wow, great, we could use some more programmers. The correct procedure is
to get registered on SourceForge as an EMC developer, as described in
the email to emc-at-nist.gov by Will Shackleford here at NIST that I
appended to this email. Once you do this, you can start whacking away.
You should also subscribe to emc-at-nist.gov so you can ping everyone with
questions. You do not need to be a subscriber to send mail to this list,
although you do need to subscribe to receive mail from this list. To
subscribe, send mail to listproc-at-nist.gov with the following in the body
of the message: 

     subscribe emc

To unsubscribe, send mail to listproc-at-nist.gov with the following in the
body of the message: 

     unsubscribe emc

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

---Developer info from Will--

I have setup a project directory for EMC on SourceForge.

To modify the EMC  source code repository:

1. Go to http://sourceforge.net, click on [New User] link to get your
free account.

2. Take a look at https://sourceforge.net/projects/EMC/ to see the
current status, and the various tools provided via the web.

3. Send a project admin listed on the above page (shackle-at-nist.gov will
do for now) email letting him know you're interested in helping us out
and what your sourceforge login name is so he can add your name to the
developers list.

4. Familiarize yourself with CVS and SSH and install them if you don't
already have them. ( The commands "man cvs","man ssh", "info ssh", and
"info cvs" provide most of the documentation.) 

5. Checkout the code with CVS.
        -- Connect to the internet.
        -- export CVS_RSH=ssh;
        -- cvs -d<yourlogin>-at-cvs.EMC.sourceforge.net:/cvsroot/EMC co -P
emc rcslib
                * Replace <yourlogin> with your sourceforge login name.
                * This checks out everything which will take a while,
you could also just checkout emc or a subdirectory and use a previous
install of EMC for the files you are sure you won't need to modify.

6. Build the RCS library and EMC code. (The RCS library needs to be
built first.)

        cd rcslib
        ./buildrcs linux_2_2_13
        ./buildrcs rtlinux_2_0
        cd ../emc/src
        make PLAT=linux_2_2_13 headers depend all
        make PLAT=rtlinux_2_0 headers depend all
        ( Change the PLAT's to reflect your system.)
        
7. Make your modifications and rebuild and test as necessary.

8. Use the command "cvs commit" from the top level emc or rcslib
directory. CVS will figure out which files you modified and upload them
to the sourceforge repository, where other developers can get them.

9. Let a project administrator know they should create a new archive for
release OR become a project administrator, create and upload your own
archive.



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

Problems or questions? Contact