Halui is always set in postgui_hal files
you can mux your speed together so more presses on the Button will give you up to 8Speeds
you can display this so you always see the Speed set in a pyvcp or glade view
Code:
# jog Speed
loadrt mux8 count=2
addf mux8.0 servo-thread
addf mux8.1 servo-thread
#wheel speed per tick
setp mux8.0.in0 0
setp mux8.0.in1 0.1
setp mux8.0.in2 0.5
setp mux8.0.in3 0
setp mux8.0.in4 1
#speed for moving axes
setp mux8.1.in0 0 # this one must be 0 to prevent motion unless a button is pressed
setp mux8.1.in1 250
setp mux8.1.in2 1000
setp mux8.1.in3 0
setp mux8.1.in4 2500
# step logic
loadrt updown count=1
addf updown.0 servo-thread
setp updown.0.wrap true
setp updown.0.min 0
setp updown.0.max 6
net stepcount updown.0.countup <= xhc-hb04.button-step => xhc-hb04.stepsize-up
#reset step to zero
net updownreset updown.0.reset <= click_mode.single-click
#convert count s32 to float
loadrt conv_s32_float count=1
addf conv-s32-float.0 servo-thread
net conv-step conv-s32-float.0.in updown.0.count
#step signal compare
loadrt comp count=7
addf comp.0 servo-thread
addf comp.1 servo-thread
addf comp.2 servo-thread
addf comp.3 servo-thread
addf comp.4 servo-thread
addf comp.5 servo-thread
addf comp.6 servo-thread
setp comp.0.in0 0
setp comp.1.in0 1
setp comp.2.in0 2
setp comp.3.in0 3
setp comp.4.in0 4
setp comp.5.in0 5
setp comp.6.in0 6
loadrt or2 count=5
addf or2.0 servo-thread
addf or2.1 servo-thread
addf or2.2 servo-thread
addf or2.3 servo-thread
addf or2.4 servo-thread
net stepcounter-out conv-s32-float.0.out => comp.0.in1 comp.1.in1 comp.2.in1 comp.3.in1 comp.4.in1 comp.5.in1 comp.6.in1
#jog scale selector from step to mux
net scale-selectorA mux8.0.sel0 <= comp.1.equal => or2.0.in0
net scale-selectorB mux8.0.sel1 <= comp.2.equal => or2.0.in1
net scale-selectorC mux8.0.sel2 <= comp.3.equal => or2.1.in0
net led-wheel-sectorA or2.1.in1 <= or2.0.out
# postgui net pyvc-led-wheel or2.1.out => pyvcp.wheel_select
net jog-scale mux8.0.out => axis.0.jog-scale axis.1.jog-scale axis.2.jog-scale axis.3.jog-scale
net joy-speed-1 mux8.1.sel0 <= comp.4.equal => or2.2.in0
net joy-speed-2 mux8.1.sel1 <= comp.5.equal => or2.2.in1
net joy-speed-3 mux8.1.sel2 <= comp.6.equal => or2.3.in0
net led-button-sectorA or2.3.in1 <= or2.2.out
# postgui net pyvc-led-button or2.3.out => pyvcp.button_select
net joy-speed-final halui.jog-speed <= mux8.1.out