Assign external button to run ngc file

  • 10K
  • 10K's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
14 Aug 2017 18:54 #97479 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?

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

  • Todd Zuercher
  • Todd Zuercher's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
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

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

  • 10K
  • 10K's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
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
[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.062 seconds
Powered by Kunena Forum