Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Include your customized HAL commands here
- # The commands in this file are run after the AXIS GUI (including PyVCP panel) starts
- loadrt or2 count=3
- loadrt mux4 count=1
- loadrt scale count=3
- loadrt and2 count=5
- loadrt toggle count=1
- loadrt toggle2nist count=1
- addf or2.0 servo-thread
- addf or2.1 servo-thread
- addf mux4.0 servo-thread
- addf scale.0 servo-thread
- addf scale.1 servo-thread
- addf scale.2 servo-thread
- addf and2.0 servo-thread
- #for start/stop/resume
- addf and2.1 servo-thread
- addf and2.2 servo-thread
- addf and2.3 servo-thread
- addf and2.4 servo-thread
- addf or2.3 servo-thread
- addf toggle.0 servo-thread
- addf toggle2nist.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 150
- setp mux4.0.in2 500
- setp mux4.0.in3 1500
- setp scale.0.gain -1
- setp scale.1.gain -1
- setp scale.2.gain -1
- # the following does the magic of setting the jog speeds
- net remote-speed-slow or2.0.in0 input.0.btn-x
- net remote-speed-medium or2.1.in0 input.0.btn-y
- net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-b
- 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
- #6. Step 6 Set up the Axis
- #Add the following to your postgui.hal file
- net reverse-x scale.0.in <= input.0.abs-x-position
- net jog-x halui.jog.0.analog <= scale.0.out
- net reverse-y scale.1.in <= input.1.abs-y-position
- net jog-y halui.jog.1.analog <= scale.1.out
- net reverse-ry scale.2.in <= input.2.abs-ry-position
- net jog-ry halui.jog.2.analog <= scale.2.out
- # Call touch off
- net touchzbutton1 and2.0.in0 <= input.0.btn-tl
- net touchzbutton2 and2.0.in1 <= input.0.btn-tr
- net touch-z and2.0.out => halui.mdi-command-00
- # External Program Pause/Resume and Run/Step Buttons
- # Pause/Resume Section
- net pause-resume-btn and2.1.in0 and2.1.in0 <= input.0.btn-back
- net pause-on toggle2nist.0.is-on and2.1.in1 and2.4.in1 <= halui.program.is-paused
- net run-on and2.2.in1 <= halui.program.is-running
- net pause-sig or2.3.in0 <= and2.1.out
- net resume-sig or2.3.in1 <= and2.2.out
- net toggle-ok toggle.0.in <= or2.1.out
- net togglesig toggle2nist.0.in <= toggle.0.out
- net toggleon halui.program.pause <= toggle2nist.0.on
- net toggleoff halui.program.resume <= toggle2nist.0.off
- # Run/Step Section
- net run-step-btn and2.3.in0 and2.4.in0 <= input.0.btn-start
- net idle-on and2.3.in1 <= halui.program.is-idle
- # net pause.on and 2.4.in1 <= halui.program.is-paused
- # and2.4.in1 was added in the net pause-on statement in Pause/Resume Section
- net run-sig halui.mode.auto halui.program.run <= and2.3.out
- net step-sig halui.program.step <= and2.4.out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement