rozważania o CNC

OPROGRAMOWNIE => EMC2 => Wątek zaczęty przez: markcomp Styczeń 26, 2012, 11:20:05



Tytuł: NML
Wiadomość wysłana przez: markcomp Styczeń 26, 2012, 11:20:05
NML



configs/common/client.nml

Use this NML config on the computer running the GUI in a networked emc2 system. The host IP address should be changed to point to the computer that is running the realtime code. Change the NML_FILE in emc.ini to client.nml and (after the server side is running) run the GUI with:

Kod:
        tcl/tkemc.tcl -ini emc.ini

Note: tkemc.tcl does not need to be run as 'root'.

Kod:
#
# Use this NML config on the computer running the GUI in a networked emc2
# system. The host IP address should be changed to point to the computer
# that is running the realtime code. Change the NML_FILE in emc.ini to
# client.nml and (after the server side is running) run the GUI with:
#
#        tcl/tkemc.tcl -ini emc.ini
#
# Note: tkemc.tcl does not need to be run as 'root'.

# Buffers
# Name                  Type    Host             size    neut?   (old)   buffer# MP ---

# Top-level buffers to EMC
B emcCommand            SHMEM   192.168.0.4       8192    0       0       1       16 1001 TCP=5005 xdr
B emcStatus             SHMEM   192.168.0.4       10240   0       0       2       16 1002 TCP=5005 xdr
B emcError              SHMEM   192.168.0.4       8192    0       0       3       16 1003 TCP=5005 xdr queue

# Processes
# Name          Buffer          Type    Host              Ops     server? timeout master? cnum

P xemc          emcCommand      REMOTE   192.168.0.4       W       0       10.0    0       10
P xemc          emcStatus       REMOTE   192.168.0.4       R       0       10.0    0       10
P xemc          emcError        REMOTE   192.168.0.4       R       0       10.0    0       10
P xemc          toolCmd         REMOTE   192.168.0.4       W       0       10.0    0       10
P xemc          toolSts         REMOTE   192.168.0.4       R       0       10.0    0       10



configs/common/server.nm

Use this NML config on the computer running the realtime parts of emc2 in a networked system. The host address should point to the computer running the GUI (although this is not critical).
Change the NML_FILE in emc.ini to server.nml.
Start emc2 normally, and then run the GUI client.

Kod:
#
# Use this NML config on the computer running the realtime parts of emc2
# in a networked system. The host address should point to the computer
# running the GUI (although this is not critical).
# Change the NML_FILE in emc.ini to server.nml.
# Start emc2 normally, and then run the GUI client.

# Buffers
# Name                  Type    Host            size    neut?   (old)   buffer# MP ---

# Top-level buffers to EMC
B emcCommand            SHMEM   localhost       8192    0       0       1       16 1001 TCP=5005 xdr
B emcStatus             SHMEM   localhost       10240   0       0       2       16 1002 TCP=5005 xdr
B emcError              SHMEM   localhost       8192    0       0       3       16 1003 TCP=5005 xdr queue

# These are for the IO controller, EMCIO
B toolCmd               SHMEM   localhost       1024    0       0       4       16 1004 TCP=5005 xdr
B toolSts               SHMEM   localhost       4096    0       0       5       16 1005 TCP=5005 xdr
B spindleCmd            SHMEM   localhost       1024    0       0       6       16 1006 TCP=5005 xdr
B spindleSts            SHMEM   localhost       1024    0       0       7       16 1007 TCP=5005 xdr

# Processes
# Name          Buffer          Type    Host              Ops     server? timeout master? cnum

P emc           emcCommand      LOCAL   localhost           RW      0       1.0     0       0
P emc           emcStatus       LOCAL   localhost           W       0       1.0     0       0
P emc           emcError        LOCAL   localhost           W       0       1.0     0       0
P emc           toolCmd         LOCAL   localhost           W       0       1.0     0       0
P emc           toolSts         LOCAL   localhost           R       0       1.0     0       0

P emcsvr        emcCommand      LOCAL   localhost           W       1       1.0     1       2
P emcsvr        emcStatus       LOCAL   localhost           R       1       1.0     1       2
P emcsvr        emcError        LOCAL   localhost           R       1       1.0     1       2
P emcsvr        toolCmd         LOCAL   localhost           W       1       1.0     1       2
P emcsvr        toolSts         LOCAL   localhost           R       1       1.0     1       2
P emcsvr        default         LOCAL   localhost           RW      1       1.0     1       2

P tool          emcError        LOCAL   localhost           W       0       1.0     0       3
P tool          toolCmd         LOCAL   localhost           RW      0       1.0     0       3
P tool          toolSts         LOCAL   localhost           W       0       1.0     0       3

P xemc          emcCommand      REMOTE   192.168.0.14       W       0       10.0    0       10
P xemc          emcStatus       REMOTE   192.168.0.14       R       0       10.0    0       10
P xemc          emcError        REMOTE   192.168.0.14       R       0       10.0    0       10
P xemc          toolCmd         REMOTE   192.168.0.14       W       0       10.0    0       10
P xemc          toolSts         REMOTE   192.168.0.14       R       0       10.0    0       10




Tytuł: Odp: NML
Wiadomość wysłana przez: markcomp Styczeń 27, 2012, 08:06:03
http://www.wallacecompany.com/machine_shop/EMC2/remote_notes.html

Cytuj

 Notes on running EMC2 with a remote GUI    

Notes on running the EMC GUI remotely

Goal: To run EMC on my Bridgeport with a PC mounted in a cabinet attached to the rear of the machine, and another small form factor or notebook mounted on a boom in the front. This way the parallel port connection from the control PC to the servo controller can be kept short and the GUI computer can be just about anywhere Ethernet can go. These notes may change over time. Any suggestions or corrections are welcome at kwallace AT wallacecompany D0T com.

(Reference documents:
  http://www.linuxcnc.org/handbook/part3/remoteg.html
  Sample nml's that come with EMC2 - /etc/emc2/sample-configs/common/client.nml and .../server.nml
  NFS information - http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Debian_Etch_Server_And_Diskless_EMC2_Thin_Clients
  Multiple UI's - http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Running_Multiple_User_Interfaces )

See the Multiple UI's document above to see the different ways that EMC can be remotely operated. The method described below redirects (or actually directs to an additional stream?) NML messages between the GUI and the other EMC elements.

EMC needs to have 1 through 4 running:
1. GUI    - AXIS (set in .ini file under [DISPLAY])
2. TASK   - milltask (set in .ini under [TASK])
3. MOTION - motmod (set in .ini under [EMCMOT])
4. IO     - io (set in .ini under [EMCIO])

This project will run only the GUI remotely.(At this time the AXIS GUI does not work, but tkemc does.)

Additionally, EMC user files will be located on a file server in /common/EMC_Library, mounted to /home/user_name/emc2 on the server and client PC's.

I have DHCP running but no local DNS so my configurations use IP addresses instead of computer names. Maybe some day I'll fix this.

(It appears that other than the comments in my clientXX.nml and serverXX.nml files, they are the same, so only one file is needed. The files will be different if you use "localhost", as in other sample .nml files)

Control or Server PC Setup

1. Connect to NFS file server
  a. Open /System/Administration/Synaptic Package Manager. Select nfs-common and portmap for installation. Select Apply and approve the dependencies.
  b. change /etc/passwd, /etc/group UID and GID numbers to match user's account settings on file server.
  c. reset file permission for owner and group in user's home directory.
    "chown -R XXX:XXX /home/user_name "
  d. Reboot to apply the user account settings. There may be a better way to do this.
  e. create /home/user_name/emc2 directory.
  f. mount file server's EMC library directory to user's emc2 directory.
    "mount 192.168.55.15:/common/EMC_Library /home/kwallace/emc2" (Should really update the fstab file)

2. Redirect GUI NML
  In /home/user_name/emc2/configs/config_name/ , check for, copy or create a server.nml file. (my serverXX.nml here)
(I created a serverXX.nml file for each client IP address)

3. Activate the new .nml file
  Edit .ini file for your configuration:

                       

From:

To:

...
[EMC]
NML_FILE = emc.nml
...

...
[EMC]
NML_FILE = serverXX.nml
...

(Also check that DISPLAY is not set to axis, tkemc works. I created a serverXX.ini file for each client IP address. I am constantly confusing the .ini and .nml files, so a better naming system than serverXX might be useful.)

4. Connect EMC to the LAN
  Add or uncomment "EMCSERVER = emcsvr" under [EMCSERVER] in the serverXX.ini file.

Client or GUI PC Setup:

1. Install EMC2

2. Connect to NFS file server
  a. Open /System/Administration/Synaptic Package Manager. Select nfs-common and portmap for installation. Select Apply and approve the dependencies.
  b. change /etc/passwd, /etc/group UID and GID numbers to match user's account settings on file server.
  c. reset file permission for owner and group in user's home directory.
    "chown -R XXX:XXX /home/user_name "
  d. Reboot to apply the user account settings. There may be a better way to do this.
  e. create /home/user_name/emc2 directory.
  f. mount file server's EMC library directory to user's emc2 directory.
    "mount 192.168.55.15:/common/EMC_Library /home/kwallace/emc2" (Should really update the fstab file)

3. Redirect GUI NML
  In /home/user_name/emc2/configs/config_name/ , check for, copy or create a server.nml file. (my clientXX.nml here)
(I created a clientXX.nml file for each client IP address)

4. Activate the new .nml file
  Edit .ini file for your configuration:

                       

From:

To:

...
[EMC]
NML_FILE = emc.nml
...

...
[EMC]
NML_FILE = clientXX.nml
...

(Also check that DISPLAY is not set to axis, tkemc works. I created a clientXX.ini file for each client IP address. I am constantly confusing the .ini and .nml files, so a better naming system than serverXX might be useful.)

Connecting:

1. Start EMC on the control (server) PC and select the configuration that matches the client IP address.

1. Start EMC on the client PC and select the configuration that matches the client IP address.


Notes from Reference Documents:

(tcl/tkemc.tcl -ini emc.ini - may be useful for a headless server, cleaned and optimized for real time control.)

"When everthing 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.

-- Will "

(emcsvr will listen for any connection request on the net?)


How I Set Up a Fedora EMC Client:

The server/client system above was based on both PC's being EMC/Ubuntu systems. It would be much more convenient to be able to have any PC on the network be a client.

I first copied tkemc.tcl from the server (/usr/share/emc/tcl/tkemc.tcl) to my home directory, /home/kwallace/emc_remote. From a terminal window, I invoked tkemc.tcl and corrected "missing file" errors until it ran. Here is a list of the files I copied to my home directory:

                       

balloon.tcl
emcdebug.tcl
emc.tcl

libemcini.so.0
libtk8.4.so.0
tkbackplot.tcl

emchelp.tcl
emctesting.tcl
libnml.so.0

libXaw7.so.7
tkemc.tcl
emcsh

genedit.tcl
libtcl8.4.so.0

I created the directories called for in the error messages and copied the corresponding files to these locations:
  /usr/share/emc/tcl/emc.tcl
  /usr/share/emc/tcl/bin/genedit.tcl
  /usr/share/emc/tcl/bin/emctesting.tcl
  /usr/share/emc/tcl/bin/emcdebug.tcl
  /usr/share/emc/tcl/bin/tkbackplot.tcl
  /usr/share/emc/tcl/scripts/balloon.tcl
  /usr/share/emc/tcl/scripts/emchelp.tcl

Somewhere in the process, I needed to create a clientXX.ini and clientXX.nml per the instructions above. You can make these before you start.

tkemc seems to work properly but the colors are not the same as tkemc on the server, so I must be missing a configuration file or two.

Here is the configuration file link - TkEmc. I found TkEmc on the server here - /etc/X11/app-defaults, so created the direcrtory and copied the file over. Now the screen looks normal.

                   

     

Pages Created by Kirk Wallace
     kwallace@wallacecompany.com

   
     

Copyright © 2007 WALLACE COMPANY
     Rev. Date: 2007/12/11 19:21 PST KW