I just checked the machine and how it is operating. I've been away from it for the last 2 weeks, so I got some of my details wrong in previous posts. I've had so many versions of this HAL file that I wasn't able to keep its behavior straight in my head!
It starts with the start button as it should.
It stops with the part unloaded switch like it should.
It won't start if a part is not loaded.
It restarts from the beginning of the program with the start button.
It occasionally has the ""can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter idle" error which apparently only happens on interpolated moves.
Basically, I'm happy with it. It could be better, but the colleague that I'm building it for is happy with it and I can't spend much more time on it.
Here's my HAL file:
Code:
loadrt and2 count=2
loadrt or2 count=1
addf and2.0 servo-thread
addf and2.1 servo-thread
addf or2.0 servo-thread
# External Program Pause and Run Buttons
# Run Section
net run-step-btn or2.0.in0 and2.1.in0 <= parport.0.pin-13-in
net pause-on and2.1.in1 <= halui.program.is-paused
net my-or1 or2.0.in1 <= and2.1.out
net run-sig halui.mode.auto halui.program.run <= or2.0.out
# Pause Section
net pause-resume-btn and2.0.in0 <= parport.0.pin-15-in-not
net run-on and2.0.in1 <= halui.program.is-running
net pause-sig halui.program.stop <= and2.0.out
setp halui.mode.teleop 1