LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Right, EMC is pretty awsome, but some parts need some tweaking. As you know communication is done through NML channels, the data sent through souch a channel is one of the classes defined in emc.hh (implemented in emc.cc). If somebody needs a message type that doesn't exist, he should follow these steps to add a new one. (The Message I added in the example is called EMC_IO_GENERIC (inherits EMC_IO_CMD_MSG (inherits RCS_CMD_MSG)))

  1. add the definition of the EMC_IO_GENERIC class to emc2/src/emc/nml_intf/emc.hh
  2. add the type define: #define EMC_IO_GENERIC_TYPE ((NMLTYPE) 1605) - (I chose 1605, because it was available) to emc2/src/emc/nml_intf/emc.hh
  3. add case EMC_IO_GENERIC_TYPE to emcFormat in emc2/src/emc/nml_intf/emc.cc
  4. add case EMC_IO_GENERIC_TYPE to emc_symbol_lookup in emc2/src/emc/nml_intf/emc.cc
  5. added EMC_IO_GENERIC::update function to emc2/src/emc/nml_intf/emc.cc

recompile, and the new message should be there. The next part is to send such messages from somewhere, and receive them in another place, and do some stuff with it.

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited March 28, 2005 6:15 am by Alex Joni (diff)
Published under a Creative Commons License