Advertisement
Guest User

Untitled

a guest
Feb 4th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. # Include your customized HAL commands here
  2. # The commands in this file are run after the AXIS GUI (including PyVCP panel) starts
  3.  
  4. loadrt or2 count=2
  5. loadrt mux4 count=1
  6. loadrt scale count=2
  7.  
  8.  
  9.  
  10.  
  11. addf or2.0 servo-thread
  12. addf or2.1 servo-thread
  13. addf mux4.0 servo-thread
  14. addf scale.0 servo-thread
  15. addf scale.1 servo-thread
  16.  
  17.  
  18. # set the jog speed for the joypad again use numbers that make sense for your machine
  19. setp mux4.0.in0 0 # this one must be 0 to prevent motion unless a button is pressed
  20. setp mux4.0.in1 150
  21. setp mux4.0.in2 500
  22. setp mux4.0.in3 1500
  23. setp scale.0.gain -1
  24. setp scale.1.gain -1
  25.  
  26. # the following does the magic of setting the jog speeds
  27. net remote-speed-slow or2.0.in0 input.0.btn-x
  28. net remote-speed-medium or2.1.in0 input.0.btn-y
  29. net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-b
  30.  
  31.  
  32. net joy-speed-1 mux4.0.sel0 <= or2.0.out
  33. net joy-speed-2 mux4.0.sel1 <= or2.1.out
  34. net joy-speed-final halui.jog-speed <= mux4.0.out
  35.  
  36.  
  37.  
  38. #6. Step 6 Set up the Axis
  39. #Add the following to your postgui.hal file
  40.  
  41. net reverse-x scale.0.in <= input.0.abs-x-position
  42. net jog-x halui.jog.0.analog <= scale.0.out
  43.  
  44. net reverse-y scale.0.in <= input.0.abs-y-position
  45. net jog-y halui.jog.0.analog <= scale.0.out
  46.  
  47. net reverse-ry scale.1.in <= input.0.abs-ry-position
  48. net jog-ry halui.jog.0.analog <= scale.1.out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement