If your PLC has modbus you can use it with Mach for extra I/O, tool changers etc. I have one on my lathe and it did the gear change routine for my spindle (now have AC servo), the toolchange for 6 position turret, 4 position toolpost, worked the chuck, coolant and loads of I/O for buttons and servo drives.
Hood