how to pause program through input pin?

More
23 Jan 2018 14:40 - 23 Jan 2018 14:41 #104889 by IrishMoss
Hi, HAL noob here. :)

I'm trying to initiate a program pause in my setup, though one of the input pins.
I have a tb6560 variant, and have already successfully configured a limit/home switch through one of the input pins, so I know they work on the board.

I currently have pin 12 connected to a relay switch, and I'd like the program to pause when the relay opens.
Here's what I've added to my hal file:
net halui.program.pause <= parport.0.pin-12-in
(i've also tried it inverted with 'pin-12-in-not', and it didn't help)

Unfortunately, when the relay triggers, nothing happens.
I'm sure I'm missing something obvious. Is there something additional i need to add to the ini to make this work?

Thanks.
Last edit: 23 Jan 2018 14:41 by IrishMoss.

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

More
23 Jan 2018 15:21 #104891 by skunkworks
Are you sure that is your exact line? Net format is
net signal pin pin pin and so on.

It would be something like
net pause halui.program.pause parport.0.pin-12.in

could we see your hal file?

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

More
23 Jan 2018 15:55 #104893 by IrishMoss
I'm attaching my HAL file, but there's no references to that pin in it. I've been putting the changes in the custom.hal file, and it only had that one line.
I thought I needed "net halui.program.pause <= parport.0.pin-12-in" to reference the pause operation to pin 12
I replaced it with "net pause halui.program.pause parport.0.pin-12.in", but then linuxcnc bombs out with:
./custom.hal:6: Pin 'halui.program.pause' does not exist

I know I'm missing something obvious here, as I've only just started dipping into this custom hal stuff.
Attachments:

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

More
23 Jan 2018 16:06 #104894 by skunkworks
Great - so I think what you are missing is the

HALUI = halui in the [hal] section of your ini file.

linuxcnc.org/docs/2.6/html/config/ini_co...id_sub_hal_section_a

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

More
23 Jan 2018 16:32 #104897 by IrishMoss
wow, that was a lot easier than expected. I knew it was something simple. ;)
The past few weeks have been like drinking cnc information from a firehose! But it's oh so satisfying when you get things working the way you want. :)

Thanks for the help!

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

More
10 Mar 2018 21:32 #107198 by davidcnc
New client. I currently comand a hydraulic cylinder to move. Then next line G4 P2.5 then the next line completes the next operation.
In your answer I thought why not use 2p micro, switching states, at end of travel going in to pin 12.

Would the following work???

net pause hauli.program.pause parport.0.pin-12-in ( to replace G4 Pxxxx)
# at end of travel & state change.
net pause hauli.program.pause parport.0.pin-12-in-not (continue program execution)
Dave N.

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

More
10 Mar 2018 23:49 - 10 Mar 2018 23:56 #107202 by Grotius
net pause        hauli.program.pause    parport.0.pin-12-in 
net pause        hauli.program.pause    parport.0.pin-12-in-not

This will end in a tiny bug. Explenation required :
You can not use your "pause" in different configuration's
It has one explenation : or pin 12 high, or pin 12 low. High and low at the same time is not possible, unless you
are expecting an electrical failure.:silly:

net pause         hauli.program.pause    parport.0.pin-12-in 
net pause-not     hauli.program.pause    parport.0.pin-12-in-not

Will end in a tiny succes without bug. In this way you have a "net pause" and a "net pause-not"
It separates the high and low value. Next item for you is to use this names in your program code.
Last edit: 10 Mar 2018 23:56 by Grotius.
The following user(s) said Thank You: davidcnc

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

Time to create page: 0.073 seconds
Powered by Kunena Forum