How to right sequence run - pause -stop
I use external button for START and STOP programm.
To start programm I use the same HAL code:
net strob-auto <= halui.mode.is-auto => not.5.in
net strob-auto-not <= not.5.out
net is-home-x <= halui.joint.0.is-homed => and2.6.in0
net is-home-z <= halui.joint.2.is-homed => and2.6.in1
net is-home-out <= and2.6.out => and2.7.in0
net start-program-btn <= hm2_5i20.0.gpio.032.in_not => and2.7.in1
net start-program <= and2.7.out
net start-program => and2.5.in0
net strob-auto-not => and2.5.in1
#set auto mode
net set-auto <= and2.5.out
net set-auto => halui.mode.auto
#set oneshot impulse length = 2 sec
setp oneshot.1.width 2
#make impulse lenth 2 sec
net set-auto => oneshot.1.in
net start-program-out => oneshot.1.out
net start-program-out => halui.program.run
but to stop the programm, i send pause first, and after thet the stop signal, but error message appears
here is my code:
net is-running <= halui.program.is-running
net is-paused <= halui.program.is-paused
net is-idle <= halui.program.is-idle
net stop-program-btn <= hm2_5i20.0.gpio.033.in_not => and2.8.in0
net is-running => and2.8.in1
net stop-program <= and2.8.out => halui.program.pause
net is-idle => not.6.in
net is-idle-not <= not.6.out => and2.9.in0
net is-paused => and2.9.in1
net is-stop <= and2.9.out => halui.program.stop
What I need to do to stop programm clear?
Please Log in or Create an account to join the conversation.
However, you can probably investigate it by using the command line.
If you open a new terminal while emc2 is running you can type commands like
halcmd setp halui.program.run 1
And experiment with the correct sequencing.
You can also do this from the machine->show hal config window, but:
1) That window doesn't allow tab completion or history (up-arrow) so is rather more tedious.
2) You can's see the text box with the "Watch" window open, and you probably want that open to see what is going on.
Alternatively (and this is even more work) you could create a pycvp panel with checkboxes for the command pins and LEDs for the status pins.
If you do figure it all out, or if you find that there is a definite error (I am sure it used to be easier) then please document it, or post a bug report.
Please Log in or Create an account to join the conversation.
# External Program Run Button
net program-run-btn halui.mode.auto <= hm2_5i20.0.gpio.031.in_not
net program-run-btn and2.2.in0
net program-is-auto and2.2.in1 <= halui.mode.is-auto
net remote-prg-run halui.program.run <= and2.2.out
I don't think it is as clear as it could be, but if your running you can't set halui.program.run to true or you get an error.
Stop is simpler, simply set halui.program.stop true to stop a program.
A pause/resume button just needs to check the current state of is-paused and is-running.
John
Please Log in or Create an account to join the conversation.
Not soThis is my external Run button
Stop is simpler, simply set halui.program.stop true to stop a program.
A pause/resume button just needs to check the current state of is-paused and is-running.
John
I use pyvcp to test.
Here is code example:
net prog-stop <= pyvcp.prog-stop => halui.program.stop
after the press "stop" button the message:
cannot do it
(EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with stopped interpr..
and the EMC stay in AUTO mode. None key accepted till I press F5 to switch to MDI mode and back to F3 mode.
The solution you sujested not work. What did I wrong?
Please Log in or Create an account to join the conversation.
net pyvcp-stop halui.program.stop <= pyvcp.stop-button
my xml file
<pyvcp>
<button>
<halpin>"run-button"</halpin>
<text>"Program Start"</text>
</button>
<button>
<halpin>"stop-button"</halpin>
<text>"Program Stop"</text>
</button>
</pyvcp>
Each time I start Axis with the run button on axis I can stop it with no problem with the pyvcp stop button.
John
Please Log in or Create an account to join the conversation.
# External Run Button
loadrt and2 count=1
addf and2.0 servo-thread
net pyvcp-auto halui.mode.auto and2.0.in1 <= pyvcp.run-button
net is-auto and2.0.in0 <= halui.mode.is-auto
net pyvcp-run halui.program.run <= and2.0.out
# External Stop Button
net pyvcp-stop halui.program.stop <= pyvcp.stop-button
You might have to hold the run button for a second to allow time for is-auto to come back as the mode.auto pin is a request not a demand.
John
Please Log in or Create an account to join the conversation.
I assign the time delay 1 sec after the pause and befor the stop pressed
################
# stop program #
################
net is-running <= halui.program.is-running
net is-running => and2.0.in0
net prog-stop-btn <= pyvcp.prog-stop
net prog-stop-btn => and2.0.in1
net set-pause <= and2.0.out => halui.program.pause
setp timedelay.1.on-delay 1
setp timedelay.1.off-delay 0
net strob-pause <= halui.program.is-paused => timedelay.1.in
net prog-stop <= timedelay.1.out => halui.program.stop
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.
Because if I send true to hului.program.stop, then the message apeears:Why do you pause then stop?
John
cannot do it
(EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with stopped interpr..
and the EMC will stop in auto mode!
I have to switch it in manual mode by pressing F5(MDI) then F3(man mode) in AXIS interface.
May be it's EMC internal bug, but I use 2.4.6 version with ubuntu 10.x, in 8.04 is the same problem.
Please Log in or Create an account to join the conversation.
If your not running any special hardware like mesa or pico can you zip up your config and attach it to a message?
John
Please Log in or Create an account to join the conversation.