Run/Step Hold/Resume Buttons

More
5 years 4 months ago #211003 by txtrone

BigJohnT wrote: 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


I pasted this into my machine.hal file (edited it to add my inputs) and it spit this error:
Code:
twopass: Error in file ././plasmac/plasmac.tcl: Pin 'halui.program.is-idle' was already linked to signal 'idle-on'

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #211009 by bevins
Replied by bevins on topic Run/Step Hold/Resume Buttons

txtrone wrote:

BigJohnT wrote: 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. and it spit this error:

Code:
twopass: Error in file ././plasmac/plasmac.tcl: Pin 'halui.program.is-idle' was already linked to signal 'idle-on'


Thats because program.is-idl;e signal is being used elsewhere by plasmac and you cant hijack it.
You can try to integrate it with plasmac, but that requires you to know the ins and outs of plasmac.
Plasmac is already doing what you want to do in the gui.

Last edit: 5 years 4 months ago by bevins.

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #211016 by txtrone

bevins wrote:

txtrone wrote:

BigJohnT wrote: 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. and it spit this error:

Code:
twopass: Error in file ././plasmac/plasmac.tcl: Pin 'halui.program.is-idle' was already linked to signal 'idle-on'


Thats because program.is-idl;e signal is being used elsewhere by plasmac and you cant hijack it.
You can try to integrate it with plasmac, but that requires you to know the ins and outs of plasmac.
Plasmac is already doing what you want to do in the gui.


I am trying to add an external pause/resume button.

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #211018 by bevins
Replied by bevins on topic Run/Step Hold/Resume Buttons

txtrone wrote:

bevins wrote:

txtrone wrote:

BigJohnT wrote: 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. and it spit this error:

Code:
twopass: Error in file ././plasmac/plasmac.tcl: Pin 'halui.program.is-idle' was already linked to signal 'idle-on'


Thats because program.is-idl;e signal is being used elsewhere by plasmac and you cant hijack it.
You can try to integrate it with plasmac, but that requires you to know the ins and outs of plasmac.
Plasmac is already doing what you want to do in the gui.


I am trying to add an external pause/resume button.


Yes but there is already pause resume being used by plasmac in the gui. You have to make it coexist.

Last edit: 5 years 4 months ago by bevins.

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #211019 by rodw
Replied by rodw on topic Run/Step Hold/Resume Buttons
Plasmac is quite difficult to extend becasue it uses so many pins but I think you should place this code in the postgui file.

try replacing
Code:
net idle-on and2.2.in1 <= halui.program.is-idle
with
Code:
net and2in and.2.2.in1 <= idle-on

Any example like this usually needs some massaging to fold into your config. I implemented this well before Plasmac existed and had similar issues.
Last edit: 5 years 4 months ago by rodw.
The following user(s) said Thank You: txtrone

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #211020 by txtrone

rodw wrote: Plasmac is quite difficult to extend becasue it uses so many pins but I think you should place this code in the postgui file.

try replacing

Code:
net idle-on and2.2.in1 <= halui.program.is-idle
with
Code:
net and2in and.2.2.in1 <= idle-on

Any example like this usually needs some massaging to fold into your config. I implemented this well before Plasmac existed and had similar issues.


Rod - Does all of the code I originally posted belong in my postgui?

Please Log in or Create an account to join the conversation.

Moderators: snowgoer540
Time to create page: 0.339 seconds
Powered by Kunena Forum