[Home]Adding Custom MDI Buttons

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Difference (from prior author revision) (major diff, minor diff)

Added: 15a16
POSTGUI_HALFILE = postgui.hal

Added: 29a31,33
Note:
If you wish to add more commands, then follow up MDI_COMMAND commands will appear in the postgui.hal file in halui.mdi-command-01 02 03 and so on.


Adding a custom button on your pendant to execute a MDI command

 In this example I've added a "Rapid to Home Position" button to my pyVCP panel.
 Make sure you understand what the G Codes will do before trying this!

 In your .ini file add the following lines:
 [HALUI]
 MDI_COMMAND = G0 X0 Y0 Z0

 To load the panel within axis add the following lines under the [DISPLAY] section:
 PYVCP=panel.xml

 Also, make sure you have the following line in the [HAL] section of your ini file:
 [HAL]
 HALUI=halui
 POSTGUI_HALFILE = postgui.hal 

 In your panel.xml file add the following lines:
 <button>
     <halpin>"rapid-to-home"</halpin>
     <text>"Rapid to Home"</text> 
     <font>('Fixed',16)</font>
 </button>  

 In your postgui.hal file add the following lines:
 # set up the rapid to home button
 net remote-rapid-to-home halui.mdi-command-00 <= pyvcp.rapid-to-home

 Once you test this and understand what it does you can change the input to your pendant by changing the pyvcp reference to your paraport pin.

 Note:
 If you wish to add more commands, then follow up MDI_COMMAND commands will appear in the postgui.hal file in halui.mdi-command-01 02 03 and so on.

Enjoy John

upload:remotegui.png


LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited May 2, 2010 9:13 am by Rvtinec (diff)
Search:
Published under a Creative Commons License