#Pause/Resume pauses and continues running the program. while in Pause mode pressin the Run/Step button #steps through the program one step at a time until Pause Resume is pressed which then continues #running the program. #create signals to show which axis is selected net xisselected axisui.jog.x => parport.1.pin-02-out net yisselected axisui.jog.y => parport.2.pin-04-out net zisselected axisui.jog.z => parport.0.pin-03-out #jensor from ichguckslive add joypad. All program below custom interfaces the joypad. # Joypad name is MY-POWER (found only in dmesg) #This command is in my pinout.hal: loadusr -W hal_input MY-POWER loadrt or2 count=4 loadrt mux8 count=1 loadrt toggle count=2 loadrt not count=1 loadrt and2 count=6 loadrt toggle2nist count=2 loadrt debounce cfg=5 addf or2.0 servo-thread addf or2.1 servo-thread addf or2.2 servo-thread addf or2.3 servo-thread addf mux8.0 servo-thread addf toggle.0 servo-thread addf toggle.1 servo-thread addf not.0 servo-thread addf and2.0 servo-thread addf and2.1 servo-thread addf and2.2 servo-thread addf and2.3 servo-thread addf and2.4 servo-thread addf and2.5 servo-thread addf toggle2nist.0 servo-thread addf toggle2nist.1 servo-thread addf debounce.0 servo-thread setp debounce.0.delay 5 # set the jog speed for the joypad again use numbers that make sense for your machine # this one must be 0 to prevent motion unless a button is pressed setp mux8.0.in0 0 setp mux8.0.in1 .2 setp mux8.0.in2 1 setp mux8.0.in3 5 setp mux8.0.in4 40 setp mux8.0.in5 0 setp mux8.0.in6 0 setp mux8.0.in7 0 # the following does the magic of setting the jog speeds #Count net remote-speed-slow input.0.btn-joystick => or2.0.in0 #or2.0 net remote-speed-medium input.0.btn-thumb => or2.1.in0 #or2.1 net remote-speed-fast input.0.btn-thumb2 => or2.1.in1 or2.0.in1 #Connect or2 outputs to appropriate selinput pins of mux8.0 net joy-speed-1 or2.0.out => mux8.0.sel0 net joy-speed-2 or2.1.out => mux8.0.sel1 net joy-speed-3 input.0.btn-top => mux8.0.sel2 net joy-speed-final mux8.0.out => halui.jog-speed #Connect joypad pins to halui in pins net joy-xpos-jog input.0.abs-x-is-pos => halui.jog.0.plus net joy-xneg-jog input.0.abs-x-is-neg => halui.jog.0.minus net joy-ypos-jog input.0.abs-y-is-neg => halui.jog.1.plus net joy-yneg-jog input.0.abs-y-is-pos => halui.jog.1.minus net joy-zpos-jog input.0.abs-rz-is-pos => halui.jog.2.minus net joy-zneg-jog input.0.abs-rz-is-neg => halui.jog.2.plus # Pause/Resume Button Section net pause-resume-btn input.0.btn-base4 => debounce.0.0.in #debounce.0.0 net pause-resume-btnd debounce.0.0.out and2.0.in0 and2.1.in0 #and2.0 net pause-on toggle2nist.0.is-on and2.0.in1 <= halui.program.is-paused #and2.1 net run-on and2.1.in1 <= halui.program.is-running net pause-sig or2.2.in0 <= and2.0.out #or2.2 net resume-sig or2.2.in1 <= and2.1.out net toggle-ok toggle.0.in <= or2.2.out net togglesig toggle2nist.0.in <= toggle.0.out #toggle2nist.0 net toggleon halui.program.pause <= toggle2nist.0.on net toggleoff halui.program.resume <= toggle2nist.0.off # Run Program Button Section net run-step-btn input.0.btn-base3 => debounce.0.1.in #debounce.0.1 net run-step-btnd debounce.0.1.out => and2.2.in0 and2.3.in0 #and2.2 net idle-on and2.2.in1 <= halui.program.is-idle #and2.3 net run-sig halui.mode.auto halui.program.run <= and2.2.out net pause-on and2.3.in1 # This signal was named in 1BPpinout.hal net pgm-step and2.3.out <= halui.program.step #Estop Toggle Button Activated/Rest - btn-base5 or btn-base6 net Estopb5 input.0.btn-base5 => debounce.0.2.in #debounce.0.2 net Estopb6 input.0.btn-base6 => debounce.0.3.in #debounce.0.3 net E5d debounce.0.2.out => or2.3.in0 #or2.3 net E6d debounce.0.3.out => or2.3.in1 net EstopCmd or2.3.out => and2.4.in1 and2.5.in1 #and2.4 net estopactivated and2.4.in0 not.0.in #and2.5 net estop-reset and2.4.out <= halui.estop.reset net Esis-act-not not.0.out => and2.5.in0 net estop-activate and2.5.out => halui.estop.activate #Machine Toggle On/Off Button - btn-top2 net machine input.0.btn-top2 => debounce.0.4.in #debounce.0.4 net machined debounce.0.4.out => toggle.1.in net togout toggle.1.out => toggle2nist.1.in #toggle2nist.1 net machineon toggle2nist.1.is-on # This signal was named in 1BPpinout.hal net tog0 toggle2nist.1.on => halui.machine.on net tog1 toggle2nist.1.off => halui.machine.off #Program Stop - btn-pinkie # works, but sometimes get error net stop input.0.btn-pinkie => halui.program.stop