Cycle Start / Pause / Resume-Button
07 Nov 2015 01:21 #64925
by DaPeace
Cycle Start / Pause / Resume-Button was created by DaPeace
Hey Guys,
im using one single button to pause/resume at the moment.
Is it possible to use that one button to start the program too?
I did not really found any source how i could add a 3rd check for halui.program.is-idle
At the moment my config looks like that:
# External Program Pause/Resume Button
net pause-resume-btn and2.0.in0 and2.1.in0 <= parport.0.pin-10-in
net pause-on toggle2nist.0.is-on and2.0.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
im using one single button to pause/resume at the moment.
Is it possible to use that one button to start the program too?
I did not really found any source how i could add a 3rd check for halui.program.is-idle
At the moment my config looks like that:
# External Program Pause/Resume Button
net pause-resume-btn and2.0.in0 and2.1.in0 <= parport.0.pin-10-in
net pause-on toggle2nist.0.is-on and2.0.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
Please Log in or Create an account to join the conversation.
07 Nov 2015 16:22 #64953
by Rick G
Replied by Rick G on topic Cycle Start / Pause / Resume-Button
Seems more common to use 2 buttons for this...
linuxcnc.org/index.php/english/forum/47-...p-holdresume-buttons
As you said you would need a new layer of checks to determine what the output of hitting the button would do, you could follow the logic you are using.
So as you said if the program is idle and the program is not paused run the program.
linuxcnc.org/docs/html/hal/halui_examples.html
Rick G
linuxcnc.org/index.php/english/forum/47-...p-holdresume-buttons
As you said you would need a new layer of checks to determine what the output of hitting the button would do, you could follow the logic you are using.
So as you said if the program is idle and the program is not paused run the program.
linuxcnc.org/docs/html/hal/halui_examples.html
Rick G
Please Log in or Create an account to join the conversation.
09 Nov 2015 15:55 #65019
by andypugh
Replied by andypugh on topic Cycle Start / Pause / Resume-Button
One moderately tidy way to do this would be with a lut5 for each of run / pause / resume
Connect the button to one input of the LUT5 (probably 0) then add the various preconditions to the other inputs, and set up the output to drive the required halui pin.
Connect the button to one input of the LUT5 (probably 0) then add the various preconditions to the other inputs, and set up the output to drive the required halui pin.
Please Log in or Create an account to join the conversation.
09 Nov 2015 16:00 #65021
by DaPeace
Replied by DaPeace on topic Cycle Start / Pause / Resume-Button
I got the following solution for the moment. Maybe its a help for other people. Did not find a good example via google. Thanks to the Linuxcnc-irc-chat
Only problem is, that i use the halui.programm.is-idle already and cant really figure out how to use that signal twice..
any hints?
loadrt flipflop names=flipflop_resume,flipflop_pause,flipflop_run
addf flipflop_resume servo-thread
addf flipflop_pause servo-thread
addf flipflop_run servo-thread
net button-start-pause BUTTONPIN => flipflop_pause.clk flipflop_resume.clk flipflop_run.clk
net is-paused halui.program.is-paused => flipflop_resume.data flipflop_pause.reset
net is-running halui.program.is-running => flipflop_pause.data flipflop_run.reset flipflop_resume.reset
net is-idle halui.program.is-idle => flipflop_run.data
net resume flipflop_resume.out => halui.program.resume
net pause flipflop_pause.out => halui.program.pause
net run flipflop_run.out => halui.mode.auto halui.program.run
Only problem is, that i use the halui.programm.is-idle already and cant really figure out how to use that signal twice..
any hints?
loadrt flipflop names=flipflop_resume,flipflop_pause,flipflop_run
addf flipflop_resume servo-thread
addf flipflop_pause servo-thread
addf flipflop_run servo-thread
net button-start-pause BUTTONPIN => flipflop_pause.clk flipflop_resume.clk flipflop_run.clk
net is-paused halui.program.is-paused => flipflop_resume.data flipflop_pause.reset
net is-running halui.program.is-running => flipflop_pause.data flipflop_run.reset flipflop_resume.reset
net is-idle halui.program.is-idle => flipflop_run.data
net resume flipflop_resume.out => halui.program.resume
net pause flipflop_pause.out => halui.program.pause
net run flipflop_run.out => halui.mode.auto halui.program.run
Please Log in or Create an account to join the conversation.
09 Nov 2015 17:06 #65023
by andypugh
so,
Replied by andypugh on topic Cycle Start / Pause / Resume-Button
You can use the is-idle HAL signal anywhere you want that status.Only problem is, that i use the halui.programm.is-idle already and cant really figure out how to use that signal twice..
...
net is-idle halui.program.is-idle => flipflop_run.data
so,
net is-idle => some_other_hal_pin
Please Log in or Create an account to join the conversation.
Time to create page: 0.066 seconds