-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom_postgui.hal
More file actions
53 lines (41 loc) · 2.01 KB
/
custom_postgui.hal
File metadata and controls
53 lines (41 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Benutzerdefinierte HAL-Anweisungen können nachfolgend angegeben werden
# Die Befehle in dieser Datei werden nach der AXIS GUI (und PyVCP-Panel) ausgeführt.
sets spindle-at-speed true
loadrt or2 count=2
loadrt mux4 count=1
addf or2.0 servo-thread
addf or2.1 servo-thread
addf mux4.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 100
setp mux4.0.in2 200
setp mux4.0.in3 800
# the following does the magic of setting the jog speeds
net remote-speed-slow or2.0.in0 input.0.btn-tl
net remote-speed-medium or2.1.in0 input.0.btn-tr
net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-z
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
net joy-x-jog halui.jog.0.analog <= input.0.abs-x-position
net joy-y-jog halui.jog.1.analog <= input.0.abs-y-position
net joy-z-jog halui.jog.2.analog <= input.0.abs-rz-position
setp input.0.abs-y-scale -127.5
setp input.0.abs-rz-scale -127.5
# Taste 4 Spindel ein, Taste 3 Spindel aus
net JoypadSpindleStart input.0.btn-x => halui.spindle.start
net JoypadSpindleStop input.0.btn-c => halui.spindle.stop
# net JoypadPorgramPause input.0.btn-tr2 => halui.program.pause
# halui.program.run
loadrt flipflop names=flipflop_resume,flipflop_pause,flipflop_run
addf flipflop_resume servo-thread
addf flipflop_pause servo-thread
addf flipflop_run servo-thread
net button-start-pause input.0.btn-tr2 => flipflop_pause.clk flipflop_resume.clk flipflop_run.clk
net is-paused halui.program.is-paused => flipflop_resume.data flipflop_pause.reset
net is-running halui.program.is-running => flipflop_pause.data flipflop_run.reset flipflop_resume.reset
net is-idle halui.program.is-idle => flipflop_run.data
net resume flipflop_resume.out => halui.program.resume
net pause flipflop_pause.out => halui.program.pause
net run flipflop_run.out => halui.mode.auto halui.program.run