Problem to run a program with external cycle start

More
05 Jan 2011 16:26 #6442 by ioiotutu
Hi,
i have added a second parallel port to my cnc to have cycle start, cycle stop button.

My hardware connects the start button to pin 10, stop button to pin 12 and resume button to pin 13.

I have these lines on my configuration file:

#Hal lines
net remrun halui.program.run <= parport.1.pin-10-in
net remstart halui.program.pause <= parport.1.pin-12-in
net remstop halui.program.resume <= parport.1.pin-13-in
#

If I run program with a play key on AXIS gui the stop and resume button work ok, but if i try to start the program with the external button (remstart) i have an error message: command not accepted in manual mode.

Is it possible run a program with external button like play button in AXIS gui?

Thanks.

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

More
05 Jan 2011 16:37 #6444 by andypugh
I think the button also needs to set halui.mode.auto at the same time.
linuxcnc.org/docs/html/gui_halui.html

You might even need a delay function to make sure that mode.auto is set prior to program-run.

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

More
05 Jan 2011 16:58 #6445 by ioiotutu
Thanks,
I builded a pyvcp key to set halui.mode.auto. If i press pyvcp button and then the remote start button the program run fine.

How can i build a delay in hal?

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

More
05 Jan 2011 17:33 #6446 by andypugh
You might not need the delay. What happens if you just add halui.mode.auto to the same "net" line in the HAL file as the program run?

If that doesn't work then I can explain how to add a delay, but there is no point if it is not needed.

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

More
05 Jan 2011 18:13 #6448 by ioiotutu
I modified my line in this way:

#Hal lines
net remrun halui.mode.auto <= parport.1.pin-10-in
net remrun => halui.program.run
net remstart halui.program.pause <= parport.1.pin-12-in
net remstop halui.program.resume <= parport.1.pin-13-in
#

The command work fine! Many thanks.

How can i write the command on the same line?

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

More
05 Jan 2011 18:39 #6450 by andypugh
ioiotutu wrote:

net remrun halui.mode.auto <= parport.1.pin-10-in
net remrun => halui.program.run
How can i write the command on the same line?

net remrun parport.1.pin-10-in => halui.mode.auto halui.program.run

Would work. You can change the order of the pins around, and leave out the => symbol (or even put in the wrong one) if you like, the =>, <= and <=> arrows are only for human readers.

Any net command can have one signal name, one output pin and as many input pins as you need.

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

More
07 Jan 2011 07:54 #6503 by ioiotutu

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

More
17 May 2011 11:41 #9866 by czerech
sorry for digging that topic, but i have queastion about it.

I made remrun button and its work fine. Problem is, that i can in middle of the program start it from beginning.

How i can configure it to, only allow run program when machine end previous one?

regards,
Piotr

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

More
23 May 2011 17:11 #9999 by andypugh
Possibly with HAL "and2" and "not" functions.
ie, cycle-start <= pyvcp-button AND (NOT program-is-running)

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

More
24 May 2011 18:22 #10029 by piasdom
don't know what a remrun button is but i have this example you
may be able to use. it's a home x axis button. i can only use it while
nothing is running.(thanks BigJohnT) . while my program is
running, i can click it and nothing happens. hope this helps.

xml
<button>
<relief>RAISED</relief>
<halpin>"just-home-x"</halpin>
<text>"Zero X"</text>
<font>('Helvetica',16)</font>
<fg>"midnightblue"</fg>
<bd>2</bd>
</button>

custom_postgui.hal
net home-x-btn and2.0.in0 == pyvcp.just-home-x
net home-x halui.joint.0.home == and2.0.out
net hom-in-man and2.0.in1 halui.mode.is-manual

custom.hal
loadrt and2 count=10
addf and2.0 servo-thread
addf and2.1 servo-thread
addf and2.2 servo-thread
addf and2.3 servo-thread
addf and2.4 servo-thread

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

Time to create page: 0.088 seconds
Powered by Kunena Forum