Here's a document with examples of how to use basic read/write registers and coils via Modbus in Mach4 using very cheap and simple hardware. I made this for a class I am teaching and thought it might be helpful to others.
It includes the following examples:
1. Activate Output Example (Write Coil)
2. Monitor Inputs Example (Read Coils)
3. Read Register Example (Read Holding Registers 16bit)
4. Write Single Register Example (Write Single Register 16bit)
5. Write a Decimal Value using Two Registers (Write Multiple Registers 16bit)
6. LUA Mach4 Read/Write Access of Modbus Holding Registers