rodw wrote: yeh, I'd keep it all together.
This is all in my postui.tcl now ... I can verify in halshow that input01 and 02 are receiving signal from my external inputs... but they do not pause/resume plasmac.
EDIT: I created another postgui hal file and put the code in that file. I named it stopandgo.hal ... it is listed in my machine.ini file like so:
Code:
[HAL]
# required
TWOPASS = ON
# the base machine
HALFILE = mark_i.hal
# the plasmac component connections
HALFILE = ./plasmac/plasmac.tcl
# the plasma machine and custom connections
HALFILE = mark_i_connections.hal
# use this for customisation after GUI has loaded
POSTGUI_HALFILE = ddraft4x2.hal
POSTGUI_HALFILE = stopandgo.hal
# required
HALUI = halui
The stopandgo.hal contains this code:
Code:
loadrt and2 count=4
loadrt or2 count=1
loadrt toggle count=1
loadrt toggle2nist count=1
addf and2.0 servo-thread
addf and2.1 servo-thread
addf and2.2 servo-thread
addf and2.3 servo-thread
addf or2.0 servo-thread
addf toggle.0 servo-thread
addf toggle2nist.0 servo-thread
# External Program Pause/Resume and Run/Step Buttons
# Pause/Resume Section
net pause-resume-btn and2.0.in0 and2.1.in0 <= hm2_7i76e.0.7i76.0.0.input-01
net pause-on toggle2nist.0.is-on and2.0.in1 and2.3.in1 <= halui.program.is-paused
net run-on and2.1.in1 <= halui.program.is-running
net pause-sig or2.0.in0 <= and2.0.out
net resume-sig or2.0.in1 <= and2.1.out
net toggle-ok toggle.0.in <= or2.0.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.2.in0 and2.3.in0 <= hm2_7i76e.0.7i76.0.0.input-02
net and2in and2.2.in1 <= idle-on
# net pause.on and 2.3.in1 <= halui.program.is-paused
# and2.3.in1 was added in the net pause-on statement in Pause/Resume Section
net run-sig halui.mode.auto halui.program.run <= and2.2.out
net step-sig halui.program.step <= and2.3.out
The buttons are triggering a response in halshow, but plasmac does not respond.