I think I would set up a work coordinate system for each work zone. G54 would be the default zone, and say G55 could be zone 2. (You could also get the same result using G10L20P0... to sift what ever work coordinate system your using.)
Then set up two Halui MDI-commands in your INI file. like this
Code:
[HALUI]
MDI_COMMAND = G54
MDI_COMMAND = G55
Now this is the trickier part. You need your button presses to do two things, first trigger the pin halui.mdi-command-NN, then trigger the pin halui program.run.
I think the best way to do that would be with some edge components and one or2.
Code:
loadrt edge count=3
loadrt or2 count=1
addf edge.0 servo-thread
addf edge.1 servo-thread
addf edge.2 servo-thread
addf or2.0 servo-thread
setp edge.0.both false
setp edge.1.both false
setp edge.2.both false
setp edge.0.in-edge true
setp edge.1.in-edge false
setp edge.2.in-edge false
setp edge.0.out-width-ns 1000000
setp edge.1.out-width-ns 1000000
setp edge.2.out-width-ns 1000000
net program-start-btn1 <= hm2_5i25.0.7i76.0.0.input-04 => edge.1.in => or2.0.in0
net setg54 <= edge.1.out => halui.mdi-command-00
net program-start-btn2 <= hm2_5i25.0.7i76.0.0.input-08 => edge.2.in => or2.0.in1
net setg55 <= edge.2.out => halui.mdi-command-02
net run-or <= or2.0.out => edge.0.in
net program-run <= edge.0.out => halui.program.run
The problem with this setup is that it breaks down if your G-code uses multiple work coordinate systems. I think This could be worked around with some O-subroutines, but it would be more complicated, and I'd have to think about quite a bit and do some testing.
PS the above hal code was just typed here and is untested, mostly just given as a possible example.