Advertisement
Guest User

Untitled

a guest
Feb 5th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. # Include your customized HAL commands here
  2.  
  3. # The commands in this file are run after the AXIS GUI (including PyVCP panel) starts
  4.  
  5.  
  6.  
  7. loadrt or2 count=3
  8.  
  9. loadrt mux4 count=1
  10.  
  11. loadrt scale count=3
  12.  
  13. loadrt and2 count=5
  14.  
  15. loadrt toggle count=1
  16.  
  17. loadrt toggle2nist count=1
  18.  
  19.  
  20.  
  21.  
  22.  
  23. addf or2.0 servo-thread
  24.  
  25. addf or2.1 servo-thread
  26.  
  27. addf mux4.0 servo-thread
  28.  
  29. addf scale.0 servo-thread
  30.  
  31. addf scale.1 servo-thread
  32.  
  33. addf scale.2 servo-thread
  34.  
  35. addf and2.0 servo-thread
  36.  
  37.  
  38.  
  39. #for start/stop/resume
  40.  
  41. addf and2.1 servo-thread
  42.  
  43. addf and2.2 servo-thread
  44.  
  45. addf and2.3 servo-thread
  46.  
  47. addf and2.4 servo-thread
  48.  
  49. addf or2.3 servo-thread
  50.  
  51. addf toggle.0 servo-thread
  52.  
  53. addf toggle2nist.0 servo-thread
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. # set the jog speed for the joypad again use numbers that make #sense for your machine
  62.  
  63.  
  64.  
  65. setp mux4.0.in0 0 # this one must be 0 to prevent motion unless a button is pressed
  66.  
  67. setp mux4.0.in1 150
  68.  
  69. setp mux4.0.in2 500
  70.  
  71. setp mux4.0.in3 1500
  72.  
  73. setp scale.0.gain -1
  74.  
  75. setp scale.1.gain -1
  76.  
  77. setp scale.2.gain -1
  78.  
  79.  
  80.  
  81. # the following does the magic of setting the jog speeds
  82.  
  83.  
  84.  
  85. net remote-speed-slow or2.0.in0 input.0.btn-x
  86.  
  87. net remote-speed-medium or2.1.in0 input.0.btn-y
  88.  
  89. net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-b
  90.  
  91. net joy-speed-1 mux4.0.sel0 <= or2.0.out
  92.  
  93. net joy-speed-2 mux4.0.sel1 <= or2.1.out
  94.  
  95. net joy-speed-final halui.jog-speed <= mux4.0.out
  96.  
  97.  
  98.  
  99. #6. Step 6 Set up the Axis
  100.  
  101. #Add the following to your postgui.hal file
  102.  
  103.  
  104.  
  105. net reverse-x scale.0.in <= input.0.abs-x-position
  106.  
  107. net jog-x halui.jog.0.analog <= scale.0.out
  108.  
  109.  
  110.  
  111. net reverse-y scale.1.in <= input.1.abs-y-position
  112.  
  113. net jog-y halui.jog.1.analog <= scale.1.out
  114.  
  115.  
  116.  
  117. net reverse-ry scale.2.in <= input.2.abs-ry-position
  118.  
  119. net jog-ry halui.jog.2.analog <= scale.2.out
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127. # Call touch off
  128.  
  129.  
  130.  
  131.  
  132.  
  133. net touchzbutton1 and2.0.in0 <= input.0.btn-tl
  134.  
  135. net touchzbutton2 and2.0.in1 <= input.0.btn-tr
  136.  
  137.  
  138.  
  139. net touch-z and2.0.out => halui.mdi-command-00
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151. # External Program Pause/Resume and Run/Step Buttons
  152.  
  153. # Pause/Resume Section
  154.  
  155. net pause-resume-btn and2.1.in0 and2.1.in0 <= input.0.btn-back
  156.  
  157. net pause-on toggle2nist.0.is-on and2.1.in1 and2.4.in1 <= halui.program.is-paused
  158.  
  159. net run-on and2.2.in1 <= halui.program.is-running
  160.  
  161. net pause-sig or2.3.in0 <= and2.1.out
  162.  
  163. net resume-sig or2.3.in1 <= and2.2.out
  164.  
  165. net toggle-ok toggle.0.in <= or2.1.out
  166.  
  167. net togglesig toggle2nist.0.in <= toggle.0.out
  168.  
  169. net toggleon halui.program.pause <= toggle2nist.0.on
  170.  
  171. net toggleoff halui.program.resume <= toggle2nist.0.off
  172.  
  173. # Run/Step Section
  174.  
  175. net run-step-btn and2.3.in0 and2.4.in0 <= input.0.btn-start
  176.  
  177. net idle-on and2.3.in1 <= halui.program.is-idle
  178.  
  179. # net pause.on and 2.4.in1 <= halui.program.is-paused
  180.  
  181. # and2.4.in1 was added in the net pause-on statement in Pause/Resume Section
  182.  
  183. net run-sig halui.mode.auto halui.program.run <= and2.3.out
  184.  
  185. net step-sig halui.program.step <= and2.4.out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement