Assign external button to run ngc file
14 Aug 2017 18:54 #97479
by 10K
Assign external button to run ngc file was created by 10K
I have a system that runs from a touch screen. I've added a MAME game controller to give me a few buttons and joystick for some commands. I've got it all working except one thing. I'd like to be able to use a button to run my tool setter. It's on a lathe, has four switches, and can be used in either the X or Z direction, and from forward or reverse.
I have a short program that has the logic to set the probe. Is there a way to tie the execution of the program to a HAL pin, so that I can hook it to a button?
I have a short program that has the logic to set the probe. Is there a way to tie the execution of the program to a HAL pin, so that I can hook it to a button?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
17 Aug 2017 01:37 #97604
by Todd Zuercher
Replied by Todd Zuercher on topic Assign external button to run ngc file
I would think the way to do it would be by using a HaluiMDI command.
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
Please Log in or Create an account to join the conversation.
17 Aug 2017 13:38 #97623
by 10K
Replied by 10K on topic Assign external button to run ngc file
I figured that was the way to do it, but I needed the exact format. Here's what worked. My o-code is named probe_x1.ngc, the sub in the file has the same name, and it's in my SUBROUTINE_PATH directory.
In my INI file
And in my POSTGUI_HALFILE
In my INI file
[HALUI]
MDI_COMMAND=o<probe_x1> CALL
And in my POSTGUI_HALFILE
net joy-probe halui.mdi-command-00 <= input.0.btn-top2
Please Log in or Create an account to join the conversation.
Time to create page: 0.081 seconds