NEWS
LinuxCNC 2.5.2 Release
There are no translations available.

LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release
There are no translations available.

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
There are no translations available.

New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 
Home Forum HAL HAL Examples Run/Step Hold/Resume Buttons

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Run/Step Hold/Resume Buttons

Run/Step Hold/Resume Buttons 14 Сен 2011 07:33 #13201

  • BigJohnT
  • BigJohnT's Avatar
  • NOW ONLINE
  • Administrator
  • Posts: 4950
  • Thank you received: 85
  • Karma: 134
fgauder wrote:
I have to say,it is nice to be able to tell your machine how to run instead of having to learn to or get used to running a machine someone else has configured. I am sold on EMC.

In the original post on this thread, I proposed 2 buttons, one a Run/Step and the other a Pause/Resume. The controller I converted from had those 2 buttons close to an e-stop and until a program was proved out, 2 fingers stayed on them.

Thanks to John and Andy, I got my Pause/Resume button. I did a little work on my own and was able to get the Run/Step button (admittedly the far easier). So, for what it's worth, here is the program for both buttons:

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_5i20.0.gpio.027.in_not (this is your input)
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_5i20.0.gpio.026.in_not (this is your input)
net idle-on and2.2.in1 <= halui.program.is-idle
# 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

This is how they function:

Pressing Run/Step will begin executing a program.

Pressing Hold/Resume while a program is running will pause the program.

Pressing Run/Step while a program is paused will single step the program.

Pressing Hold/Resume while a program is paused will return it to normal run mode.

I hope this thread is of some help to someone.

Frank
Last Edit: 14 Сен 2011 07:34 by BigJohnT.
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 1.408 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.