CAD CAM EDM DRO - Yahoo Group Archive

Tcl/Tk GUI for EMC

Posted by Fred Proctor
on 1999-06-16 15:01:56 UTC
EMC folks,

Dave Anderson wrote about a Tcl/Tk GUI (I haven't seen it yet, Dave,
been busy twiddling with this and that):

>
I have a simple TCL/TK CNC control panel GUI that I was playing with for
my own use. I sent it out serveral months ago to Fred Proctor and some
others on the rt-linux NG. It is just a simple hack that at this point
has no interface to EMC. IF I could get some assistance in the details
of the EMC interface, I could try to get it to function.
<

I thought a bit about this and have begun building an EMC program that
originated as a Tcl-based automatic tester using scripts, but that can
serve as a wish-like shell for Tk applications. It's the "autoemc"
program, with code in emc/src/emctask/autoemc.cc.

The idea is that this program opens all the NML channels to the EMC for
commands out, status back; adds statements to Tcl, e.g., "emc_estop",
using:

Tcl_CreateCommand(interp, "emc_estop", emc_estop, (ClientData) NULL,
(Tcl_CmdDeleteProc *) NULL);

and then enters the Tcl loop:

TclX_Main(argc, argv, Tcl_AppInit);

You can then use this program as the shell for interpreting Tcl/Tk
scripts that would call things like "emc_estop".

You can use any of the "graphical" user interfaces xemc.cc, emcpanel.cc,
keystick.cc as examples of how to get the EMC status and write EMC
commands. I will add a description of the external interface to EMC in
the EMC User's Guide. By the way, the external interface supports
running any of the "G"UI's remotely, so you can pop up a GUI you write
on a machine somewhere on your network and watch (or run) the machine. I
did this between Livermore, CA and Pontiac, MI once. If you use NML as
in the example programs (xemc, etc.) and set up the emc.nml config file
with machine names, it's all handled for you.

--Fred

Discussion Thread

Fred Proctor 1999-06-16 15:01:56 UTC Tcl/Tk GUI for EMC