Advertisement
Guest User

Untitled

a guest
Feb 4th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 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.  
  7.  
  8. addf or2.0 servo-thread
  9. addf or2.1 servo-thread
  10. addf mux4.0 servo-thread
  11.  
  12.  
  13.  
  14. # set the jog speed for the joypad again use numbers that make sense for your machine
  15. setp mux4.0.in0 0 # this one must be 0 to prevent motion unless a button is pressed
  16. setp mux4.0.in1 150
  17. setp mux4.0.in2 500
  18. setp mux4.0.in3 1500
  19.  
  20.  
  21. # the following does the magic of setting the jog speeds
  22. net remote-speed-slow or2.0.in0 input.0.btn-x
  23. net remote-speed-medium or2.1.in0 input.0.btn-y
  24. net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-b
  25.  
  26.  
  27. net joy-speed-1 mux4.0.sel0 <= or2.0.out
  28. net joy-speed-2 mux4.0.sel1 <= or2.1.out
  29. net joy-speed-final halui.jog-speed <= mux4.0.out
  30.  
  31.  
  32.  
  33. #6. Step 6 Set up the Axis
  34. #Add the following to your postgui.hal file
  35.  
  36. net joy-x-jog halui.jog.0.analog <= input.0.abs-y-position
  37. net joy-y-jog halui.jog.1.analog <= input.0.abs-x-position
  38. net joy-z-jog halui.jog.2.analog <= input.0.abs-ry-position
  39.  
  40.  
  41. #7. Reverse any Axis that go in the wrong direction
  42. #To reverse the direction of an axis add the following, in my case both Y and Z were backwards.
  43.  
  44. setp input.0.abs-x-scale -127.5
  45. setp input.0.abs-y-scale -127.5
  46. setp input.0.abs-ry-scale -127.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement