Re: tkemc problem


EMC folks,

Jon Elson wrote a while back about a bug in tkemc where relative-actual
position doesn't show actual, just commanded. The problem is in
emc/src/emctask/emcsh.cc. I don't know if Ray Henry fixed this yet. I
fixed it and will put it in the next release, but here's what to do if
you don't want to wait:

Edit emc/src/emctask/emcsh.cc, and change 

  Tcl_CreateObjCommand(interp, "emc_rel_act_pos", emc_rel_cmd_pos,
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);

to

  Tcl_CreateObjCommand(interp, "emc_rel_act_pos", emc_rel_act_pos,
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);

on or about line 3400. The mistake was assigning the string
"emc_rel_act_pos" to the wrong function.

The C++ program emc/src/emctask/emcsh.cc is the back-end of tkemc. This
is a replacement for "wish", the default Tcl/Tk "windowing shell" that
is used to run Tcl/Tk scripts. emcsh does everything that wish does,
plus connects to the EMC's communication buffers, and provides new
functions like emc_mode, emc_estop to send commands, and
emc_abs_act_pos, emc_rel_cmd_pos to get status.

You can add new commands to emcsh.cc, following an example like
emc_estop or emc_rel_cmd_pos for sending a command or retrieving status,
respectively. The strings and their corresponding C++ functions have the
same names, so you can search through the file and see what's going on.
The complete list of available commands and status items provided by the
EMC is in emc/src/emcnml/emc.hh. Many of these aren't yet in emcsh.cc,
and therefore not accessible via tkemc. I only put in the ones that I
thought would be needed in the GUI at first.

NML itself can be extended. This is done when new capabilities are added
to the controller, so extending NML really means extending the EMC. The
last one I added was the ability to override limits temporarily, to
support homing off a limit switch. This involved coding it up in the
motion controller (emc/src/emcmot/emcmot.c), adding a new message and
status item for this (emc/src/emcmot/emcmot.h), adding it to NML
(emc/src/emcnml/emc.hh), handling this in the EMC task controller
(emc/src/emctask/emctaskmain.cc), adding it to the EMC windowing shell
(emc/src/emctask/emcsh.cc), then updating the tkemc script to use it.
Whew.

--Fred



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

Problems or questions? Contact