Re: tkemc at a socket



Till Franitza wrote:

> Whatis the format of the information that can be accessed from the
> tcp/ip-socket by for example Tcl/tk or (i suppose, this is
> similar),java?
> I expected this to be the easiest way to attach a user-interface to EMC.

As Will replied, using Tcl/Tk to operate on the raw socket data is probably the
MOST DIFFICULT way to attach a user interface to EMC. If you want to use Tcl/Tk,
use emcsh, the EMC version of wish, as we did in tkemc.tcl. This extends wish
with some C++ code for dealing with NML, the comm layer that handles sockets or
shared memory for you.

As far as Java is concerned, Will replied that the CodeGen utility generates
Java code for dealing with NML, so you don't have to. Again, the MOST DIFFICULT
way to attach a Java user interface is to write Java code that deals with the
socket data directly. The easiest is to call the Java functions we already wrote
for that.

If you wanted to write a new GUI, using say Perl/Tk or Python/Tk, it would be
best to do what we did with Tcl/Tk:

1. write C++ code for dealing with NML commands and status (see
emc/src/emctask/emcsh.cc for an example).

2. Load this code into your new language interpreter. I don't know how this
works in Perl or Python, but it's the same as how these languages load in C
modules.

3. Write the Perl or Python script that calls the EMC functions you built and
loaded in.

--Fred



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

Problems or questions? Contact