For example; I would use the abundant analog and digital inputs on an Arduino Mega to greatly augment the sensory input possibilities available to the PMDX-422. I would connect the limit and proximity sensors via the Arduino, and have the Arduino pass-on the data to the PMDX-422 via serial communication.
Yes, you could indeed use the capabilities of the Arduino to provide more/different kinds of inputs/outputs to Mach4.
Just to clarify, the MODBUS would communicate between Mach4 and the Arduino. The PMDX-422 would have no knowledge of that communication unless or until the MODBUS data caused some signal in Mach4 to change (i.e. a limit switch). Then Mach4 would tell our plug-in, which would in turn tell the PMDX-422.
WARNING: Home switches MUST be connected directly to the SmartBOB, or to the SmartBOB by way of the 26-pin ribbon header (or DB25 on the PMDX-411) through a PMDX-340 or breakout board (PMDX-126, etc.). The current firmware/plug-in (as of today, 24 Jun 2015) do not require the EStop or limit switches to go through the SmartBOB. However, future versions *may* require this.
Earlier today I had thought of using 3 of the Inputs (the extra 3 on the PMDX-422) to implement a simpler form of communications by treating the 3 inputs as one code register - giving me 9 possible "signals" or digital values that the Arduino could set using the 3 inputs on the PMDX-422. This would give me the ability to directly sense each end of each axis with limit switches as well as using proximity or other sensor types as well.
First, 3 inputs gives you 8 possible combinations, and one of those has to be (or should be?) "nothing of interest". So you are left with 7 possible things to signal. And, like the MODBUS discussion above, the PMDX-422 would not be interpreting the meaning of these "encoded" inputs. It would just pass the states to the Mach4 core. You would need some custom code running in Mach4 to decode the values and set/clear the desired Mach4 signals.
Bob