Adding_Custom_MDI_Buttons - rmu75/linuxcnc-wiki GitHub Wiki
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