After a bit more testing, I think I can see what it's doing.
If you just launch Mach4 and turn on the pendant, if the X-axis is selected for example, one click of the handwheel moves it whatever the increment is set in the config in inches, regardless of whether the machine is set to run in Metric or Inch. So if the first entry in the table is 1 then it moves 25.4mm!
If you then press the selection button on the pendant to change the increment, then it seems to move in different amounts, although they are 10x too small. ie 100 moves 0.01mm not 0.1mm
So for the moment, I've set all the values in the config to 0.001 so at least it doesn't drive off a huge distance if I don't change the increment on the pendant. It looks like at the very least there needs to be a better initialisation of the first increment because it's undefined at the moment and frankly dangerous.
Ideally, it should just read from the config table and take note of whether it's metric or imperial.
Any improvement would be most welcome. I don't need any clever functions, just for the basic ones to be rock solid.
Thanks,
Roger