So, I might have mentioned that I received a new pendant and got it 
hooked up and running the other day.  I'd been using one of the 
Logitech joypads, and while it didn't do incremental jogs, it did do 
continuos motion jogs by holding the joy stick over.

I was playing around over the weekend, and discovered that unlike 
HALFILE, POSTGUI_HALFILE can only be called once.  I was thinking 
about keeping the joypad around, if only for the continuous motion 
available from the joy stick.  Since I can only call out 
POSTGUI_HALFILE once, is there a way I can safely combine the two hal 
files listed below?  I've got a pretty good handle on the ini file 
stuff, but I'm still a little fuzzy on the hal commands and 
such.  Anyway, here's the two files:

custom_postgui_pendant.hal

**********************************************************

# Jog Pendant
loadrt encoder num_chan=1
loadrt mux4 count=1
loadrt mult2 count=1
loadrt lut5 count=1

addf encoder.capture-position servo-thread
addf encoder.update-counters base-thread
addf mux4.0 servo-thread
addf mult2.0 servo-thread
addf lut5.0 servo-thread

# If your MPG outputs a quadture signal per click set x4 to 1
# If your MPG puts out 1 pulse per click set x4 to 0
setp encoder.0.x4-mode 0

# For velocity mode, set n to 1
# In velocity mode the axis stops when dial is stopped even if that means
# the commanded motion is not completed,
# For position mode (the default), set n to 0
# In position mode the axis will move exactly jog-scale
# units for each count, regardless of how long that might take,
# This must be set for each axis you want to behave other than default
setp axis.0.jog-vel-mode 1
setp axis.1.jog-vel-mode 1
setp axis.2.jog-vel-mode 1
#setp axis.3.jog-vel-mode 0
setp mux4.0.in0 0.01
setp mux4.0.in1 0.001
setp mux4.0.in2 0.0001
setp mult2.0.in0 100
net scale1 mux4.0.sel0 <= parport.1.pin-09-in
net scale2 mux4.0.sel1 <= parport.1.pin-08-in
net pend-scale axis.0.jog-scale <= mux4.0.out
net pend-scale axis.1.jog-scale
net pend-scale axis.2.jog-scale
net pend-scale mult2.0.in1
#net rot-scale axis.3.jog-scale <= mult2.0.out
net mpg-a encoder.0.phase-A <= parport.1.pin-02-in
net mpg-b encoder.0.phase-B <= parport.1.pin-03-in
net mpg-x axis.0.jog-enable <= parport.1.pin-04-in
net mpg-y axis.1.jog-enable <= parport.1.pin-05-in
net mpg-z axis.2.jog-enable <= parport.1.pin-06-in
#net mpg-4 axis.3.jog-enable <= parport.1.pin-07-in
net pend-counts axis.0.jog-counts <= encoder.0.counts
net pend-counts axis.1.jog-counts
net pend-counts axis.2.jog-counts
#net pend-counts axis.3.jog-counts

# Turn on the jog led if any jog axis is enabled
setp lut5.0.function 0x116
net mpg-x lut5.0.in-0
net mpg-y lut5.0.in-1
net mpg-z lut5.0.in-2
net mpg-4 lut5.0.in-3
setp lut5.0.in-4 0
net jog-on parport.1.pin-01-out <= lut5.0.out


********************************************************************

custom_postgui_joystick.hal


*********************************************************************

# Include your customized HAL commands here
# The commands in this file are run after the AXIS GUI (including 
PyVCP panel) starts
  loadrt or2 count=2
  loadrt mux4 count=1

  addf or2.0 servo-thread
  addf or2.1 servo-thread
  addf mux4.0 servo-thread

  # set the jog speed for the joypad again use numbers that make 
sense for your machine
  setp mux4.0.in0 0 # this one must be 0 to prevent motion unless a 
button is pressed
# setp mux4.0.in1 25
# setp mux4.0.in2 100
# setp mux4.0.in3 200
  setp mux4.0.in1 1.5
  setp mux4.0.in2 50
  setp mux4.0.in3 100


  # the following does the magic of setting the jog speeds
  net remote-speed-slow or2.0.in0 input.0.btn-trigger
  net remote-speed-medium or2.1.in0 input.0.btn-thumb
  net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-thumb2

  net joy-speed-1 mux4.0.sel0 <= or2.0.out
  net joy-speed-2 mux4.0.sel1 <= or2.1.out
  net joy-speed-final halui.jog-speed <= mux4.0.out

# Reverse the Z axis

loadrt sum2 count=1 # 1 for each axis you need to reverse, also check 
to make sure you don't all ready have sum2 loaded
  addf sum2.0 servo-thread # in my case I needed to reverse the Z axis

  # set up the axis
  #net joy-x-jog halui.jog.0.analog <= input.0.abs-x-position
  net joy-x-jog halui.jog.0.analog <= input.0.abs-hat0x-position
###################### not used or backwards##############
  #net joy-y-jog halui.jog.1.analog <= input.0.abs-y-position
  #net joy-z-jog halui.jog.2.analog <= input.0.abs-z-position
  #net joy-z-jog halui.jog.2.analog <= input.0.abs-rz-position
###############################################################

setp sum2.0.gain0 -1
  net reverse-z sum2.0.in0 <= input.0.abs-rz-position
  net joy-z-jog halui.jog.2.analog <= sum2.0.out

*****************************************************************************

I'm concerned the mux4 calls in the first file would cause problems 
with the mux 4 calls in the second file.  Are my concerns warranted?

Mark



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to