#LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass book \language english \inputencoding auto \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Chapter MPG Pendant \layout Standard This example is to explain how to hook up the common MPG pendants found on the market place today. This example uses a MPG3 pendant and a C22 pendant interface card from CNC4PC and a second parallel port plugged into the PCI slot. This example gives you 3 axis with 3 step increments of 0.1, 0.01, 0.001. \layout Section Second Parallel Port \layout Standard In this example we are using a second parallel port connected to the MPG Pendant that is plugged into a PCI slot. To find the address of your parallel port card open a terminal window and type \layout Standard \family typewriter \series bold lspci -v \layout Standard You will see something similar to this \layout List \labelwidthstring 00.00.0000 0000:00:10.0 Communication controller: NetMos Technology PCI 1 port parallel adapter (rev 01) \layout List \labelwidthstring 00.00.0000 Subsystem: LSI Logic / Symbios Logic: Unknown device 0010 \layout List \labelwidthstring 00.00.0000 Flags: medium devsel, IRQ 11 \layout List \labelwidthstring 00.00.0000 I/O ports at a800 [size=8] \layout List \labelwidthstring 00.00.0000 I/O ports at ac00 [size=8] \layout List \labelwidthstring 00.00.0000 I/O ports at b000 [size=8] \layout List \labelwidthstring 00.00.0000 I/O ports at b400 [size=8] \layout List \labelwidthstring 00.00.0000 I/O ports at b800 [size=8] \layout List \labelwidthstring 00.00.0000 I/O ports at bc00 [size=16] \layout Standard In my case the address was the first one so I changed my .hal file from \layout Standard \family typewriter \series bold loadrt hal_parport cfg=0x378 \layout Standard to \layout Standard \family typewriter \series bold loadrt hal_parport cfg="0x378 0xa800 in" \layout Standard note the double quotes surrounding the addresses. \layout Standard and added \layout Standard \family typewriter \series bold addf parport.1.read base-thread addf parport.1.write base-thread \layout Standard so the parport will get read and written to. \layout Section Hook it up in HAL \layout Standard In your custom.hal file or other .hal file add the following making sure you don't have mux4 or an encoder already in use. If you do just increase the counts and change the reference number. \layout Standard \family typewriter \series bold # Jog Pendant \layout Standard \family typewriter \series bold loadrt encoder num_chan=1 \layout Standard \family typewriter \series bold loadrt mux4 count=1 \layout Standard \family typewriter \series bold addf encoder.capture-position servo-thread \layout Standard \family typewriter \series bold addf encoder.update-counters base-thread \layout Standard \family typewriter \series bold addf mux4.0 servo-thread \layout Standard \family typewriter \series bold setp encoder.0.x4-mode 0 \layout Standard \family typewriter \series bold setp mux4.0.in0 0.1 \layout Standard \family typewriter \series bold setp mux4.0.in1 0.01 \layout Standard \family typewriter \series bold setp mux4.0.in2 0.001 \layout Standard \family typewriter \series bold net scale1 mux4.0.sel0 <= parport.1.pin-09-in \layout Standard \family typewriter \series bold net scale2 mux4.0.sel1 <= parport.1.pin-10-in \layout Standard \family typewriter \series bold net pend-scale axis.0.jog-scale <= mux4.0.out \layout Standard \family typewriter \series bold net pend-scale axis.1.jog-scale \layout Standard \family typewriter \series bold net pend-scale axis.2.jog-scale \layout Standard \family typewriter \series bold net mpg-a encoder.0.phase-A <= parport.1.pin-02-in \layout Standard \family typewriter \series bold net mpg-b encoder.0.phase-B <= parport.1.pin-03-in \layout Standard \family typewriter \series bold net mpg-x axis.0.jog-enable <= parport.1.pin-04-in \layout Standard \family typewriter \series bold net mpg-y axis.1.jog-enable <= parport.1.pin-05-in \layout Standard \family typewriter \series bold net mpg-z axis.2.jog-enable <= parport.1.pin-06-in \layout Standard \family typewriter \series bold net pend-counts axis.0.jog-counts <= encoder.0.counts \layout Standard \family typewriter \series bold net pend-counts axis.1.jog-counts \layout Standard \family typewriter \series bold net pend-counts axis.2.jog-counts \the_end