Running the GUI on a separate computer - From Will Shackleford
EMC usually consists programs from 4 categories:
GUI - (Graphical User Interface) xemc, yemc, tkemc, emcJavaGui, fpanel, etc. TASK - mmtask, shvtask, bridgeportask etc. MOTION - emcmotsim, steppermod.o, shavermod.o, minimod.o, etc. IO - mmio, shvio, simio, bridgeportio, etc.
You generally need to run at least one program from each category to get a working EMC, which to me would mean all 4. Most of the programs in the motion category are built as real-time kernel modules, and at the moment do not communicate using NML directly.
The most common way to split EMC across a network would be to put the TASK,MOTION and IO on computer1 and the GUI on computer2.
To do this I would find the .nml file used for my setup. It is usually the same as the .run file. The file needs to be changed with a text editor in two ways.
1. The host is listed as "localhost" for almost every thing which is fine if everything runs on the same computer but to run across TCP we'll need the real host names. I usually use a global search and replace of "localhost" to "myhost". You can also use IP address directly if you don't have host tables or a name server setup.
2. You need to change the process type flag for the appropriate process from LOCAL to REMOTE.
Then just copy over the .nml file, .ini file and the program you want to run on to computer2.
You need to start emcsvr on the host computer, The computer listed in the buffer lines (which start with B) before starting any remote programs. Attached is the file with xemc on computer2 and everything else on computer1.
When everything is finally run xemc will send messages via TCP to emcsvr which will then be placed in shared memory buffers to be read by IO and TASK. TASK will then forward messages as necessary to the MOTION kernel module.
Scott Stephens wants to run the TkEMC on a Windows PC. Here are the steps to do it, some of which may be confounding you all since the Windows zip/archive file may be out of date, unclickable, or whatever.
1. Get the EMC up and running on your Linux/RT Linux computer, controlling your machine.
2. In the .ini file for the EMC on the Linux/RT computer, make sure that the EMC server is uncommented, e.g.,
; section for external NML server parameters
-----------------
[EMCSERVER]
; Platform for NML server, e.g., nonrealtime
PLAT = nonrealtime
; Name of NML server, e.g., emcsvr; if not found
then none will run
EMCSERVER = emcsvr
The emcsvr runs on the Linux/RT Linux computer. It opens connections to the EMC command and status buffers on the Linux/RT Linux computer, listens for network connections from remote clients (like the TkEMC on a Windows PC), and acts as a go-between.
3. Get the Windows version of the TkEMC and the emcsh program. These should be precompiled and zipped up along with a .nml file.
4. Edit the .nml file, near the top, and put the name of the Linux/RT Linux computer in the buffers' host name field, e.g.,
# Top-level buffers to EMC
B emcCommand SHMEM linuxpc.mydomain 8192 0
0 1 12 1001 TCP=5005 xdr diag
B emcStatus SHMEM linuxpc.mydomain 8192 0 0 2 12 1002 TCP=5005 xdr diag
B emcError SHMEM linuxpc.mydomain 8192 0 0 3 12 1003 TCP=5005 xdr diag queue
There are three entries, which I've put as "linuxpc.mydomain" in this
example. This tells the TkEMC, which will be running on a Windows box,
where to look for the EMC.
5. Edit the .nml file again, near the bottom, and make sure that the
"xemc" process is connecting remotely, using the REMOTE access keyword,
e.g.,
P xemc emcCommand REMOTE localhost W 0 10.0 0 10
P xemc emcStatus REMOTE localhost R 0 10.0 0 10
P xemc emcError REMOTE localhost R 0 10.0 0 10
P xemc toolCmd REMOTE localhost W 0 10.0 0 10
P xemc toolSts REMOTE localhost R 0 10.0 0 10
You can leave "localhost" alone. This is the name of the Windows PC, but it's not used right now so it's mostly for documentation.
6. Start the EMC on the Linux/RT Linux box.
7. Run the TkEMC on the Windows box. It should connect across the network, and bring up a window showing the status of the EMC. You can use either the TkEMC on the Linux box, or the remote one, or both. Try one and watch the other update.
-Fred