To setup the Mach IO Config with modbus is very simple, you will notice that you have a new Device to choose from in the IO config in Mach4.
We use Y001 in the click as a starting point for the Click PLC. In the M6 Macro we turn on the Y001 Output on and then off. We set a C# bit in the Click when Y001 Comes on, this C# Bit is what we use to start our tool change subprogram.
There is also a lua function to wait for a signal before moving on.
http://www.machsupport.com/forum/index.php/topic,31092.0.html here is thread that will help with this. In our M6 macro, we wait for the Orient Release signal from the Click to signal Mach4 to continue its own M6 cycle to finish up the tool change on Mach's end. And don't forget to Reset your C# bit in the last function of your tool change.
I can add more examples if you need them later.
Hope this helps.