To save anyone else a bit of work, here's a patch file for 2.5.3 Axis to implement set-mdi-mode.
This patch also implements an axisui output pins that reflects the current manual/mdi tab. I did this so that I could use one button on my pendant to flip between Manual and MDI modes using the toggle2nist hal thingie.
Download
the patch from here
, save a copy of /usr/bin/axis and then do:
Code:
patch /usr/bin/axis </path-to-the-downloaded-patch/axis.2.5.3.mdi.mode.patch
To make use of the above from an xhc pendant, add the following to custom_postgui.hal
Code:
net tog_mode xhc-hb04.button-mode => toggle.N.in
net tog_mode_out toggle.N.out => toggle2nist.N.in
net is_mode_mdi axisui.mode.mdi => toggle2nist.N.is-on
net flip_to_mdi toggle2nist.N.on => axisui.set-mdi-mode
net flip_to_manual toggle2nist.N.off => axisui.set-manual-mode
...changing 'xhc-hb04.button-mode' to the button of your choice and 'N' on each line to the toggle and toggle2nist numbers you want to use.
If you don't have a 'spare' toggle or toggle2nist then check in custom.hal for lines like 'loadrt toggle count=2' and 'addf toggle.2 xxx-thread' and add another toggle and toggle2nist.
HtH.